From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- math/curfit/cvzero.gx | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 math/curfit/cvzero.gx (limited to 'math/curfit/cvzero.gx') diff --git a/math/curfit/cvzero.gx b/math/curfit/cvzero.gx new file mode 100644 index 00000000..c6774758 --- /dev/null +++ b/math/curfit/cvzero.gx @@ -0,0 +1,47 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +$if (datatype == r) +include "curfitdef.h" +$else +include "dcurfitdef.h" +$endif + +# 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. + +$if (datatype == r) +procedure cvzero (cv) +$else +procedure dcvzero (cv) +$endif + +pointer cv # pointer to curve descriptor + +errchk mfree + +begin + # zero the accumulators + CV_NPTS(cv) = 0 + call aclr$t (MATRIX(CV_MATRIX(cv)), CV_ORDER(cv)*CV_NCOEFF(cv)) + call aclr$t (VECTOR(CV_VECTOR(cv)), CV_NCOEFF(cv)) + + # free the basis functions defined from previous calls to cvrefit + if (CV_BASIS(cv) != NULL) { + $if (datatype == r) + call mfree (CV_BASIS(cv), TY_REAL) + call mfree (CV_WY(cv), TY_REAL) + $else + call mfree (CV_BASIS(cv), TY_DOUBLE) + call mfree (CV_WY(cv), TY_DOUBLE) + $endif + 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 -- cgit