Aller au contenu

Mathc matrices/Fichiers h : vrm tri

Un livre de Wikilivres.


Bibliothèque


Installer ce fichier dans votre répertoire de travail.

vrm_tri.h
/* ------------------------------------ */
/*  Save as :   vrm_tri.h               */
/* ------------------------------------ */
double **rdiag_mR(
double **A,
int      n
)
{
int      r;

  isquare_mR(A,"rdiag_mR;","(A)");
  
  m0_mR(A);
  
  for(r=R1; r<A[R_SIZE][C0]; r++)

             A[r][r] = r_I(n);
 return(A);
}
/* ------------------------------------ */
double **rpdiag_mR(
double **A,
int      n
)
{
int      r;

  isquare_mR(A,"rdiag_mR;","(A)");
  
  m0_mR(A);
  
  for(r=R1; r<A[R_SIZE][C0]; r++)

             A[r][r] = rp_I(n);
 return(A);
}
/* ------------------------------------ */
double **rsqrtdiag_mR(
double **A,
int      n
)
{
int      r;

  isquare_mR(A,"rdiag_mR;","(A)");
  
  m0_mR(A);
  
  for(r=R1; r<A[R_SIZE][C0]; r++)

             A[r][r] = sqrt(rp_I(n));
 return(A);
}
/* ------------------------------------ */
/* ------------------------------------ */
double **rlower_mR(
double **A,
int      n
)
{
int      r;
int      c;

  isquare_mR(A,"rlower_mR;","(A)");
  
  m0_mR(A);

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

             if(r>=c) A[r][c] = r_I(n);
 return(A);
}
/* ------------------------------------ */
double **rupper_mR(
double **A,
int      n
)
{
int      r;
int      c;

  isquare_mR(A,"rupper_mR;","(A)");
  
  m0_mR(A);

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

             if(c>=r) A[r][c] = r_I(n);
 return(A);
}
/* ------------------------------------ */ 
/* ------------------------------------ */
double **rToeplitz_mR(
double **U,
double **V,
double **A
)
{
int cn = C2;
int r  = R2;

int rn = R2;
int c  = C2;

  isquare_mR(A,"rlower_mR;","(A)");

  c_r_mR(U,R1,A,R1);
  c_c_mR(V,C1,A,C1);

  for(cn = C2; r <A[R_SIZE][C0]; cn++,r++)   

      c_rU_rA_cn_mR(U,R1,A,r,cn);  
      
      
  for(rn = R2; c <A[C_SIZE][C0]; rn++,c++)  
       
      c_cV_cA_rn_mR(V,C1,A,c,rn); 
          
 return(A);
}
/* ------------------------------------ */ 
/* ------------------------------------ */
double **rHankel_mR(
double **U,
double **V,
double **A
)
{
int cn = C2;
int r  = rsize_R(A)-R1;

int c = C1;

  isquare_mR(A,"rlower_mR;","(A)");

  c_c_mR(V,C1,A,C1);
  c_r_mR(U,R1,A,rsize_R(A));  
  
  for(cn = C2; r >= R1; cn++,r--)   

       c_rU_rA_cn_mR(U,R1,A,r,cn);


   c_c_r_mR(V,C1,U,R1);

  for(c=C1, r=R1; r < rsize_R(A)-C1; r++, c++)  
  
      c_Uc_r_mR(U,c,A,r);
              
 return(A);
}
/* ------------------------------------ */
/* ------------------------------------ */
double **rnilpotent_lower_mR(
double **A,
int      n
)
{
int      r;
int      c;

  isquare_mR(A,"rnilpotent_lower_mR;","(A)");
  
  m0_mR(A);

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

             if(r>=(c+C1)) A[r][c] = r_I(n);
 return(A);
}
/* ------------------------------------ */
double **rnilpotent_upper_mR(
double **A,
int      n
)
{
int      r;
int      c;

  isquare_mR(A,"rnilpotent_upper_mR;","(A)");
  
  m0_mR(A);

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

             if(c>=r) A[r][c] = r_I(n);
 return(A);
}
/* ------------------------------------ */  
/* ------------------------------------ */

Dans ce fichier se trouvent les fonctions qui permettront d'initialiser les matrices avec des valeurs aléatoires. Des matrices diagonales, triangulaires inférieures, triangulaires supérieures.