Mathc complexes/Fichiers h : welmcop
Installer ce fichier dans votre répertoire de travail.
wel_mcop.h |
---|
/* ------------------------------------ */
/* Save as : wel_mcop.h */
/* ------------------------------------ */
/* ------------------------------------ */
double **M_swapC_mZ(
double **A,
int c1,
int c2)
{
double T;
int r;
if(c1!=C1) c1= (c1-C1)*C2+C1;
if(c2!=C1) c2= (c2-C1)*C2+C1;
for ( r=R0; r<A[R_SIZE][C0]; r++)
{
T = A[r][c1];
A[r][c1] = A[r][c2];
A[r][c2] = T;
T = A[r][c1+C1];
A[r][c1+C1] = A[r][c2+C1];
A[r][c2+C1] = T;
}
return(A);
}
/* ------------------------------------ */
double **M_mulC_mZ(
double **A,
nb_Z z,
int c
)
{
nb_Z T;
int r;
if(c!=C1) c= (c-C1)*C2+C1;
for ( r=R1; r<A[R_SIZE][C0]; r++)
{
T = mul_Z( i_Z(A[r][c],
A[r][c+C1]),
z);
A[r][c] = T.r;
A[r][c+C1] = T.i;
}
return(A);
}
/* ------------------------------------ */
double **M_addC_mZ(
double **A,
nb_Z z,
int c1,
int c2
)
{
int r;
nb_Z T;
if(c1!=C1) c1= (c1-C1)*C2+C1;
if(c2!=C1) c2= (c2-C1)*C2+C1;
for ( r=R1; r<A[R_SIZE][C0]; r++)
{
T = add_Z(
mul_Z(i_Z(A[r][c1],A[r][c1+C1]), z),
i_Z(A[r][c2],A[r][c2+C1]));
A[r][c2] = T.r;
A[r][c2+C1] = T.i;
}
return(A);
}
/* ------------------------------------ */
/* ------------------------------------ */
Il y a les trois opérations élémentaires sur les colonnes. Version mathématique.