GHOST  1.1.2
General, Hybrid, and Optimized Sparse Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Sparse matrix initialization

Functions to initialize sparse matrices. More...

Functions

ghost_error ghost_sparsemat_init_rowfunc (ghost_sparsemat *mat, ghost_sparsemat_src_rowfunc *src, ghost_mpi_comm mpicomm, double weight)
 Initializes a sparsemat from a row-based callback function. More...
 
ghost_error ghost_sparsemat_init_bin (ghost_sparsemat *mat, char *path, ghost_mpi_comm mpicomm, double weight)
 Initializes a sparsemat from a binary CRS file. More...
 
ghost_error ghost_sparsemat_init_mm (ghost_sparsemat *mat, char *path, ghost_mpi_comm mpicomm, double weight)
 Initializes a sparsemat from a Matrix Market file. More...
 
ghost_error ghost_sparsemat_init_crs (ghost_sparsemat *mat, ghost_gidx offs, ghost_lidx n, ghost_gidx *col, void *val, ghost_lidx *rpt, ghost_mpi_comm mpicomm, double weight)
 Initializes a sparsemat from local CRS data. More...
 

Detailed Description

Functions to initialize sparse matrices.

Function Documentation

ghost_error ghost_sparsemat_init_bin ( ghost_sparsemat mat,
char *  path,
ghost_mpi_comm  mpicomm,
double  weight 
)

Initializes a sparsemat from a binary CRS file.

Parameters
matThe matrix.
pathThe source file.
mpicommThe MPI communicator in which to create this sparsemat.
weightThe weight of each rank in the given MPI communicator.
Returns
GHOST_SUCCESS on success or an error indicator.

Allows the matrix' datatype to be GHOST_DT_NONE. In this case the datatype for the matrix is read from file. Otherwise the matrix datatype has to be valid and compatible.

Here is the call graph for this function:

ghost_error ghost_sparsemat_init_crs ( ghost_sparsemat mat,
ghost_gidx  offs,
ghost_lidx  n,
ghost_gidx col,
void *  val,
ghost_lidx rpt,
ghost_mpi_comm  mpicomm,
double  weight 
)

Initializes a sparsemat from local CRS data.

Parameters
matThe matrix.
offsThe global index of this rank's first row.
nThe local number of rows.
colThe (global) column indices.
valThe values.
rptThe row pointers.
mpicommThe MPI communicator in which to create this sparsemat.
weightThe weight of each rank in the given MPI communicator.
Returns
GHOST_SUCCESS on success or an error indicator.

Requires the matrix to have a valid and compatible datatype.

Here is the call graph for this function:

ghost_error ghost_sparsemat_init_mm ( ghost_sparsemat mat,
char *  path,
ghost_mpi_comm  mpicomm,
double  weight 
)

Initializes a sparsemat from a Matrix Market file.

Parameters
matThe matrix.
pathThe source file.
mpicommThe MPI communicator in which to create this sparsemat.
weightThe weight of each rank in the given MPI communicator.
Returns
GHOST_SUCCESS on success or an error indicator.

Allows the matrix' datatype to be GHOST_DT_NONE or one of the incomplete datatypes GHOST_DT_FLOAT and GHOST_DT_DOUBLE. If the matrix' datatype on entry is GHOST_DT_FLOAT or GHOST_DT_DOUBLE, the file will be interpreted either in single or double precision, respectively. In this case, the datatype will be completed with GHOST_DT_REAL or GHOST_DT_COMPLEX as specified in the input file. If the matrix' datatype on entry is GHOST_DT_NONE, GHOST_DT_DOUBLE is assumed. Otherwise the matrix datatype has to be valid and compatible.

Here is the call graph for this function:

ghost_error ghost_sparsemat_init_rowfunc ( ghost_sparsemat mat,
ghost_sparsemat_src_rowfunc src,
ghost_mpi_comm  mpicomm,
double  weight 
)

Initializes a sparsemat from a row-based callback function.

Parameters
matThe matrix.
srcThe source.
mpicommThe MPI communicator in which to create this sparsemat.
weightThe weight of each rank in the given MPI communicator.
Returns
GHOST_SUCCESS on success or an error indicator.

Requires the matrix to have a valid and compatible datatype.

Here is the call graph for this function: