aboutsummaryrefslogtreecommitdiff
path: root/math/nlfit/nlerrmsg.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /math/nlfit/nlerrmsg.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'math/nlfit/nlerrmsg.x')
-rw-r--r--math/nlfit/nlerrmsg.x24
1 files changed, 24 insertions, 0 deletions
diff --git a/math/nlfit/nlerrmsg.x b/math/nlfit/nlerrmsg.x
new file mode 100644
index 00000000..e2b04b73
--- /dev/null
+++ b/math/nlfit/nlerrmsg.x
@@ -0,0 +1,24 @@
+include <math/nlfit.h>
+
+# NLERRMSG -- Convert NLFIT error code into an error message.
+
+procedure nlerrmsg (ier, errmsg, maxch)
+
+int ier # NLFIT error code
+char errmsg[maxch] # output error message
+int maxch # maximum number of chars
+
+begin
+ switch (ier) {
+ case DONE:
+ call strcpy ("Solution converged", errmsg, maxch)
+ case SINGULAR:
+ call strcpy ("Singular matrix", errmsg, maxch)
+ case NO_DEG_FREEDOM:
+ call strcpy ("Too few points", errmsg, maxch)
+ case NOT_DONE:
+ call strcpy ("Solution did not converge", errmsg, maxch)
+ default:
+ call strcpy ("Unknown error code", errmsg, maxch)
+ }
+end