aboutsummaryrefslogtreecommitdiff
path: root/math/curfit/cvstatr.x
blob: ee5ef05bf6a4353d5382832845afcd1f6e292e91 (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
46
47
48
49
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include	<math/curfit.h>

include	"curfitdef.h"

# CVSTATI -- Return integer paramters from the curfit package

int procedure cvstati (cv, param)

pointer	cv			# Curfit pointer
int	param			# Parameter

begin
	switch (param) {
	case CVTYPE:
	    return (CV_TYPE(cv))
	case CVORDER:
	    switch (CV_TYPE(cv)) {
	    case LEGENDRE, CHEBYSHEV, USERFNC:
	        return (CV_ORDER(cv))
	    case SPLINE1, SPLINE3:
		return (CV_NPIECES(cv) + 1)
	    }
	case CVNSAVE:
	    if (CV_TYPE(cv) == USERFNC)
	        return (CV_SAVECOEFF + CV_NCOEFF(cv))
	    else
		return (CV_SAVECOEFF + CV_NCOEFF(cv) - 1)
	case CVNCOEFF:
	    return (CV_NCOEFF(cv))
	}
end

# CVSTATR -- Return real paramters from the curfit package

real procedure cvstatr (cv, param)

pointer	cv			# Curfit pointer
int	param			# Parameter

begin
	switch (param) {
	case CVXMIN:
	    return (CV_XMIN(cv))
	case CVXMAX:
	    return (CV_XMAX(cv))
	}
end