aboutsummaryrefslogtreecommitdiff
path: root/math/nlfit/nlzero.gx
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/nlzero.gx
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'math/nlfit/nlzero.gx')
-rw-r--r--math/nlfit/nlzero.gx38
1 files changed, 38 insertions, 0 deletions
diff --git a/math/nlfit/nlzero.gx b/math/nlfit/nlzero.gx
new file mode 100644
index 00000000..ffd1458b
--- /dev/null
+++ b/math/nlfit/nlzero.gx
@@ -0,0 +1,38 @@
+$if (datatype == r)
+include "nlfitdefr.h"
+$else
+include "nlfitdefd.h"
+$endif
+
+
+# NLZERO -- Zero the accumulators and reset the fitting parameter values to
+# their original values set by nlinit().
+
+procedure nlzero$t (nl)
+
+pointer nl # pointer to nl fitting structure
+
+int nparams # number of parameters
+int nfparams # number of fitted parameters
+
+begin
+ # Get number of parameters and fitting parameters.
+ nparams = NL_NPARAMS(nl)
+ nfparams = NL_NFPARAMS(nl)
+
+ # Clear temporary array space.
+ call aclr$t (ALPHA(NL_ALPHA(nl)), nfparams * nfparams)
+ call aclr$t (COVAR(NL_COVAR(nl)), nfparams * nfparams)
+ call aclr$t (CHOFAC(NL_CHOFAC(nl)), nfparams * nfparams)
+ call aclr$t (BETA(NL_BETA(nl)), nfparams)
+
+ # Clear space for derivatives and trial parameter vectors.
+ call aclr$t (DERIV(NL_DERIV(nl)), nparams)
+ call aclr$t (TRY(NL_TRY(nl)), nparams)
+
+ # Reset parameters.
+ call amov$t (OPARAM(NL_OPARAM(nl)), PARAM(NL_PARAM(nl)), nparams)
+ call aclr$t (DPARAM(NL_DPARAM(nl)), nparams)
+
+ NL_SCATTER(nl) = PIXEL(0.0)
+end