aboutsummaryrefslogtreecommitdiff
path: root/math/curfit/cvzeror.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/curfit/cvzeror.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'math/curfit/cvzeror.x')
-rw-r--r--math/curfit/cvzeror.x34
1 files changed, 34 insertions, 0 deletions
diff --git a/math/curfit/cvzeror.x b/math/curfit/cvzeror.x
new file mode 100644
index 00000000..bd84029f
--- /dev/null
+++ b/math/curfit/cvzeror.x
@@ -0,0 +1,34 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include "curfitdef.h"
+
+# CVZERO -- Procedure to zero the accumulators before doing
+# a new fit in accumulate mode. The inner products of the basis functions
+# are accumulated in the CV_ORDER(cv) by CV_NCOEFF(cv) array MATRIX, while
+# the inner products of the basis functions and the data ordinates are
+# accumulated in the CV_NCOEFF(cv)-vector VECTOR.
+
+procedure cvzero (cv)
+
+pointer cv # pointer to curve descriptor
+
+errchk mfree
+
+begin
+ # zero the accumulators
+ CV_NPTS(cv) = 0
+ call aclrr (MATRIX(CV_MATRIX(cv)), CV_ORDER(cv)*CV_NCOEFF(cv))
+ call aclrr (VECTOR(CV_VECTOR(cv)), CV_NCOEFF(cv))
+
+ # free the basis functions defined from previous calls to cvrefit
+ if (CV_BASIS(cv) != NULL) {
+ call mfree (CV_BASIS(cv), TY_REAL)
+ call mfree (CV_WY(cv), TY_REAL)
+ CV_BASIS(cv) = NULL
+ CV_WY(cv) = NULL
+ if (CV_LEFT(cv) != NULL) {
+ call mfree (CV_LEFT(cv), TY_INT)
+ CV_LEFT(cv) = NULL
+ }
+ }
+end