Mathc complexes/a62
Apparence
Installer ce fichier dans votre répertoire de travail.
wdx.h |
---|
/* ------------------------------------ */
/* Save as : wdx.h */
/* ------------------------------------ */
/* ------------------------------------ */
double **X_U_mZ(
double **A_T,
double **U,
double factor
)
{
int r = rsize_Z(A_T);
int c = csize_Z(A_T);
int i;
/* ------------------------------------ */
double **sA_T = smul_mZ(factor,A_T,i_mZ(r,c));
double **sA = ctranspose_mZ(sA_T,i_mZ(c,r));
double **sA_TsA = i_mZ(r,r);
double **sAsA_T = i_mZ(c,c);
double **M_Ualue = i_mZ(r,C1);
/* ------------------------------------ */
double **Ide = eye_mZ(i_mZ(c,c));
double **zIde = i_mZ(c,c);
double **AmnszIde = i_mZ(c,c);
/* ------------------------------------ */
double **Ab ;
double **b = i_mZ(c, C1 );
/* ------------------------------------ */
double **Ab_free = i_Abr_Ac_bc_mZ(c,c,C2);
double **b_free = i_mZ( c, C2);
/* ------------------------------------ */
mul_mZ(sA_T,sA,sA_TsA);
eigs_mZ(sA_TsA,M_Ualue);
/* ------------------------------------ */
/* ------------------------------------ */
mul_mZ(sA,sA_T,sAsA_T);
/* ------------------------------------ */
/* ------------------------------------ */
for(i = R1; i <= csize_Z(U); i++)
{
zmul_mZ(i_Z(M_Ualue[i][C1],M_Ualue[i][C2]),Ide,zIde);
MmnsD_mZ(sAsA_T,zIde,AmnszIde);
/* ------------------------------------ */
Ab = c_A_b_Ab_mZ(AmnszIde, b, i_Abr_Ac_bc_mZ(c,c,C1));
/* ------------------------------------ */
GJ_PP_FreeV_mZ(Ab,Ab_free,b_free);
c_c_mZ(b_free,C2,U,i);
}
Normalize_mZ(U);
f_mZ(sA_T);
f_mZ(sA);
f_mZ(sA_TsA);
f_mZ(sAsA_T);
f_mZ(M_Ualue);
f_mZ(Ide);
f_mZ(zIde);
f_mZ(AmnszIde);
f_mZ(Ab);
f_mZ(b);
f_mZ(Ab_free);
f_mZ(b_free);
return(U);
}
/* ------------------------------------ */
/* ------------------------------------ */
double **X_V_mZ(
double **A_T,
double **V,
double factor
)
{
int r = rsize_Z(A_T);
int c = csize_Z(A_T);
int i;
/* ------------------------------------ */
double **sA_T = smul_mZ(factor,A_T,i_mZ(r,c));
double **sA = ctranspose_mZ(sA_T, i_mZ(c,r));
double **sA_TsA = i_mZ(r,r);
double **M_Value = i_mZ(r,C1);
/* ------------------------------------ */
double **Ide = eye_mZ(i_mZ(r,r));
double **zIde = i_mZ(r,r);
double **AmnszIde = i_mZ(r,r);
/* ------------------------------------ */
double **Ab ;
double **b = i_mZ(r, C1 );
/* ------------------------------------ */
double **Ab_free = i_Abr_Ac_bc_mZ(r,r,C2);
double **b_free = i_mZ( r, C2);
/* ------------------------------------ */
mul_mZ(sA_T,sA,sA_TsA);
eigs_mZ(sA_TsA,M_Value);
/* ------------------------------------ */
for(i = R1; i <= csize_Z(V); i++)
{
zmul_mZ(i_Z(M_Value[i][C1],M_Value[i][C2]),Ide,zIde);
MmnsD_mZ(sA_TsA,zIde,AmnszIde);
/* ------------------------------------ */
Ab = c_A_b_Ab_mZ(AmnszIde, b, i_Abr_Ac_bc_mZ(r,r,C1));
/* ------------------------------------ */
GJ_PP_FreeV_mZ(Ab,Ab_free,b_free);
c_c_mZ(b_free,C2,V,i);
}
Normalize_mZ(V);
f_mZ(sA_T);
f_mZ(sA);
f_mZ(sA_TsA);
f_mZ(M_Value);
f_mZ(Ide);
f_mZ(zIde);
f_mZ(AmnszIde);
f_mZ(Ab);
f_mZ(b);
f_mZ(Ab_free);
f_mZ(b_free);
return(V);
}
/* ------------------------------------ */
/* ------------------------------------ */
double **X_inv_mZ(
double **M_Value,
double **invM_Value
)
{
int r;
int c;
nb_Z a;
for ( r=R1; r<M_Value[R_SIZE][C0]; r++)
for ( c=C1; c<M_Value[C_SIZE][C0]; c+=C2)
if(((r-R1)*C2)==c-C1)
{
a = inv_Z(i_Z( M_Value[r][c], M_Value[r][c+C1]));
invM_Value[r][c ] = a.r;
invM_Value[r][c+C1] = a.i;
}
return(invM_Value);
}
/* ------------------------------------ */
/* ------------------------------------ */