diff liboctave/NLEqn.cc @ 227:1a48a1b91489

[project @ 1993-11-15 10:10:35 by jwe]
author jwe
date Mon, 15 Nov 1993 10:11:59 +0000
parents edfb6cafe85d
children 780cbbc57b7c
line wrap: on
line diff
--- a/liboctave/NLEqn.cc	Mon Nov 15 10:06:26 1993 +0000
+++ b/liboctave/NLEqn.cc	Mon Nov 15 10:11:59 1993 +0000
@@ -29,6 +29,7 @@
 #include <float.h>
 #include "NLEqn.h"
 #include "f77-uscore.h"
+#include "lo-error.h"
 
 extern "C"
 {
@@ -48,8 +49,7 @@
 void
 NLEqn::error (const char* msg)
 {
-  cerr << "Fatal NLEqn error. " << msg << "\n";
-  exit(1);
+  (*current_liboctave_error_handler) ("fatal NLEqn error: %s", msg);
 }
 
 // Constructors
@@ -99,7 +99,10 @@
 NLEqn::set_states (const Vector& xvec)
 {
   if (xvec.capacity () != n)
-    error ("dimension error");
+    {
+      error ("dimension error");
+      return;
+    }
 
   x = xvec;
 }
@@ -187,7 +190,10 @@
   int tmp_info = 0;
 
   if (n == 0)
-    error ("Equation set not initialized");
+    {
+      error ("equation set not initialized");
+      return Vector ();
+    }
 
   double tol = sqrt (DBL_EPSILON);