2 #include <../../nrnconf.h> 52 "Sparse1.3: Copyright (c) 1985,86,87,88 by Kenneth S. Kundert";
72 #define spINSIDE_SPARSE 115 {
for (I = Matrix->
Size; I > 0; I--)
117 while (pElement !=
NULL)
118 { pElement->
Real = 0.0;
119 pElement->Imag = 0.0;
126 {
for (I = Matrix->
Size; I > 0; I--)
128 while (pElement !=
NULL)
129 { pElement->
Real = 0.0;
207 if ((Row == 0)
OR (Col == 0))
226 if ((Row > Matrix->
Size)
OR (Col > Matrix->
Size))
312 pElement = *LastAddr;
315 while (pElement !=
NULL)
316 {
if (pElement->
Row < Row)
322 else if (pElement->
Row == Row)
383 register int IntRow, IntCol, ExtRow, ExtCol;
413 if (IntRow > Matrix->
Size)
434 if (IntCol > Matrix->
Size)
581 int Row1, Row2, Col1, Col2;
756 pElement->
Real = 0.0;
758 pElement->Imag = 0.0;
761 pElement->pInitInfo =
NULL;
771 while (pElement !=
NULL)
774 if (pElement->
Col < Col)
780 else pElement =
NULL;
784 pElement = pCreatedElement;
785 if (pLastElement ==
NULL)
819 pElement->
Real = 0.0;
821 pElement->Imag = 0.0;
824 pElement->pInitInfo =
NULL;
833 return pCreatedElement;
879 for (Col = Matrix->
Size; Col >= 1; Col--)
884 while (pElement !=
NULL)
885 { pElement->
Col = Col;
886 FirstInRowEntry = &FirstInRowArray[pElement->
Row];
923 register int NewSize;
928 Matrix->
Size = NewSize;
930 if (NewSize <= OldAllocatedSize)
934 NewSize =
MAX( NewSize, EXPANSION_FACTOR * OldAllocatedSize );
971 for (I = OldAllocatedSize+1; I <= NewSize; I++)
1012 register int NewSize;
1019 if (NewSize <= OldAllocatedSize)
1023 NewSize =
MAX( NewSize, EXPANSION_FACTOR * OldAllocatedSize );
1036 for (I = OldAllocatedSize+1; I <= NewSize; I++)
1127 {
for (J = Matrix->
Size; J > 0; J--)
1129 while (pElement !=
NULL)
1130 { pElement->Imag = 0.0;
1138 for (J = Matrix->
Size; J > 0; J--)
1141 while (pElement !=
NULL)
1142 {
if (pElement->pInitInfo ==
NULL)
1143 { pElement->
Real = 0.0;
1145 pElement->Imag = 0.0;
1149 { Error = (*pInit)((
RealNumber *)pElement, pElement->pInitInfo,
ArrayOfElementPtrs FirstInRow
struct MatrixElement TrashCan
void spClear(char *eMatrix)
ArrayOfElementPtrs FirstInCol
#define IS_SPARSE(matrix)
struct MatrixElement * NextInRow
ElementPtr spcGetFillin(MatrixPtr Matrix)
BOOLEAN InternalVectorsAllocated
struct MatrixElement * ElementPtr
register ElementPtr pElement
#define ASSERT(condition)
int spGetOnes(char *Matrix, int Pos, int Neg, int Eqn, struct spTemplate *Template)
ElementPtr spcGetElement(MatrixPtr Matrix)
RealNumber * spGetElement(char *eMatrix, int Row, int Col)
int spGetQuad(char *Matrix, int Row1, int Row2, int Col1, int Col2, struct spTemplate *Template)
static void ExpandTranslationArrays()
int spGetAdmittance(char *Matrix, int Node1, int Node2, struct spTemplate *Template)
void spcLinkRows(MatrixPtr Matrix)
#define REALLOC(ptr, type, number)
ElementPtr spcCreateElement(MatrixPtr Matrix, int Row, int Col, ElementPtr *LastAddr, BOOLEAN Fillin)
ElementPtr spcFindElementInCol(MatrixPtr Matrix, ElementPtr *LastAddr, int Row, int Col, BOOLEAN CreateIfMissing)
struct MatrixFrame * MatrixPtr
#define spADD_REAL_QUAD(template, real)
struct MatrixElement * NextInCol
static void EnlargeMatrix()
BOOLEAN PreviousMatrixWasComplex