From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/vops/arcp.gx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 sys/vops/arcp.gx (limited to 'sys/vops/arcp.gx') diff --git a/sys/vops/arcp.gx b/sys/vops/arcp.gx new file mode 100644 index 00000000..6c7f9dc4 --- /dev/null +++ b/sys/vops/arcp.gx @@ -0,0 +1,24 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# ARCP -- Reciprocal of a constant divided by a vector. No divide by zero +# checking is performed. + +procedure arcp$t (a, b, c, npix) + +PIXEL a # constant numerator +PIXEL b[ARB] # vector denominator +PIXEL c[ARB] # output vector +int npix +int i + +begin + if (a == 0$f) { + call aclr$t (c, npix) + } else if (a == 1$f) { + do i = 1, npix + c[i] = 1$f / b[i] + } else { + do i = 1, npix + c[i] = a / b[i] + } +end -- cgit