aboutsummaryrefslogtreecommitdiff
path: root/math/nlfit/nlvector.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/nlvector.gx
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'math/nlfit/nlvector.gx')
-rw-r--r--math/nlfit/nlvector.gx27
1 files changed, 27 insertions, 0 deletions
diff --git a/math/nlfit/nlvector.gx b/math/nlfit/nlvector.gx
new file mode 100644
index 00000000..f33d063c
--- /dev/null
+++ b/math/nlfit/nlvector.gx
@@ -0,0 +1,27 @@
+include <math/nlfit.h>
+$if (datatype == r)
+include "nlfitdefr.h"
+$else
+include "nlfitdefd.h"
+$endif
+
+define VAR (($1 - 1) * $2 + 1)
+
+# NLVECTOR -- Evaluate the fit for a series of data points.
+
+procedure nlvector$t (nl, x, zfit, npts, nvars)
+
+pointer nl # pointer to nl fitting structure
+PIXEL x[ARB] # independent variables (npts * nvars)
+PIXEL zfit[ARB] # function values (npts)
+int npts # number of points
+int nvars # number of independent variables
+
+int i
+
+begin
+ # Compute the fitted function.
+ do i = 1, npts
+ call zcall5 (NL_FUNC(nl), x[VAR (i, nvars)], nvars,
+ PARAM(NL_PARAM(nl)), NL_NPARAMS(nl), zfit[i])
+end