Mat class

A Spare Matrix object. More...


Files

file  mat.h
 Class Mat: a sparse matrix object.

Classes

struct  sMat
 Contains public data memebers for Mat class. More...

Typedefs

typedef struct sMat Mat
 Declaration of the Mat class as the Mat structure.

Functions

MatMat_ctor (Vmem *vmem, const char *name, int pnumR, int pnumC)
 The sparse matrix constructor.
void Mat_dtor (Mat **thee)
 The sparse matrix destructor.
void Mat_initStructure (Mat *thee, MATformat frmt, MATsym sym, int numO, int *IJA, double *A)
 Initialize the nonzero structure given structure information.
void Mat_copyStructure (Mat *thee, Mat *model)
 Initialize the nonzero structure given structure information.
void Mat_killStructure (Mat *thee)
 Kill the nonzero structure and structure information.
int Mat_numR (Mat *thee)
 Return number of rows in the matrix.
int Mat_numC (Mat *thee)
 Return number of columns in the matrix.
int Mat_numA (Mat *thee)
 Return number of nonzeros we are actually storing.
int Mat_numO (Mat *thee)
 Return number of nonzeros we are actually storing which are located in upper (or lower) triangle.
int Mat_numZ (Mat *thee)
 Return number of nonzeros we WOULD be storing if we were ignoring symmetry and storing all nonzeros.
MATformat Mat_format (Mat *thee)
 Return the format.
MATsym Mat_sym (Mat *thee)
 Return the symmetry.
MATstate Mat_state (Mat *thee)
 Return the state.
MATimpl Mat_impl (Mat *thee)
 Return the impl.
void Mat_setFormat (Mat *thee, MATformat format)
 Set the format.
void Mat_setSym (Mat *thee, MATsym sym)
 Set the symmetry.
void Mat_setState (Mat *thee, MATstate state)
 Set the state.
void Mat_setImpl (Mat *thee, MATimpl impl)
 Set the impl.
int Mat_sizeIJA (Mat *thee)
 Return total number of INTEGER STORAGE LOCATIONS in the matrix.
int Mat_sizeA (Mat *thee)
 Return total number of REAL STORAGE LOCATIONS in the matrix.
int * Mat_IJA (Mat *thee)
 Return the integer structure IJA.
int * Mat_IA (Mat *thee)
 Return the integer structure IA.
int * Mat_JA (Mat *thee)
 Return the integer structure JA.
double * Mat_A (Mat *thee)
 Return the real structure A.
double * Mat_diag (Mat *thee)
 Return the diagonal structure A.
double * Mat_offU (Mat *thee)
 Return the upper-triangle structure A.
double * Mat_offL (Mat *thee)
 Return the lower-triangle structure A.
void Mat_print (Mat *thee)
 Print the matrix as a DENSE matrix in MATLAB format.
void Mat_printSp (Mat *thee, char *fname, int pflag)
 Print the matrix as a SPARSE matrix in MATLAB format.
void Mat_printNoD (Mat *thee)
 Print the matrix as a DENSE matrix in MATLAB format, but first zero out any rows/cols corresponding to Dirichlet boundary points.
void Mat_printSpNoD (Mat *thee, char *fname, int pflag)
 Print the matrix as a DENSE matrix in MATLAB format, but first zero out any rows/cols corresponding to Dirichlet boundary points.
void Mat_zero (Mat *thee)
 Clear the floating point storage for the sparse matrix. Also clear any sparse factorization storage.
void Mat_set (Mat *thee, int i, int j, double val)
 Set a value in a matrix.
void Mat_addTo (Mat *thee, int i, int j, double val)
 Add to a value in a matrix.
void Mat_buildBRC (Mat *thee, int numBR, int numBC, int *BR, int *BC)
 Set the boundary row and column information.
void Mat_zeroBRC (Mat *thee)
 Apply the boundary row and column information.
void Mat_diagBRC (Mat *thee)
 Place identity entries on diagonal of boundary row/col.
void Mat_galerkin (Mat *thee, Mat *rmat, Mat *amat, Mat *pmat)
 Enforce the Galerkin conditions algebraically.
int Mat_sluDirect (Mat *thee)
 Make a decision about whether or not a sparse direct solver should be used in place of an iterative solver, based on the size of the system.
void Mat_sluCreate (Mat *thee)
 Setup for a sparse LU factorization of matrix.
int Mat_sluFactor (Mat *thee)
 Create the sparse LU factors for the system matrix.
int Mat_sluSolve (Mat *thee, int key, double *f, double *u)
 Performs a forward/backward solve using the sparse LU factors.
void Mat_sluDestroy (Mat *thee)
 Destroy the sparse LU factors for the system matrix.
void Mat_memChk (Mat *thee)
 Print the exact current malloc usage.
void Mat_copy (Mat *thee, Mat *smat)
 Copy a matrix.
void Mat_copyROW2COL (Mat *thee, Mat *smat)
 Copy a matrix from ROW to COL.
void Mat_copyCOL2ROW (Mat *thee, Mat *smat)
 Copy a matrix from COL to ROW.
void Mat_copyDRC2RLN (Mat *thee, Mat *smat)
 Copy a matrix from DRC to RLN.
void Mat_copyROW2RLN (Mat *thee, Mat *smat)
 Copy a matrix from ROW to RLN.
void Mat_copyCOL2RLN (Mat *thee, Mat *smat)
 Copy a matrix from COL to RLN.
void Mat_copyRLN2ROW (Mat *thee, Mat *smat)
 Copy a matrix from RLN to ROW.
void Mat_copyDRC2CLN (Mat *thee, Mat *smat)
 Copy a matrix from DRC to CLN.
void Mat_copyROW2CLN (Mat *thee, Mat *smat)
 Copy a matrix from ROW to CLN.
void Mat_copyCOL2CLN (Mat *thee, Mat *smat)
 Copy a matrix from COL to CLN.
void Mat_copyCLN2COL (Mat *thee, Mat *smat)
 Copy a matrix from CLN to COL.
void Mat_copyCLN2RLN (Mat *thee, Mat *smat)
 Copy a matrix from CLN to RLN.
void Mat_copyRLN2CLN (Mat *thee, Mat *smat)
 Copy a matrix from RLN to CLN.
void Mat_copyDRC2XLN (Mat *thee, Mat *smat)
 Copy a matrix from DRC to XLN.
void Mat_copyROW2XLN (Mat *thee, Mat *smat)
 Copy a matrix from ROW to XLN.
void Mat_copyCOL2XLN (Mat *thee, Mat *smat)
 Copy a matrix from COL to XLN.
void Mat_copyRLN2XLN (Mat *thee, Mat *smat)
 Copy a matrix from RLN to XLN.
void Mat_copyCLN2XLN (Mat *thee, Mat *smat)
 Copy a matrix from CLN to XLN.
void Mat_copyXLN2DRC (Mat *thee, Mat *smat)
 Copy a matrix from XLN to DRC.
void Mat_copyXLN2ROW (Mat *thee, Mat *smat)
 Copy a matrix from XLN to ROW.
void Mat_copyXLN2COL (Mat *thee, Mat *smat)
 Copy a matrix from XLN to COL.
void Mat_copyXLN2RLN (Mat *thee, Mat *smat)
 Copy a matrix from XLN to RLN.
void Mat_copyXLN2CLN (Mat *thee, Mat *smat)
 Copy a matrix from XLN to CLN.
void Mat_squeezeBRC (Mat *thee, int key)
 Remove the boundary rows or columns from a matrix.
void Mat_copy2 (Mat *Y, Mat *X)
 Raw copy of the nonzeros of X into Y.
void Mat_axpy (Mat *Y, Mat *X, double val, int key)
 scalar times a Mat plus a Mat: Y += val*X.
void Mat_initStructureLN (Mat *thee, MATformat frmt, MATsym sym)
 Initialize the nonzero structure given structure information.
void Mat_killStructureLN (Mat *thee)
 Kill the nonzero structure and structure information.
LinkRCMat_accessXLN (Mat *thee, int idx, int key)
 Access the first element in the ROW or COL of an XLN.
void Mat_contribXLN (Mat *thee, int key, int i, int j, double val)
 Set or add a value to a doubly linked matrix entry array.
void Mat_contribNSYMXLN (Mat *thee, int key, int i, int j, double val)
 Set or add a value to a NOTSYM XLN matrix.
void Mat_contribSSYMXLN (Mat *thee, int key, int i, int j, double val)
 Set or add a value to a STRUC_SYM XLN matrix.
void Mat_contribSYMXLN (Mat *thee, int key, int i, int j, double val)
 Set or add a value to a SYM XLN Matrix.
void Mat_printLN (Mat *thee)
 Print an LN format matrix as a DENSE matrix in MATLAB format.
void Mat_printLNSp (Mat *thee, char *fname, int pflag)
 Print an LN format matrix as a SPARSE matrix in MATLAB format.
MatMat_ctorPoint (Mat *P, const char *name, int ibase, int numR)
 Create a Mat pointer to the tail of a Pro.
void Mat_dtorPoint (Mat **thee)
 The Mat pointer destructor.
void Mat_printDiriSp (Mat *thee, char *fname, int pflag)
 Print the Dirichlet info of a Bmat in MATLAB sparse form.
void Mat_initGWMHB (Mat *G12, Mat *G22, Mat *G21, Mat *Mblock)
 Constructs G12/G22 for WMHB using Mhb and G21.

Detailed Description

A Spare Matrix object.


Typedef Documentation

typedef struct sMat Mat

Declaration of the Mat class as the Mat structure.

Author:
Michael Holst
Returns:
None


Function Documentation

double* Mat_A ( Mat thee  ) 

Return the real structure A.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
the real structure A
Parameters:
thee Pointer to the sparse matrix

LinkRC* Mat_accessXLN ( Mat thee,
int  idx,
int  key 
)

Access the first element in the ROW or COL of an XLN.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matln.c)
In the symmetric cases, we are just returning a pointer to the diagonal. In the nonsymmetric case, we are returning a pointer to the first element in the row or column. In the symmetric cases the columns are linked in reverse index ordering to save the storage of an additional pointer array.
Returns:
pointer to the diagonal element
Parameters:
thee Pointer to the sparse matrix
idx the index of array
key 0 ==> return a ROW pointer
1 ==> return a COL pointer

void Mat_addTo ( Mat thee,
int  i,
int  j,
double  val 
)

Add to a value in a matrix.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
i the index for row
j the index for column
val the value to be added on the sparse matrix element

void Mat_axpy ( Mat Y,
Mat X,
double  val,
int  key 
)

scalar times a Mat plus a Mat: Y += val*X.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
The function of this routine can be controlled using "key"
Returns:
None
Parameters:
Y the output matrix
X the source matrix
val the coeficient for scaling matrix X
key 0 ==> X and Y have the EXACT SAME nonzero structure (nZ). Very fast with no checking or temporary matrices
1 ==> The nZ of Y is a SUBSET of the nZ of X. Still fast but requires a few extra checks.
2 ==> X and Y have arbitrary nZ structure. Slowest requiring creation of a temporary link list.

void Mat_buildBRC ( Mat thee,
int  numBR,
int  numBC,
int *  BR,
int *  BC 
)

Set the boundary row and column information.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
key=0 ==> set pointers, key=1 ==> do a copy
Returns:
None
Parameters:
thee Pointer to the sparse matrix
numBR num of boundary rows
numBC num of boundary columns
BR boundary rows (optionally used)
BC boundary columns

void Mat_contribNSYMXLN ( Mat thee,
int  key,
int  i,
int  j,
double  val 
)

Set or add a value to a NOTSYM XLN matrix.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matln.c)
This is a doubly linked variant of mContrib.
Returns:
None
Parameters:
thee Pointer to the sparse matrix
key 0 ==> Set the value
1 ==> Add the value
i the location when traversing rowwise
j the new inserted location when traversing rowwise
val the contribution of the new inserted position

void Mat_contribSSYMXLN ( Mat thee,
int  key,
int  i,
int  j,
double  val 
)

Set or add a value to a STRUC_SYM XLN matrix.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matln.c)
This is a doubly linked variant of mContrib.
Returns:
None
Parameters:
thee Pointer to the sparse matrix
key 0 ==> Set the value
1 ==> Add the value
i the location when traversing rowwise
j the new inserted location when traversing rowwise
val the contribution of the new inserted position

void Mat_contribSYMXLN ( Mat thee,
int  key,
int  i,
int  j,
double  val 
)

Set or add a value to a SYM XLN Matrix.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matln.c)
This is a doubly linked variant of mContrib.
Returns:
None
Parameters:
thee Pointer to the sparse matrix
key 0 ==> Set the value
1 ==> Add the value
i the location when traversing rowwise
j the new inserted location when traversing rowwise
val the contribution of the new inserted position

void Mat_contribXLN ( Mat thee,
int  key,
int  i,
int  j,
double  val 
)

Set or add a value to a doubly linked matrix entry array.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matln.c)
This is a doubly linked variant of mContrib.
Returns:
None
Parameters:
thee Pointer to the sparse matrix
key 0 ==> Set the value
1 ==> Add the value
i the location when traversing rowwise
j the new inserted location when traversing rowwise
val the contribution of the new inserted position

void Mat_copy ( Mat thee,
Mat smat 
)

Copy a matrix.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat The source matrix

void Mat_copy2 ( Mat Y,
Mat X 
)

Raw copy of the nonzeros of X into Y.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
Y the object matrix
X the source matrix

void Mat_copyCLN2COL ( Mat thee,
Mat smat 
)

Copy a matrix from CLN to COL.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyCLN2RLN ( Mat thee,
Mat smat 
)

Copy a matrix from CLN to RLN.

Authors:
Michael Holst and Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyCLN2XLN ( Mat thee,
Mat smat 
)

Copy a matrix from CLN to XLN.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyCOL2CLN ( Mat thee,
Mat smat 
)

Copy a matrix from COL to CLN.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyCOL2RLN ( Mat thee,
Mat smat 
)

Copy a matrix from COL to RLN.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyCOL2ROW ( Mat thee,
Mat smat 
)

Copy a matrix from COL to ROW.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyCOL2XLN ( Mat thee,
Mat smat 
)

Copy a matrix from COL to XLN.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyDRC2CLN ( Mat thee,
Mat smat 
)

Copy a matrix from DRC to CLN.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyDRC2RLN ( Mat thee,
Mat smat 
)

Copy a matrix from DRC to RLN.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyDRC2XLN ( Mat thee,
Mat smat 
)

Copy a matrix from DRC to XLN.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyRLN2CLN ( Mat thee,
Mat smat 
)

Copy a matrix from RLN to CLN.

Authors:
Michael Holst and Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyRLN2ROW ( Mat thee,
Mat smat 
)

Copy a matrix from RLN to ROW.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyRLN2XLN ( Mat thee,
Mat smat 
)

Copy a matrix from RLN to XLN.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyROW2CLN ( Mat thee,
Mat smat 
)

Copy a matrix from ROW to CLN.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyROW2COL ( Mat thee,
Mat smat 
)

Copy a matrix from ROW to COL.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyROW2RLN ( Mat thee,
Mat smat 
)

Copy a matrix from ROW to RLN.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyROW2XLN ( Mat thee,
Mat smat 
)

Copy a matrix from ROW to XLN.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyStructure ( Mat thee,
Mat model 
)

Initialize the nonzero structure given structure information.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
This routine actually does the storage creation for both the integer structure information arrays and the nonzero value arrays.
Returns:
None
Parameters:
thee Pointer to the sparse matrix
model an input matrix

void Mat_copyXLN2CLN ( Mat thee,
Mat smat 
)

Copy a matrix from XLN to CLN.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyXLN2COL ( Mat thee,
Mat smat 
)

Copy a matrix from XLN to COL.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyXLN2DRC ( Mat thee,
Mat smat 
)

Copy a matrix from XLN to DRC.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyXLN2RLN ( Mat thee,
Mat smat 
)

Copy a matrix from XLN to RLN.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

void Mat_copyXLN2ROW ( Mat thee,
Mat smat 
)

Copy a matrix from XLN to ROW.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
smat the source matrix

Mat* Mat_ctor ( Vmem *  vmem,
const char *  name,
int  pnumR,
int  pnumC 
)

The sparse matrix constructor.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
This constructor only fixes the number of rows and columns in the matrix; the nonzero structure is not set.
Returns:
Pointer to a newly allocated (empty) sparse matrix
Parameters:
vmem Memory management object
name character string name for this matrix
pnumR num of rows in the matrix
pnumC num of cols (DRC REQUIRES numC=numR)

Mat* Mat_ctorPoint ( Mat P,
const char *  name,
int  ibase,
int  numR 
)

Create a Mat pointer to the tail of a Pro.

Author:
Stephen Bond
Note:
Class Whb: Non-Inlineable methods (hbtools.c)
Returns:
Pointer to the Mat object
Parameters:
P prolongation matrix maintained by aprx
name character string name for the matrix
ibase pointer to size array
numR num of rows in each array

double* Mat_diag ( Mat thee  ) 

Return the diagonal structure A.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
the diagonal structure A.
Parameters:
thee Pointer to the sparse matrix

void Mat_diagBRC ( Mat thee  ) 

Place identity entries on diagonal of boundary row/col.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix

void Mat_dtor ( Mat **  thee  ) 

The sparse matrix destructor.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
This destructor does the reverse of Mat_ctor, and if necessary first reverses Mat_initStructure (or Mat_copyStructure). I.e., if necessary, it first frees the large integer and real arrays created by Mat_initStructure or Mat_copyStructure, and then frees the Mat object itself at the last moment.
Returns:
None
Parameters:
thee Pointer to the sparse matrix

void Mat_dtorPoint ( Mat **  thee  ) 

The Mat pointer destructor.

Author:
Stephen Bond
Note:
Class Whb: Non-Inlineable methods (hbtools.c)
Returns:
None
Parameters:
thee Pointer to Pointer of the Mat object

MATformat Mat_format ( Mat thee  ) 

Return the format.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
the format
Parameters:
thee Pointer to the sparse matrix

void Mat_galerkin ( Mat thee,
Mat rmat,
Mat amat,
Mat pmat 
)

Enforce the Galerkin conditions algebraically.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
rmat R matrix which is stored column-wise (ROW-format)
amat A matrix which is stored in one of three forms, namely, either row-wise (ROW), col-wise (COL), or by diagonal followed by upper-triangle row-wise and then by lower triangle columne-wise (DRC).
pmat P matrix which is stored row-wise (ROW-format)

int* Mat_IA ( Mat thee  ) 

Return the integer structure IA.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
the integer structure IA.
Parameters:
thee Pointer to the sparse matrix

int* Mat_IJA ( Mat thee  ) 

Return the integer structure IJA.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
the integer structure IJA.
Parameters:
thee Pointer to the sparse matrix

MATimpl Mat_impl ( Mat thee  ) 

Return the impl.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
the impl
Parameters:
thee Pointer to the sparse matrix

void Mat_initGWMHB ( Mat G12,
Mat G22,
Mat G21,
Mat Mblock 
)

Constructs G12/G22 for WMHB using Mhb and G21.

Author:
Stephen Bond 2002/02/03
Note:
Class Whb: Non-Inlineable methods (rcmat.c)
 *   Notes:  This routine is the second step in the construction of the
 *           change of basis matrix for WMHB.  It constructs the G12 and
 *           G22 blocks using the mass matrix in the HB basis:
 *
 *           [ G11 ] = [ 0 ]  ;   [ G12 ] =  [ I ] inv(-Mhb_11) Mhb_12
 *           [ G21 ]   [ R ]      [ G22 ]    [ R ]
 *
 *           where Mhb is the previously formed mass matrix in the HB basis:
 *
 *           Mhb = [ Mhb_11 Mhb_12 ] = [ I R'] [ M_11 M_12 ] [ I 0 ]
 *                 [ Mhb_21 Mhb_22 ]   [ 0 I ] [ M_21 M_22 ] [ R I ]
 *
 *           Here inv( . ) represents any approximation to the inverse.
 *           To keep optimal complexity this should be chosen very carefully.
 *           Some possible choices include special matrix polynomials,
 *           mass lumping, or simply the inverse of the diagonal.
 *
 *           The G12 and G22 blocks should be passed in with zero state,
 *           with only their shape determined (i.e. just after ctor).  The
 *           G21 block must already exist, and contain the tail of the
 *           prolongation matrix, R.
 * 
Returns:
None
Parameters:
G12 Pointer to the Mat object
G22 Pointer to the Mat object
G21 Pointer to the Mat object
Mblock Pointer to the Mat object

void Mat_initStructure ( Mat thee,
MATformat  frmt,
MATsym  sym,
int  numO,
int *  IJA,
double *  A 
)

Initialize the nonzero structure given structure information.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
This routine actually does the storage creation for both the integer structure information arrays and the nonzero value arrays.
Returns:
None
Parameters:
thee Pointer to the sparse matrix
frmt format types of the sparse matrix
sym symmetric types of the sparse matrix
numO num of nonzeros we are actually storing in the strict upper-triangle of matrix. (DRC only)
IJA integer structure [ IA ; JA ]
A packed nozeros

void Mat_initStructureLN ( Mat thee,
MATformat  frmt,
MATsym  sym 
)

Initialize the nonzero structure given structure information.

Authors:
Stephen Bond and Michael Holst
Note:
Class Mat: Non-inlineable methods (matln.c)
This routine actually does the storage creation for all internal Vset, link arrays, and link pointer arrays.
Returns:
None
Parameters:
thee Pointer to the sparse matrix
frmt format types of the sparse matrix
sym symmetric types of the sparse matrix

int* Mat_JA ( Mat thee  ) 

Return the integer structure JA.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
the integer structure JA.
Parameters:
thee Pointer to the sparse matrix

void Mat_killStructure ( Mat thee  ) 

Kill the nonzero structure and structure information.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
This routine does the reverse of Mat_initStructure (or Mat_copyStructure). It leaves only the information about the number of blocks, number of rows, and number of columns per block. I.e., what is left is only what was present after the initial call to Mat_ctor.
Returns:
None
Parameters:
thee Pointer to the sparse matrix

void Mat_killStructureLN ( Mat thee  ) 

Kill the nonzero structure and structure information.

Authors:
Stephen Bond and Michael Holst
Note:
Class Mat: Non-inlineable methods (matln.c)
This routine does the reverse of Mat_initStructureLN (or Mat_copyStructureLN). It leaves only the information about the number of blocks, number of rows, and number of columns per block. I.e., what is left is only what was present after the initial call to Mat_ctor.
Returns:
None
Parameters:
thee Pointer to the sparse matrix

void Mat_memChk ( Mat thee  ) 

Print the exact current malloc usage.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix

int Mat_numA ( Mat thee  ) 

Return number of nonzeros we are actually storing.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
number of nonzeros we are actually storing.
Parameters:
thee Pointer to the sparse matrix

int Mat_numC ( Mat thee  ) 

Return number of columns in the matrix.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
number of columns in the matrix
Parameters:
thee Pointer to the sparse matrix

int Mat_numO ( Mat thee  ) 

Return number of nonzeros we are actually storing which are located in upper (or lower) triangle.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
number of nonzeros we are actually storing which are located in upper (or lower) triangle.
Parameters:
thee Pointer to the sparse matrix

int Mat_numR ( Mat thee  ) 

Return number of rows in the matrix.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
number of rows in the matrix
Parameters:
thee Pointer to the sparse matrix

int Mat_numZ ( Mat thee  ) 

Return number of nonzeros we WOULD be storing if we were ignoring symmetry and storing all nonzeros.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
number of nonzeros we WOULD be storing if we were ignoring symmetry and storing all nonzeros.
Parameters:
thee Pointer to the sparse matrix

double* Mat_offL ( Mat thee  ) 

Return the lower-triangle structure A.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
the lower-triangle structure A.
Parameters:
thee Pointer to the sparse matrix

double* Mat_offU ( Mat thee  ) 

Return the upper-triangle structure A.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
the upper-triangle structure A.
Parameters:
thee Pointer to the sparse matrix

void Mat_print ( Mat thee  ) 

Print the matrix as a DENSE matrix in MATLAB format.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix

void Mat_printDiriSp ( Mat thee,
char *  fname,
int  pflag 
)

Print the Dirichlet info of a Bmat in MATLAB sparse form.

Author:
Stephen Bond 2002/08/24
Note:
Class Whb: Non-Inlineable methods (hbtools.c)
Returns:
None
Parameters:
thee Pointer to the Mat object
fname character string name for the matrix
pflag index for write/append

void Mat_printLN ( Mat thee  ) 

Print an LN format matrix as a DENSE matrix in MATLAB format.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matln.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix

void Mat_printLNSp ( Mat thee,
char *  fname,
int  pflag 
)

Print an LN format matrix as a SPARSE matrix in MATLAB format.

Authors:
Michael Holst and Stephen Bond
Note:
Class Mat: Non-inlineable methods (matln.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
fname the output matrix name
pflag 0 ==> write, 1 ==> append

void Mat_printNoD ( Mat thee  ) 

Print the matrix as a DENSE matrix in MATLAB format, but first zero out any rows/cols corresponding to Dirichlet boundary points.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
This routine is useful for e.g. checking that Galerkin conditions hold for stiffness matrices. Removing the dirichlet equations is crucial; otherwise the Galerkin condition cannot hold. Note that the matrix (and the Galerkin coarse matrix) are then of course singular.
Returns:
None
Parameters:
thee Pointer to the sparse matrix

void Mat_printSp ( Mat thee,
char *  fname,
int  pflag 
)

Print the matrix as a SPARSE matrix in MATLAB format.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
fname the output sparse matrix name
pflag 0 ==> write, 1 ==> append

void Mat_printSpNoD ( Mat thee,
char *  fname,
int  pflag 
)

Print the matrix as a DENSE matrix in MATLAB format, but first zero out any rows/cols corresponding to Dirichlet boundary points.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
This routine is useful for e.g. checking that Galerkin conditions hold for stiffness matrices. Removing the dirichlet equations is crucial; otherwise the Galerkin condition cannot hold. Note that the matrix (and the Galerkin coarse matrix) are then of course singular.
Returns:
None
Parameters:
thee Pointer to the sparse matrix
fname the output sparse matrix name
pflag index for write/append

void Mat_set ( Mat thee,
int  i,
int  j,
double  val 
)

Set a value in a matrix.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
i the index for row
j the index for column
val the value of the sparse matrix element

void Mat_setFormat ( Mat thee,
MATformat  format 
)

Set the format.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
format the sparse matrix format

void Mat_setImpl ( Mat thee,
MATimpl  impl 
)

Set the impl.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
impl implicit diagonal block not stored

void Mat_setState ( Mat thee,
MATstate  state 
)

Set the state.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
state possible states of the sparse matrix format

void Mat_setSym ( Mat thee,
MATsym  sym 
)

Set the symmetry.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
sym symmetric types of the sparse matrix

int Mat_sizeA ( Mat thee  ) 

Return total number of REAL STORAGE LOCATIONS in the matrix.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
total number of REAL STORAGE LOCATIONS in the matrix.
Parameters:
thee Pointer to the sparse matrix

int Mat_sizeIJA ( Mat thee  ) 

Return total number of INTEGER STORAGE LOCATIONS in the matrix.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
total number of INTEGER STORAGE LOCATIONS in the matrix.
Parameters:
thee Pointer to the sparse matrix

void Mat_sluCreate ( Mat thee  ) 

Setup for a sparse LU factorization of matrix.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Creates internal <ia,ja,a> storage which is later freed by Mat_sluDestroy. Also initializes the sparse direct library.
Returns:
None
Parameters:
thee Pointer to the sparse matrix

void Mat_sluDestroy ( Mat thee  ) 

Destroy the sparse LU factors for the system matrix.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
This frees our <ia,ja,a> storage, and also the internal storage that was malloc'd by the sparse direct library.
Returns:
None
Parameters:
thee Pointer to the sparse matrix

int Mat_sluDirect ( Mat thee  ) 

Make a decision about whether or not a sparse direct solver should be used in place of an iterative solver, based on the size of the system.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
This is obviously heuristic in nature; in general the cutoff size where iterative methods start to win is smaller in 3D.
Returns:
the decision about whether or not a sparse direct solver should be used in place of an iterative solver, based on the size of the system.
Parameters:
thee Pointer to the sparse matrix

int Mat_sluFactor ( Mat thee  ) 

Create the sparse LU factors for the system matrix.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix

int Mat_sluSolve ( Mat thee,
int  key,
double *  f,
double *  u 
)

Performs a forward/backward solve using the sparse LU factors.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
This requires that Mat_sluFactor has been previously called.
Returns:
None
Parameters:
thee Pointer to the sparse matrix
key index for choosing NOTRANS or TRANS
f the number of right-hand sides
u solution pointer

void Mat_squeezeBRC ( Mat thee,
int  key 
)

Remove the boundary rows or columns from a matrix.

Author:
Stephen Bond
Note:
Class Mat: Non-inlineable methods (matcopy.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix
key index for removing the boundary rows or columns from a matrix

MATstate Mat_state ( Mat thee  ) 

Return the state.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
the state
Parameters:
thee Pointer to the sparse matrix

MATsym Mat_sym ( Mat thee  ) 

Return the symmetry.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
the symmetry.
Parameters:
thee Pointer to the sparse matrix

void Mat_zero ( Mat thee  ) 

Clear the floating point storage for the sparse matrix. Also clear any sparse factorization storage.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
This is basically done in preparation for an accumulation as part of a matrix assembly, and before a new sparse factorization.
Returns:
None
Parameters:
thee Pointer to the sparse matrix

void Mat_zeroBRC ( Mat thee  ) 

Apply the boundary row and column information.

Author:
Michael Holst
Note:
Class Mat: Non-inlineable methods (mat.c)
Returns:
None
Parameters:
thee Pointer to the sparse matrix


Generated on Mon Aug 9 11:13:45 2010 for MC by  doxygen 1.5.6