aboutsummaryrefslogtreecommitdiff
path: root/sys/vops/amink.gx
blob: f2775252cb5b48f36343493289092c83639e12e1 (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
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

# AMINK -- Compute the minimum of a constant and a vector (generic).

procedure amink$t (a, b, c, npix)

PIXEL	a[ARB]
PIXEL	b
PIXEL	c[ARB]
int	npix, i
$if (datatype == x)
real	abs_b
$endif

begin
	$if (datatype == x)
	abs_b = abs (b)
	$endif

	do i = 1, npix
	    $if (datatype == x)
		if (abs(a[i]) <= abs_b)
		    c[i] = a[i]
		else
		    c[i] = b
	    $else
		c[i] = min (a[i], b)
	    $endif
end