Main Page   Compound List   File List   File Members  

spAllocate.c File Reference

#include <stdio.h>
#include "spConfig.h"
#include "spMatrix.h"
#include "spDefs.h"

Functions

spMatrix spCreate (int Size, int Complex, spError *pError)
ElementPtr spcGetElement (MatrixPtr Matrix)
ElementPtr spcGetFillin (MatrixPtr Matrix)
void spDestroy (spMatrix eMatrix)
spError spErrorState (spMatrix eMatrix)
void spWhereSingular (spMatrix eMatrix, int *pRow, int *pCol)
int spGetSize (spMatrix eMatrix, int External)
void spSetReal (spMatrix eMatrix)
void spSetComplex (spMatrix eMatrix)
int spFillinCount (spMatrix eMatrix)
int spElementCount (spMatrix eMatrix)

Variables

char spcMatrixIsNotValid [] = "Matrix passed to Sparse is not valid"
char spcErrorsMustBeCleared [] = "Error not cleared"
char spcMatrixMustBeFactored [] = "Matrix must be factored"
char spcMatrixMustNotBeFactored [] = "Matrix must not be factored"

Detailed Description

This file contains functions for allocating and freeing matrices, configuring them, and for accessing global information about the matrix (size, error status, etc.).

Objects that begin with the spc prefix are considered private and should not be used.

Author:
Kenneth S. Kundert <kundert@users.sourceforge.net>

Function Documentation

spMatrix spCreate int    Size,
int    Complex,
spError   pError
 

Allocates and initializes the data structures associated with a matrix.

Returns :
A pointer to the matrix is returned cast into spMatrix (typically a pointer to a void). This pointer is then passed and used by the other matrix routines to refer to a particular matrix. If an error occurs, the NULL pointer is returned.
Parameters:
Size  Size of matrix or estimate of size of matrix if matrix is EXPANDABLE.
Complex  Type of matrix. If Complex is 0 then the matrix is real, otherwise the matrix will be complex. Note that if the routines are not set up to handle the type of matrix requested, then an spPANIC error will occur. Further note that if a matrix will be both real and complex, it must be specified here as being complex.
pError  Returns error flag, needed because function spErrorState() will not work correctly if spCreate() returns NULL. Possible errors include spNO_MEMORY and spPANIC.

void spDestroy spMatrix    eMatrix
 

Destroys a matrix and frees all memory associated with it.

Parameters:
eMatrix  Pointer to the matrix frame which is to be destroyed.

int spElementCount spMatrix    eMatrix
 

This function returns the total number of elements (including fill-ins) that currently exists in a matrix.

Parameters:
eMatrix  Pointer to matrix.

spError spErrorState spMatrix    eMatrix
 

This function returns the error status of the given matrix.

Returns :
The error status of the given matrix.
Parameters:
eMatrix  The pointer to the matrix for which the error status is desired.

int spFillinCount spMatrix    eMatrix
 

This function returns the number of fill-ins that currently exists in a matrix.

Parameters:
eMatrix  Pointer to matrix.

int spGetSize spMatrix    eMatrix,
int    External
 

Returns the size of the matrix. Either the internal or external size of the matrix is returned.

Parameters:
eMatrix  Pointer to matrix.
External  If External is set true, the external size , i.e., the value of the largest external row or column number encountered is returned. Otherwise the true size of the matrix is returned. These two sizes may differ if the TRANSLATE option is set true.

void spSetComplex spMatrix    eMatrix
 

Forces matrix to be complex.

Parameters:
eMatrix  Pointer to matrix.

void spSetReal spMatrix    eMatrix
 

Forces matrix to be real.

Parameters:
eMatrix  Pointer to matrix.

void spWhereSingular spMatrix    eMatrix,
int *    pRow,
int *    pCol
 

This function returns the row and column number where the matrix was detected as singular (if pivoting was allowed on the last factorization) or where a zero was detected on the diagonal (if pivoting was not allowed on the last factorization). Pivoting is performed only in spOrderAndFactor().

Parameters:
eMatrix  The matrix for which the error status is desired.
pRow  The row number.
pCol  The column number.


Generated on Mon Jun 30 12:01:27 2003 for Sparse by doxygen1.2.17