read_matrix.c

Definition of a global function to read all type of matrices.

Summary
read_matrix.cDefinition of a global function to read all type of matrices.
GetMpiType
read_matrixReads a matrix from a file in the format given by driver_type (see driver_type_enum).
dread_matrixReads a matrix from a file in the format given by driver_type (see driver_type_enum) and distribute the matrix on the MPI processors.
couple_Structure used to sort couples.
Variables
i
j
comparcoupleCompares 2 couples (i,j).
checkStrucSymCheck if unsymmetric matrix has a symmetric pattern, if not correct it.

GetMpiType

MPI_Datatype GetMpiType(void)

read_matrix

int read_matrix(char *filename,
pastix_int_t *ncol,
pastix_int_t **colptr,
pastix_int_t **rows,
pastix_float_t **values,
pastix_float_t **rhs,
char **type,
char **rhstype,
driver_type_t driver_type,
MPI_Comm pastix_comm)

Reads a matrix from a file in the format given by driver_type (see driver_type_enum).

Parameters

filenameName of the file to read from.
ncolNumber of column in the matrix (output).
colptrIndexes in rows and avals of first element of each column of the matrix.(output)
rowsRow of each element of the matrix.
valuesValues of each element of the matrix.
typetype of the matrix.
rhstypetype of the right and side.
driver_typedriver to use to read the matrix.
pastix_commMPI communicator containing all processes wich call read_matrix.

dread_matrix

int dread_matrix(char *filename,
pastix_int_t *ncol,
pastix_int_t **colptr,
pastix_int_t **rows,
pastix_int_t **loc2glob,
pastix_float_t **values,
pastix_float_t **rhs,
char **type,
char **rhstype,
driver_type_t driver_type,
MPI_Comm pastix_comm)

Reads a matrix from a file in the format given by driver_type (see driver_type_enum) and distribute the matrix on the MPI processors.

Parameters

filenameName of the file to read from.
ncolNumber of column in the matrix (output).
colptrIndexes in rows and avals of first element of each column of the matrix.(output)
rowsRow of each element of the matrix.
valuesValues of each element of the matrix.
typetype of the matrix.
rhstypetype of the right and side.
driver_typedriver to use to read the matrix.
pastix_commMPI communicator containing all processes wich call read_matrix.

couple_

Structure used to sort couples.

Variables

i

pastix_int_t i

j

pastix_int_t j

comparcouple

int comparcouple(const void *a,
const void *b)

Compares 2 couples (i,j).

Parameters

aone couple
bone other couple

Returns

-1if a_i < b_i
1if a_i > b_i
-1if a_i = b_i and a_j < b_j
1else

checkStrucSym

void checkStrucSym(pastix_int_t n,
pastix_int_t *nz,
pastix_int_t **colptr,
pastix_int_t **row,
pastix_float_t **avals)

Check if unsymmetric matrix has a symmetric pattern, if not correct it.

Parameters

nsize of the matrix
nznumber of elements
colptrIndex of first element of each column in row and avals
rowrow of each element
avalsvalue of each element
MPI_Datatype GetMpiType(void)
int read_matrix(char *filename,
pastix_int_t *ncol,
pastix_int_t **colptr,
pastix_int_t **rows,
pastix_float_t **values,
pastix_float_t **rhs,
char **type,
char **rhstype,
driver_type_t driver_type,
MPI_Comm pastix_comm)
Reads a matrix from a file in the format given by driver_type (see driver_type_enum).
enum driver_type_enum
int dread_matrix(char *filename,
pastix_int_t *ncol,
pastix_int_t **colptr,
pastix_int_t **rows,
pastix_int_t **loc2glob,
pastix_float_t **values,
pastix_float_t **rhs,
char **type,
char **rhstype,
driver_type_t driver_type,
MPI_Comm pastix_comm)
Reads a matrix from a file in the format given by driver_type (see driver_type_enum) and distribute the matrix on the MPI processors.
pastix_int_t i
pastix_int_t j
int comparcouple(const void *a,
const void *b)
Compares 2 couples (i,j).
void checkStrucSym(pastix_int_t n,
pastix_int_t *nz,
pastix_int_t **colptr,
pastix_int_t **row,
pastix_float_t **avals)
Check if unsymmetric matrix has a symmetric pattern, if not correct it.
Close