Added check for calling CCOLAMD with zero variables

release/4.3a0
Richard Roberts 2011-01-25 22:29:16 +00:00
parent 6a43f65ac6
commit a14a071310
1 changed files with 5 additions and 3 deletions

View File

@ -68,9 +68,11 @@ Permutation::shared_ptr Inference::PermutationCOLAMD_(const VariableIndex& varia
// call colamd, result will be in p
/* returns (1) if successful, (0) otherwise*/
if(nVars > 0) {
int rv = ccolamd(nFactors, nVars, Alen, &A[0], &p[0], knobs, stats, &cmember[0]);
if(rv != 1)
throw runtime_error((boost::format("ccolamd failed with return value %1%")%rv).str());
}
// ccolamd_report(stats);