diff liboctave/sparse-util.cc @ 15185:82d51d6e470c

Proceed with the sparse Choleski computation when requested (bug #37095) * chol.cc (Fchol): Pass nargout in the info paramter to the sparse Choleski objects. * sparse-base-chol.h (sparse_base_chol_rep::sparse_base_chol_rep): Pass the info (=nargout) paramter to the init function. (sparse_base_chol_rep::init): New nargout parameter * sparse-base-chol.cc (sparse_base_chol_rep::init): Also check for nargout to decide if should proceed with the cholmod computations or not. * sparse-util.cc (SparseCholError): Don't warn about CHOLMOD_NOT_POSDEF.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Tue, 14 Aug 2012 15:54:43 -0400
parents 72c96de7a403
children 50156b22f87c
line wrap: on
line diff
--- a/liboctave/sparse-util.cc
+++ b/liboctave/sparse-util.cc
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include "lo-error.h"
+#include "oct-sparse.h"
 #include "sparse-util.h"
 
 // FIXME this overload is here due to API change in SuiteSparse (3.1 -> 3.2)
@@ -40,10 +41,15 @@
 void
 SparseCholError (int status, const char *file, int line, const char *message)
 {
-  (*current_liboctave_warning_handler)("warning %i, at line %i in file %s",
-                                     status, line, file);
+  // Ignore CHOLMOD_NOT_POSDEF, since we handle that in Fchol as an
+  // error or exit status.
+  if (status != CHOLMOD_NOT_POSDEF)
+    {
+      (*current_liboctave_warning_handler)("warning %i, at line %i in file %s",
+                                           status, line, file);
 
-  (*current_liboctave_warning_handler)(message);
+      (*current_liboctave_warning_handler)(message);
+    }
 }
 
 int