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

# ADOT -- Vector inner or dot product.  The function value is the sum of the
# products of each pair of elements of the input vectors.

$if (datatype == ld)
double procedure adot$t (a, b, npix)
$else
real procedure adot$t (a, b, npix)
$endif

PIXEL	a[ARB], b[ARB]

$if (datatype == ld)
double	sum
$else
real	sum
$endif

int	npix, i

begin
	sum = 0$f
	do i = 1, npix
	    sum = sum + a[i] * b[i]

	return (sum)
end