2 #include <../../nrnconf.h> 42 "Sparse1.3: Copyright (c) 1985,86,87,88 by Kenneth S. Kundert";
61 #define spINSIDE_SPARSE 169 for (I = Size; I > 0; I--)
170 Intermediate[I] =
RHS[*(pExtOrder--)];
173 for (I = 1; I <=
Size; I++)
176 if ((Temp = Intermediate[I]) != 0.0)
177 { pPivot = Matrix->
Diag[
I];
178 Intermediate[
I] = (Temp *= pPivot->
Real);
181 while (pElement !=
NULL)
182 { Intermediate[pElement->
Row] -= Temp * pElement->
Real;
189 for (I = Size; I > 0; I--)
190 { Temp = Intermediate[
I];
192 while (pElement !=
NULL)
193 { Temp -= pElement->
Real * Intermediate[pElement->
Col];
196 Intermediate[
I] =
Temp;
201 for (I = Size; I > 0; I--)
202 Solution[*(pExtOrder--)] = Intermediate[
I];
302 --Solution; --iSolution;
304 RHS -= 2; Solution -= 2;
309 pExtOrder = &Matrix->IntToExtRowMap[Size];
312 for (I = Size; I > 0; I--)
314 Intermediate[
I].
Imag = iRHS[*(pExtOrder--)];
318 for (I = Size; I > 0; I--)
319 Intermediate[I] = ExtVector[*(pExtOrder--)];
323 for (I = 1; I <=
Size; I++)
324 { Temp = Intermediate[
I];
328 { pPivot = Matrix->Diag[
I];
331 Intermediate[
I] =
Temp;
333 while (pElement !=
NULL)
344 for (I = Size; I > 0; I--)
345 { Temp = Intermediate[
I];
348 while (pElement !=
NULL)
354 Intermediate[
I] =
Temp;
358 pExtOrder = &Matrix->IntToExtColMap[
Size];
360 #if spSEPARATED_COMPLEX_VECTORS 361 for (I = Size; I > 0; I--)
363 iSolution[*(pExtOrder--)] = Intermediate[I].Imag;
367 for (I = Size; I > 0; I--)
368 ExtVector[*(pExtOrder--)] = Intermediate[
I];
486 for (I = Size; I > 0; I--)
487 Intermediate[I] = RHS[*(pExtOrder--)];
490 for (I = 1; I <=
Size; I++)
493 if ((Temp = Intermediate[I]) != 0.0)
495 while (pElement !=
NULL)
496 { Intermediate[pElement->
Col] -= Temp * pElement->
Real;
504 for (I = Size; I > 0; I--)
505 { pPivot = Matrix->
Diag[
I];
506 Temp = Intermediate[
I];
508 while (pElement !=
NULL)
509 { Temp -= pElement->
Real * Intermediate[pElement->
Row];
512 Intermediate[
I] = Temp * pPivot->
Real;
517 for (I = Size; I > 0; I--)
518 Solution[*(pExtOrder--)] = Intermediate[
I];
534 #if TRANSPOSE AND spCOMPLEX 621 --Solution; --iSolution;
623 RHS -= 2; Solution -= 2;
628 pExtOrder = &Matrix->IntToExtColMap[Size];
631 for (I = Size; I > 0; I--)
633 Intermediate[
I].
Imag = iRHS[*(pExtOrder--)];
637 for (I = Size; I > 0; I--)
638 Intermediate[I] = ExtVector[*(pExtOrder--)];
642 for (I = 1; I <=
Size; I++)
643 { Temp = Intermediate[
I];
648 while (pElement !=
NULL)
659 for (I = Size; I > 0; I--)
660 { pPivot = Matrix->Diag[
I];
661 Temp = Intermediate[
I];
664 while (pElement !=
NULL)
676 pExtOrder = &Matrix->IntToExtRowMap[
Size];
678 #if spSEPARATED_COMPLEX_VECTORS 679 for (I = Size; I > 0; I--)
681 iSolution[*(pExtOrder--)] = Intermediate[I].Imag;
685 for (I = Size; I > 0; I--)
686 ExtVector[*(pExtOrder--)] = Intermediate[
I];
#define CMPLX_MULT_ASSIGN(to, from)
#define IS_FACTORED(matrix)
#define spSEPARATED_COMPLEX_VECTORS
struct ComplexNumber * ComplexVector
RealVector Solution IMAG_VECTORS
struct MatrixElement * NextInRow
#define CMPLX_MULT_SUBT_ASSIGN(to, from_a, from_b)
register RealVector Intermediate
ASSERT(IS_VALID(Matrix) AND IS_FACTORED(Matrix))
register ElementPtr pElement
static void SolveComplexTransposedMatrix()
void spSolve(eMatrix, RHS, Solution IMAG_VECTORS) char *eMatrix
static void SolveComplexMatrix()
struct MatrixFrame * MatrixPtr
#define CMPLX_MULT(to, from_a, from_b)
struct MatrixElement * NextInCol