119 int errorValue, mtxType, symmetryflag;
120 int seed = 30145, pivotingflag = 0;
121 int *oldToNew, *newToOld;
122 double droptol = 0.0, tau = 1.e300;
126 ChvManager *chvmanager;
129 DenseMtx *mtxY, *mtxX;
149 mtxY = DenseMtx_new();
150 DenseMtx_init(mtxY, mtxType, 0, 0, neqns, nrhs, 1, neqns);
152 for ( i = 0; i < neqns; i++ ) {
153 DenseMtx_setRealEntry( mtxY, i, 0, b.
at(i + 1) );
201 adjIVL = InpMtx_fullAdjacency(mtxA);
202 nedges = IVL_tsize(
adjIVL);
203 Graph_init2(
graph, 0, neqns, 0, nedges, neqns, nedges,
adjIVL,
206 fprintf(
msgFile,
"\n\n graph of the input matrix");
213 fprintf(
msgFile,
"\n\n front tree from ordering");
230 InpMtx_permute(mtxA, oldToNew, oldToNew);
231 if ( symmetryflag == SPOOLES_SYMMETRIC ||
232 symmetryflag == SPOOLES_HERMITIAN ) {
233 InpMtx_mapToUpperTriangle(mtxA);
236 InpMtx_changeCoordType(mtxA, INPMTX_BY_CHEVRONS);
237 InpMtx_changeStorageMode(mtxA, INPMTX_BY_VECTORS);
240 fprintf(
msgFile,
"\n\n old-to-new permutation vector");
242 fprintf(
msgFile,
"\n\n new-to-old permutation vector");
244 fprintf(
msgFile,
"\n\n front tree after permutation");
246 fprintf(
msgFile,
"\n\n input matrix after permutation");
247 InpMtx_writeForHumanEye(mtxA,
msgFile);
248 fprintf(
msgFile,
"\n\n symbolic factorization");
253 Tree_writeToFile(
frontETree->tree, (
char * )
"haggar.treef");
264 FRONTMTX_DENSE_FRONTS, pivotingflag, NO_LOCK, 0, NULL,
272 chvmanager = ChvManager_new();
273 ChvManager_init(chvmanager, NO_LOCK, 1);
274 DVfill(10, cpus, 0.0);
275 IVfill(20, stats, 0);
276 rootchv = FrontMtx_factorInpMtx(
frontmtx, mtxA, tau, droptol,
278 ChvManager_free(chvmanager);
280 fprintf(
msgFile,
"\n\n factor matrix");
285 if ( rootchv != NULL ) {
286 fprintf(
msgFile,
"\n\n matrix found to be singular\n");
290 if ( errorValue >= 0 ) {
291 fprintf(
msgFile,
"\n\n error encountered at front %d", errorValue);
303 fprintf(
msgFile,
"\n\n factor matrix after post-processing");
318 fprintf(
msgFile,
"\n\n right hand side matrix after permutation");
319 DenseMtx_writeForHumanEye(mtxY,
msgFile);
327 mtxX = DenseMtx_new();
328 DenseMtx_init(mtxX, mtxType, 0, 0, neqns, nrhs, 1, neqns);
333 fprintf(
msgFile,
"\n\n solution matrix in new ordering");
334 DenseMtx_writeForHumanEye(mtxX,
msgFile);
346 fprintf(
msgFile,
"\n\n solution matrix in original ordering");
347 DenseMtx_writeForHumanEye(mtxX,
msgFile);
355 for ( i = 0; i < neqns; i++ ) {
356 DenseMtx_realEntry(mtxX, i, 0, xptr + i);