Bibliothèque

Installer ce fichier dans votre répertoire de travail.

wdx.h
/* ------------------------------------ */
/*  Save as :  wdx.h                    */
/* ------------------------------------ */
/* ------------------------------------ */
double **X_U_mZ(
double **a,
double **U,
double FACTOR
)
{
int r = rsize_Z(a);
int c = csize_Z(a);
int i;

double **A          =       smul_mZ(FACTOR,a, i_mZ(r,c));
double **ctA        = ctranspose_mZ(A,        i_mZ(c,r));
double **ActA       =                         i_mZ(r,r);
double **ctAA       =                         i_mZ(c,c);
double **X_Value    =                         i_mZ(r,C1);

double **Ide        =        eye_mZ(          i_mZ(c,c));
double **zIde       =                         i_mZ(c,c);
double **ctAmnszIde =                         i_mZ(c,c);

double **ctAb;
double **b          =                         i_mZ(c,C1 );

double **ctAb_free  =                         i_Abr_Ac_bc_mZ(c,c,C2);
double  **b_free    =                         i_mZ(c,C2);

   mul_mZ(A,ctA,ActA);
  eigs_mZ(      ActA,X_Value);

  mul_mZ(ctA,A,ctAA);
  
for(i = R1; i <= csize_Z(U); i++)
  {      
     zmul_mZ(i_Z(X_Value[i][C1],X_Value[i][C2]),Ide,zIde);  
      sub_mZ(ctAA,zIde,ctAmnszIde);
    
    ctAb = c_A_b_Ab_mZ(ctAmnszIde, b, i_Abr_Ac_bc_mZ(c,c,C1)); 
        GJ_PP_FreeV_mZ(ctAb,ctAb_free,b_free); 
                c_c_mZ(b_free,C2,U,i); 
  }  
  
  Normalize_mZ(U);

  f_mZ(A);
  f_mZ(ctA);
  f_mZ(ActA);
  f_mZ(ctAA);
  f_mZ(X_Value);
  f_mZ(Ide);
  f_mZ(zIde);
  f_mZ(ctAmnszIde);
  f_mZ(ctAb);
  f_mZ(b);
  f_mZ(ctAb_free);
  f_mZ(b_free);
                        
 return(U);
}
/* ------------------------------------ */
/* ------------------------------------ */
double **X_V_mZ(
double **a,
double **V,
double FACTOR
)
{
int r = rsize_Z(a);
int c = csize_Z(a);
int i;

double **A          =       smul_mZ(FACTOR,a, i_mZ(r,c));
double **ctA        = ctranspose_mZ(A,        i_mZ(c,r));
double **ActA       =                         i_mZ(r,r);
double **X_Value    =                         i_mZ(r,C1);

double **Ide        =        eye_mZ(          i_mZ(r,r));
double **zIde       =                         i_mZ(r,r);
double **ctAmnszIde =                         i_mZ(r,r);

double **ctAb ;
double **b          =                         i_mZ(r,C1);

double **ctAb_free  =                         i_Abr_Ac_bc_mZ(r,r,C2);
double  **b_free    =                         i_mZ(r,C2);

   mul_mZ(A,ctA,ActA);
  eigs_mZ(      ActA,X_Value);

for(i = R1; i <= csize_Z(V); i++)
  {        
     zmul_mZ(i_Z(X_Value[i][C1],X_Value[i][C2]),Ide,zIde);    
      sub_mZ(ActA,zIde,ctAmnszIde);
   
    ctAb = c_A_b_Ab_mZ(ctAmnszIde, b, i_Abr_Ac_bc_mZ(r,r,C1)); 
        GJ_PP_FreeV_mZ(ctAb,ctAb_free,b_free);         
                c_c_mZ(b_free,C2,V,i); 
  }   
  
  Normalize_mZ(V);

  f_mZ(A);
  f_mZ(ctA);
  f_mZ(ActA);
  f_mZ(X_Value);
  f_mZ(Ide);
  f_mZ(zIde);
  f_mZ(ctAmnszIde);
  f_mZ(ctAb);
  f_mZ(b);
  f_mZ(ctAb_free);
  f_mZ(b_free);
                             
 return(V);
}
/* ------------------------------------ */
/* ------------------------------------ */
double **X_inv_mZ(
double **X_Value,
double **invX_Value
)
{
int  r;
int  c;
nb_Z X;

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

        if(((r-R1)*C2)==c-C1)
          {
             X = inv_Z(i_Z( X_Value[r][c], X_Value[r][c+C1]));
           
               invX_Value[r][c   ] = X.r;
               invX_Value[r][c+C1] = X.i;
          }
              
 return(invX_Value);
}
/* ------------------------------------ */
/* ------------------------------------ */