some handy commented code enable full ccolamd ordering

release/4.3a0
Yong-Dian Jian 2010-10-22 14:56:52 +00:00
parent 3f86a12655
commit 105a4a9b7f
1 changed files with 8 additions and 5 deletions

View File

@ -81,11 +81,12 @@ Permutation::shared_ptr Inference::PermutationCOLAMD(const VARIABLEINDEXTYPE& va
for(size_t i=0; i<nVars+1; ++i) for(size_t i=0; i<nVars+1; ++i)
cout << "p[" << i << "] = " << p[i] << endl; cout << "p[" << i << "] = " << p[i] << endl;
//double* knobs = NULL; /* colamd arg 6: parameters (uses defaults if NULL) */ double* knobs = NULL; /* colamd arg 6: parameters (uses defaults if NULL) */
double knobs[CCOLAMD_KNOBS]; // double knobs[CCOLAMD_KNOBS];
ccolamd_set_defaults(knobs); // ccolamd_set_defaults(knobs);
knobs[CCOLAMD_DENSE_ROW]=-1; // knobs[CCOLAMD_DENSE_ROW]=-1;
knobs[CCOLAMD_DENSE_COL]=-1; // knobs[CCOLAMD_DENSE_COL]=-1;
int stats[CCOLAMD_STATS]; /* colamd arg 7: colamd output statistics and error codes */ int stats[CCOLAMD_STATS]; /* colamd arg 7: colamd output statistics and error codes */
// call colamd, result will be in p // call colamd, result will be in p
@ -96,6 +97,8 @@ Permutation::shared_ptr Inference::PermutationCOLAMD(const VARIABLEINDEXTYPE& va
delete[] A; // delete symbolic A delete[] A; // delete symbolic A
delete[] cmember; delete[] cmember;
// ccolamd_report(stats);
// Convert elimination ordering in p to an ordering // Convert elimination ordering in p to an ordering
Permutation::shared_ptr permutation(new Permutation(nVars)); Permutation::shared_ptr permutation(new Permutation(nVars));
for (Index j = 0; j < nVars; j++) { for (Index j = 0; j < nVars; j++) {