#include <stdio.h>
#include "spConfig.h"
#include "spMatrix.h"
#include "spDefs.h"
Defines | |
#define | spINSIDE_SPARSE |
#define | BorderRight 0 |
#define | BorderDown 1 |
#define | DiagRight 2 |
#define | DiagDown 3 |
Functions | |
void | spClear (spMatrix eMatrix) |
spElement * | spFindElement (spMatrix eMatrix, int Row, int Col) |
spElement * | spGetElement (spMatrix eMatrix, int Row, int Col) |
spError | spGetAdmittance (spMatrix Matrix, int Node1, int Node2, struct spTemplate *Template) |
spError | spGetQuad (spMatrix Matrix, int Row1, int Row2, int Col1, int Col2, struct spTemplate *Template) |
spError | spGetOnes (spMatrix Matrix, int Pos, int Neg, int Eqn, struct spTemplate *Template) |
ElementPtr | spcFindDiag (MatrixPtr Matrix, register int Index) |
ElementPtr | spcCreateElement (MatrixPtr Matrix, int Row, register int Col, register ElementPtr *ppToLeft, register ElementPtr *ppAbove, BOOLEAN Fillin) |
void | spcLinkRows (MatrixPtr Matrix) |
int | spInitialize (spMatrix eMatrix, int(*pInit)(spElement *pElement, spGenericPtr pInitInfo, int Row, int Col)) |
void | spInstallInitInfo (spElement *pElement, spGenericPtr pInitInfo) |
spGenericPtr | spGetInitInfo (spElement *pElement) |
Objects that begin with the spc prefix are considered private and should not be used.
|
Sets every element of the matrix to zero and clears the error flag.
|
|
This routine is used to find an element given its indices. It will not create it if it does not exist.
|
|
Performs same function as spGetElement() except rather than one element, all four matrix elements for a floating two terminal admittance component are added. This routine also works if component is grounded. Positive elements are placed at [Node1,Node2] and [Node2,Node1]. This routine is only to be used after spCreate() and before spMNA_Preorder(), spFactor() or spOrderAndFactor().
|
|
Finds element [Row,Col] and returns a pointer to it. If element is not found then it is created and spliced into matrix. This routine is only to be used after spCreate() and before spMNA_Preorder(), spFactor() or spOrderAndFactor(). Returns a pointer to the real portion of an spElement. This pointer is later used by spADD_xxx_ELEMENT to directly access element.
|
|
This function returns a pointer to a data structure that is used to contain initialization information to a matrix element.
|
|
Addition of four structural ones to matrix by index. Performs similar function to spGetQuad() except this routine is meant for components that do not have an admittance representation. The following stamp is used: Pos Neg Eqn Pos [ . . 1 ] Neg [ . . -1 ] Eqn [ 1 -1 . ]
|
|
Similar to spGetAdmittance(), except that spGetAdmittance() only handles 2-terminal components, whereas spGetQuad() handles simple 4-terminals as well. These 4-terminals are simply generalized 2-terminals with the option of having the sense terminals different from the source and sink terminals. spGetQuad() adds four elements to the matrix. Positive elements occur at [Row1,Col1] [Row2,Col2] while negative elements occur at [Row1,Col2] and [Row2,Col1]. The routine works fine if any of the rows and columns are zero. This routine is only to be used after spCreate() and before spMNA_Preorder(), spFactor() or spOrderAndFactor() unless TRANSLATE is set true.
|
|
Initialize the matrix. With the INITIALIZE compiler option (see spConfig.h) set true, Sparse allows the user to keep initialization information with each structurally nonzero matrix element. Each element has a pointer that is set and used by the user. The user can set this pointer using spInstallInitInfo() and may be read using spGetInitInfo(). Both may be used only after the element exists. The function spInitialize() is a user customizable way to initialize the matrix. Passed to this routine is a function pointer. spInitialize() sweeps through every element in the matrix and checks the pInitInfo pointer (the user supplied pointer). If the pInitInfo is NULL, which is true unless the user changes it (almost always true for fill-ins), then the element is zeroed. Otherwise, the function pointer is called and passed the pInitInfo pointer as well as the element pointer and the external row and column numbers. If the user sets the value of each element, then spInitialize() replaces spClear(). The user function is expected to return a nonzero integer if there is a fatal error and zero otherwise. Upon encountering a nonzero return code, spInitialize() terminates, sets the error state of the matrix to be spMANGLED, and returns the error code.
|
|
This function installs a pointer to a data structure that is used to contain initialization information to a matrix element. It is is then used by spInitialize() to initialize the matrix.
|