102 std :: string msgFileName;
108 if ( !msgFileName.empty() ) {
109 msgFile = fopen(msgFileName.c_str(),
"w");
123 int errorValue, mtxType, symmetryflag;
124 int seed = 30145, pivotingflag = 0;
125 int *oldToNew, *newToOld;
126 double droptol = 0.0, tau = 1.e300;
130 ChvManager *chvmanager;
133 DenseMtx *mtxY, *mtxX;
153 mtxY = DenseMtx_new();
154 DenseMtx_init(mtxY, mtxType, 0, 0, neqns, nrhs, 1, neqns);
156 for ( i = 0; i < neqns; i++ ) {
157 DenseMtx_setRealEntry( mtxY, i, 0, b->
at(i + 1) );
205 adjIVL = InpMtx_fullAdjacency(mtxA);
206 nedges = IVL_tsize(
adjIVL);
207 Graph_init2(
graph, 0, neqns, 0, nedges, neqns, nedges,
adjIVL,
210 fprintf(
msgFile,
"\n\n graph of the input matrix");
217 fprintf(
msgFile,
"\n\n front tree from ordering");
234 InpMtx_permute(mtxA, oldToNew, oldToNew);
235 if ( symmetryflag == SPOOLES_SYMMETRIC ||
236 symmetryflag == SPOOLES_HERMITIAN ) {
237 InpMtx_mapToUpperTriangle(mtxA);
240 InpMtx_changeCoordType(mtxA, INPMTX_BY_CHEVRONS);
241 InpMtx_changeStorageMode(mtxA, INPMTX_BY_VECTORS);
244 fprintf(
msgFile,
"\n\n old-to-new permutation vector");
246 fprintf(
msgFile,
"\n\n new-to-old permutation vector");
248 fprintf(
msgFile,
"\n\n front tree after permutation");
250 fprintf(
msgFile,
"\n\n input matrix after permutation");
251 InpMtx_writeForHumanEye(mtxA,
msgFile);
252 fprintf(
msgFile,
"\n\n symbolic factorization");
257 Tree_writeToFile(
frontETree->tree, (
char * )
"haggar.treef");
268 FRONTMTX_DENSE_FRONTS, pivotingflag, NO_LOCK, 0, NULL,
276 chvmanager = ChvManager_new();
277 ChvManager_init(chvmanager, NO_LOCK, 1);
278 DVfill(10, cpus, 0.0);
279 IVfill(20, stats, 0);
280 rootchv = FrontMtx_factorInpMtx(
frontmtx, mtxA, tau, droptol,
282 ChvManager_free(chvmanager);
284 fprintf(
msgFile,
"\n\n factor matrix");
289 if ( rootchv != NULL ) {
290 fprintf(
msgFile,
"\n\n matrix found to be singular\n");
294 if ( errorValue >= 0 ) {
295 fprintf(
msgFile,
"\n\n error encountered at front %d", errorValue);
307 fprintf(
msgFile,
"\n\n factor matrix after post-processing");
322 fprintf(
msgFile,
"\n\n right hand side matrix after permutation");
323 DenseMtx_writeForHumanEye(mtxY,
msgFile);
331 mtxX = DenseMtx_new();
332 DenseMtx_init(mtxX, mtxType, 0, 0, neqns, nrhs, 1, neqns);
337 fprintf(
msgFile,
"\n\n solution matrix in new ordering");
338 DenseMtx_writeForHumanEye(mtxX,
msgFile);
350 fprintf(
msgFile,
"\n\n solution matrix in original ordering");
351 DenseMtx_writeForHumanEye(mtxX,
msgFile);
359 for ( i = 0; i < neqns; i++ ) {
360 DenseMtx_realEntry(mtxX, i, 0, xptr + i);
virtual ~SpoolesSolver()
Destructor.
virtual NM_Status solve(SparseMtrx &A, FloatArray &b, FloatArray &x)
Solves the given linear system by LDL^T factorization.
#define _IFT_SpoolesSolver_msglvl
#define _IFT_SpoolesSolver_msgfile
Base class for all matrices stored in sparse format.
double & at(int i)
Coefficient access function.
This base class is an abstraction for all numerical methods solving sparse linear system of equations...
This class provides an sparse matrix interface to SPOOLES InpMtrx.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver from given record.
unsigned long NM_Status
Mask defining NumMetod Status; which can be asked after finishing computation by Numerical Method...
#define OOFEM_LOG_DEBUG(...)
int giveValueType() const
SparseMtrx * Lhs
Last mapped LHS matrix.
SparseMtrx::SparseMtrxVersionType lhsVersion
Last mapped matrix version.
int giveNumberOfRows() const
Returns number of rows of receiver.
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
Class representing vector of real numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
SpoolesSolver(Domain *d, EngngModel *m)
Constructor.
REGISTER_SparseLinSolver(IMLSolver, ST_IML)
Class implementing single timer, providing wall clock and user time capabilities. ...
const double * givePointer() const
Gives the pointer to the raw data, breaking encapsulation.
int giveSymmetryFlag() const
Abstract base class representing the "problem" under consideration.
int giveSize() const
Returns the size of receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
SubMtxManager * mtxmanager
double getUtime()
Returns total user time elapsed in seconds.
void resize(int s)
Resizes receiver towards requested size.
SparseMtrxVersionType giveVersion()
Return receiver version.