aboutsummaryrefslogtreecommitdiff
path: root/sys/vops/lz/arcps.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/vops/lz/arcps.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/vops/lz/arcps.x')
-rw-r--r--sys/vops/lz/arcps.x24
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/vops/lz/arcps.x b/sys/vops/lz/arcps.x
new file mode 100644
index 00000000..0e0f8056
--- /dev/null
+++ b/sys/vops/lz/arcps.x
@@ -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 arcps (a, b, c, npix)
+
+short a # constant numerator
+short b[ARB] # vector denominator
+short c[ARB] # output vector
+int npix
+int i
+
+begin
+ if (a == 0) {
+ call aclrs (c, npix)
+ } else if (a == 1) {
+ do i = 1, npix
+ c[i] = 1 / b[i]
+ } else {
+ do i = 1, npix
+ c[i] = a / b[i]
+ }
+end