Aller au contenu

Mathc complexes/a44

Un livre de Wikilivres.

Bibliothèque

Installer ce fichier dans votre répertoire de travail.

wdbm.h
/* ------------------------------------ */
/*  Save as :   wdbm.h                  */
/* ------------------------------------ */

/* ------------------------------------ */
double **MmnsD_mZ(
double **M,
double **D,
double **MmnsD
)
{
int r;
int c;

  dif_sizes_mZ(M,D,    "MmnsD_mZ();","(M or D)");
  dif_sizes_mZ(M,MmnsD,"MmnsD_mZ();","(MmnsD) ");

  for (   r=R1; r<M[R_SIZE][C0]; r++)
    for ( c=R1; c<M[C_SIZE][C0]; c+=C2)

        if(((r-R1)*C2)==c-C1)
            {
                 MmnsD[r][c   ] = M[r][c]    - D[r][c];
                 MmnsD[r][c+C1] = M[r][c+C1] - D[r][c+C1];
            }
        else{
                 MmnsD[r][c   ] = M[r][c];
                 MmnsD[r][c+C1] = M[r][c+C1];
             }
                 
         
 return(MmnsD);
}
/* ------------------------------------ */
double **DmnsM_mZ(
double **M,
double **D,
double **DmnsM
)
{
int r;
int c;

  dif_sizes_mZ(M,D,    "DmnsM_mZ();","(M or D)");
  dif_sizes_mZ(M,DmnsM,"DmnsM_mZ();","(MmnsD) ");

  for (   r=R1; r<M[R_SIZE][C0]; r++)
    for ( c=R1; c<M[C_SIZE][C0]; c+=C2)

        if(((r-R1)*C2)==c-C1)
            {
                 DmnsM[r][c   ] = D[r][c]    - M[r][c];
                 DmnsM[r][c+C1] = D[r][c+C1] - M[r][c+C1];
            }
        else{
                 DmnsM[r][c   ] = M[r][c];
                 DmnsM[r][c+C1] = M[r][c+C1];
             }
         
 return(DmnsM);
}
/* ------------------------------------ */
double **f_eigs_mZ(
double (*P_f)(double x),
double **A,
double **fA
)
{
int r;
int c;

  dif_sizes_mZ(A,fA,"eigs_f__mZ();","(A or fA");

  for (   r=R1; r<A[R_SIZE][C0]; r++)
    for ( c=C1; c<A[C_SIZE][C0]; c+=C2)

        if(((r-R1)*C2)==c-C1)
        
             fA[r][c] = (*P_f)(A[r][c]);
              
 return(fA);
}
/* ------------------------------------ */
/* ------------------------------------ */