aboutsummaryrefslogtreecommitdiff
path: root/sys/plio/plloop.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/plio/plloop.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/plio/plloop.x')
-rw-r--r--sys/plio/plloop.x31
1 files changed, 31 insertions, 0 deletions
diff --git a/sys/plio/plloop.x b/sys/plio/plloop.x
new file mode 100644
index 00000000..500dc8bb
--- /dev/null
+++ b/sys/plio/plloop.x
@@ -0,0 +1,31 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <plio.h>
+
+# PLLOOP -- Increment the vector V from VS to VE (nested do loops cannot
+# be used because of the variable number of dimensions). Return LOOP_DONE
+# when V exceeds VE.
+
+int procedure plloop (v, vs, ve, ndim)
+
+long v[ndim] #U vector giving current position in image
+long vs[ndim] #I start vector
+long ve[ndim] #I end vector
+int ndim #I vector length
+
+int i
+
+begin
+ do i = 2, ndim {
+ v[i] = v[i] + 1
+ if (v[i] > ve[i]) {
+ if (i < ndim)
+ v[i] = vs[i]
+ else
+ break
+ } else
+ return (LOOP_AGAIN)
+ }
+
+ return (LOOP_DONE)
+end