aboutsummaryrefslogtreecommitdiff
path: root/math/surfit/isfree.x
blob: 2eb25891cf8b94464747f8d9a8e2ded1eca9c44d (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
42
43
44
45
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include "surfitdef.h"

# ISFREE -- Procedure to free the surface descriptor

procedure isfree (sf)

pointer	sf		# pointer to the surface descriptor
errchk	mfree

begin
	# free arrays in memory

	# first the basis functions
	if (SF_XBASIS(sf) != NULL)
	    call mfree (SF_XBASIS(sf), MEM_TYPE)
	if (SF_XLEFT(sf) != NULL)
	    call mfree (SF_XLEFT(sf), TY_INT)
	if (SF_YBASIS(sf) != NULL)
	    call mfree (SF_YBASIS(sf), MEM_TYPE)
	if (SF_YLEFT(sf) != NULL)
	    call mfree (SF_YLEFT(sf), TY_INT)

	# next the x and y matrices
	if (SF_XMATRIX(sf) != NULL)
	    call mfree (SF_XMATRIX(sf), MEM_TYPE)
	if (SF_YMATRIX(sf) != NULL)
	    call mfree (SF_YMATRIX(sf), MEM_TYPE)

	# last the coefficient matrices
	if (SF_XCOEFF(sf) != NULL)
	    call mfree (SF_XCOEFF(sf), MEM_TYPE)
	if (SF_COEFF(sf) != NULL)
	    call mfree (SF_COEFF(sf), MEM_TYPE)

	if (SF_WZ(sf) != NULL)
	    call mfree (SF_WZ(sf), MEM_TYPE)
	if (SF_TLEFT(sf) != NULL)
	    call mfree (SF_TLEFT(sf), TY_INT)

	# free surface descriptor
	if (sf != NULL)
	    call mfree (sf, TY_STRUCT)
end