safe LoadGmin and code cleanup
This commit is contained in:
parent
143022eb68
commit
a71abe9e9d
|
|
@ -480,16 +480,19 @@ register ArrayOfElementPtrs Diag;
|
||||||
/* Begin `spLoadGmin'. */
|
/* Begin `spLoadGmin'. */
|
||||||
ASSERT_IS_SPARSE( Matrix );
|
ASSERT_IS_SPARSE( Matrix );
|
||||||
|
|
||||||
Diag = Matrix->Diag;
|
if (Gmin != 0.0) {
|
||||||
for (I = Matrix->Size; I > 0; I--)
|
Diag = Matrix->Diag;
|
||||||
Diag[I]->Real += Gmin;
|
for (I = Matrix->Size; I > 0; I--) {
|
||||||
|
if ((diag = Diag[I]) != NULL)
|
||||||
|
diag->Real += Gmin;
|
||||||
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIND ELEMENT
|
* FIND ELEMENT
|
||||||
*
|
*
|
||||||
|
|
@ -499,27 +502,6 @@ register ArrayOfElementPtrs Diag;
|
||||||
* pointer to the new element is returned.
|
* pointer to the new element is returned.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//SMPelement *
|
|
||||||
//SMPfindElt( Matrix, Row, Col, CreateIfMissing )
|
|
||||||
//
|
|
||||||
//SMPmatrix *Matrix;
|
|
||||||
//int Row, Col;
|
|
||||||
//int CreateIfMissing;
|
|
||||||
//{
|
|
||||||
////MatrixPtr Matrix = (MatrixPtr)eMatrix;
|
|
||||||
//spREAL *Element = (spREAL *)Matrix->FirstInCol[Col];
|
|
||||||
//
|
|
||||||
///* Begin `SMPfindElt'. */
|
|
||||||
// ASSERT_IS_SPARSE( Matrix );
|
|
||||||
// if (CreateIfMissing)
|
|
||||||
// { Element = spcCreateElement( Matrix, Row, Col,
|
|
||||||
// &Matrix->FirstInRow[Row],
|
|
||||||
// &Matrix->FirstInCol[Col], NO );
|
|
||||||
// }
|
|
||||||
// else Element = spcFindElement( Matrix, Row, Col );
|
|
||||||
// return (SMPelement *)Element;
|
|
||||||
//}
|
|
||||||
|
|
||||||
SMPelement *
|
SMPelement *
|
||||||
SMPfindElt(SMPmatrix *Matrix, int Row, int Col, int CreateIfMissing)
|
SMPfindElt(SMPmatrix *Matrix, int Row, int Col, int CreateIfMissing)
|
||||||
{
|
{
|
||||||
|
|
@ -528,7 +510,6 @@ SMPfindElt(SMPmatrix *Matrix, int Row, int Col, int CreateIfMissing)
|
||||||
/* Begin `SMPfindElt'. */
|
/* Begin `SMPfindElt'. */
|
||||||
ASSERT_IS_SPARSE( Matrix );
|
ASSERT_IS_SPARSE( Matrix );
|
||||||
Row = Matrix->ExtToIntRowMap[Row];
|
Row = Matrix->ExtToIntRowMap[Row];
|
||||||
|
|
||||||
Col = Matrix->ExtToIntColMap[Col];
|
Col = Matrix->ExtToIntColMap[Col];
|
||||||
|
|
||||||
if (Col == -1)
|
if (Col == -1)
|
||||||
|
|
@ -597,6 +578,14 @@ SMPcAddCol(SMPmatrix *Matrix, int Accum_Col, int Addend_Col)
|
||||||
return spErrorState( Matrix );
|
return spErrorState( Matrix );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SMPconstMult()
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
SMPconstMult(SMPmatrix *Matrix, double constant)
|
||||||
|
{
|
||||||
|
spConstMult(Matrix, constant);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SMPmultiply()
|
* SMPmultiply()
|
||||||
|
|
@ -611,11 +600,3 @@ SMPmultiply(SMPmatrix *Matrix, double *RHS, double *Solution, double *iRHS, doub
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* SMPconstMult()
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
SMPconstMult(SMPmatrix *Matrix, double constant)
|
|
||||||
{
|
|
||||||
spConstMult(Matrix, constant);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue