aboutsummaryrefslogtreecommitdiff
path: root/math/nlfit/nlerrmsg.x
diff options
context:
space:
mode:
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