diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /math/nlfit/nlzerod.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'math/nlfit/nlzerod.x')
-rw-r--r-- | math/nlfit/nlzerod.x | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/math/nlfit/nlzerod.x b/math/nlfit/nlzerod.x new file mode 100644 index 00000000..2ee86562 --- /dev/null +++ b/math/nlfit/nlzerod.x @@ -0,0 +1,34 @@ +include "nlfitdefd.h" + + +# NLZERO -- Zero the accumulators and reset the fitting parameter values to +# their original values set by nlinit(). + +procedure nlzerod (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 aclrd (ALPHA(NL_ALPHA(nl)), nfparams * nfparams) + call aclrd (COVAR(NL_COVAR(nl)), nfparams * nfparams) + call aclrd (CHOFAC(NL_CHOFAC(nl)), nfparams * nfparams) + call aclrd (BETA(NL_BETA(nl)), nfparams) + + # Clear space for derivatives and trial parameter vectors. + call aclrd (DERIV(NL_DERIV(nl)), nparams) + call aclrd (TRY(NL_TRY(nl)), nparams) + + # Reset parameters. + call amovd (OPARAM(NL_OPARAM(nl)), PARAM(NL_PARAM(nl)), nparams) + call aclrd (DPARAM(NL_DPARAM(nl)), nparams) + + NL_SCATTER(nl) = double(0.0) +end |