diff src/DLD-FUNCTIONS/chol.cc @ 3243:dd00769643ae

[project @ 1999-05-28 04:19:00 by jwe]
author jwe
date Fri, 28 May 1999 04:19:24 +0000
parents 38de16594cb4
children 7f8827f4040a
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/chol.cc	Fri Apr 09 00:20:06 1999 +0000
+++ b/src/DLD-FUNCTIONS/chol.cc	Fri May 28 04:19:24 1999 +0000
@@ -34,13 +34,13 @@
 #include "utils.h"
 
 DEFUN_DLD (chol, args, nargout,
-  "R = chol (X): cholesky factorization")
+  "[R, p] = chol (X): cholesky factorization")
 {
   octave_value_list retval;
 
   int nargin = args.length ();
 
-  if (nargin != 1 || nargout > 1)
+  if (nargin != 1 || nargout > 2)
     {
       print_usage ("chol");
       return retval;
@@ -69,7 +69,10 @@
 	  if (info != 0)
 	    error ("chol: matrix not positive definite");
 	  else
-	    retval = fact.chol_matrix ();
+	    {
+	      retval(1) = static_cast<double> (info);
+	      retval(0) = fact.chol_matrix ();
+	    }
 	}
     }
   else if (arg.is_complex_type ())
@@ -83,7 +86,10 @@
 	  if (info != 0)
 	    error ("chol: matrix not positive definite");
 	  else
-	    retval = fact.chol_matrix ();
+	    {
+	      retval(1) = static_cast<double> (info);
+	      retval(0) = fact.chol_matrix ();
+	    }
 	}
     }
   else