Mathc matrices/Fichiers h : vrm tri
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);
}
/* ------------------------------------ */
/* ------------------------------------ */
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.