aboutsummaryrefslogtreecommitdiff
path: root/math/nlfit/nlerrmsg.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /math/nlfit/nlerrmsg.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
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