aboutsummaryrefslogtreecommitdiff
path: root/math/nlfit/nlfree.gx
blob: 507dce5771f154a51b2940d74a0b3045af05288a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
$if (datatype == r)
include "nlfitdefr.h"
$else
include "nlfitdefd.h"
$endif

# NLFREE -- Deallocate all assigned space

procedure nlfree$t (nl)

pointer	nl		# pointer to non-linear fitting structure

errchk	mfree

begin
	if (nl == NULL)
	    return
	if (NL_PARAM(nl) != NULL)
	    call mfree (NL_PARAM(nl), TY_PIXEL)
	if (NL_OPARAM(nl) != NULL)
	    call mfree (NL_OPARAM(nl), TY_PIXEL)
	if (NL_DPARAM(nl) != NULL)
	    call mfree (NL_DPARAM(nl), TY_PIXEL)
	if (NL_DELPARAM(nl) != NULL)
	    call mfree (NL_DELPARAM(nl), TY_PIXEL)
	if (NL_PLIST(nl) != NULL)
	    call mfree (NL_PLIST(nl), TY_INT)
	if (NL_ALPHA(nl) != NULL)
	    call mfree (NL_ALPHA(nl), TY_PIXEL)
	if (NL_CHOFAC(nl) != NULL)
	    call mfree (NL_CHOFAC(nl), TY_PIXEL)
	if (NL_COVAR(nl) != NULL)
	    call mfree (NL_COVAR(nl), TY_PIXEL)
	if (NL_BETA(nl) != NULL)
	    call mfree (NL_BETA(nl), TY_PIXEL)
	if (NL_TRY(nl) != NULL)
	    call mfree (NL_TRY(nl), TY_PIXEL)
	if (NL_DERIV(nl) != NULL)
	    call mfree (NL_DERIV(nl), TY_PIXEL)
	call mfree (nl, TY_STRUCT)
end