Mathc complexes/h09l
Installer ce fichier dans votre répertoire de travail.
wgpivot.h |
---|
/* ------------------------------------ */
/* Save as : wgpivot.h */
/* ------------------------------------ */
/* ------------------------------------
pivotbest = |a+bI|^2 = = a^2+b^2
------------------------------------ */
double pivotbestAb_mZ(
double **Ab,
int pivot_r,
int pivot_c
)
{
double pivotbest=Ab[pivot_r][pivot_c] *Ab[pivot_r][pivot_c]
+
Ab[pivot_r][pivot_c+C1]*Ab[pivot_r][pivot_c+C1];
double pivot = pivotbest;
int best_r = pivot_r;
int best_c = pivot_c;
int r;
int c;
for( r=pivot_r; r<Ab[R_SIZE][C0]; r++)
for( c=pivot_c; c<Ab[C_SIZE_A][C0]; c+=C2)
{
pivot = Ab[r][c]*Ab[r][c] + Ab[r][c+C1]*Ab[r][c+C1];
if(pivot>pivotbest)
{
pivotbest=pivot;
best_r = r;
best_c = c;
}
}
if(best_r!=pivot_r) swapR_mZ(Ab,pivot_r,best_r);
if(best_c!=pivot_c) swapC_mZ(Ab,pivot_c,best_c);
return(pivotbest);
}
/* ------------------------------------ */
void zero_under_pivot_gjAb_mZ(
double **A,
int pivot_r,
int pivot_c
)
{
nb_Z pivot;
double abspivot=A[pivot_r][pivot_c] *A[pivot_r][pivot_c]
+
A[pivot_r][pivot_c+C1]*A[pivot_r][pivot_c+C1];
int r;
if(abspivot>ERROR_E)
{
pivot = i_Z( A[pivot_r][pivot_c],A[pivot_r][pivot_c+C1]);
mulR_mZ( A,
inv_Z(pivot),
pivot_r);
for( r=(pivot_r+C1); r<A[R_SIZE][C0]; r++)
addR_mZ( A,
sym_Z(i_Z( A[r][pivot_c],A[r][pivot_c+C1])),
pivot_r,
r);
}
}
/* ------------------------------------ */
void zero_below_pivot_gj_mZ(
double **Ab,
int pivot_r,
int pivot_c
)
{
double abspivot=Ab[pivot_r][pivot_c] *Ab[pivot_r][pivot_c]
+
Ab[pivot_r][pivot_c+C1]*Ab[pivot_r][pivot_c+C1];
int r;
if(abspivot>ERROR_E)
for( r=(pivot_r-C1); r>=R1; r--)
addR_mZ( Ab,
sym_Z(i_Z( Ab[r][pivot_c],
Ab[r][pivot_c+C1]) ),
pivot_r,
r);
}
/* ------------------------------------ */
/* ------------------------------------ */
Déclaration des fichiers h.