aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/daophot/allstar/dprectify.x
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /noao/digiphot/daophot/allstar/dprectify.x
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/digiphot/daophot/allstar/dprectify.x')
-rw-r--r--noao/digiphot/daophot/allstar/dprectify.x74
1 files changed, 74 insertions, 0 deletions
diff --git a/noao/digiphot/daophot/allstar/dprectify.x b/noao/digiphot/daophot/allstar/dprectify.x
new file mode 100644
index 00000000..5fd7c0db
--- /dev/null
+++ b/noao/digiphot/daophot/allstar/dprectify.x
@@ -0,0 +1,74 @@
+# DP_RECTIFY -- Shuffle a real vector based upon an input index vector using
+# dynamic memory.
+
+procedure dp_rectify (x, index, nitem)
+
+real x[ARB]
+int index[ARB]
+int nitem
+
+pointer sp, hold
+
+begin
+ call smark (sp)
+ call salloc (hold, nitem, TY_REAL)
+ call dp_dorect (x, Memr[hold], index, nitem)
+ call sfree (sp)
+end
+
+
+# DP_IRECTIFY -- Shuffle an integer vector based upon an input index vector
+# using dynamic memory.
+
+procedure dp_irectify (x, index, nitem)
+
+int x[ARB]
+int index[ARB]
+int nitem
+
+pointer sp, hold
+
+begin
+ call smark (sp)
+ call salloc (hold, nitem, TY_INT)
+ call dp_idorect (x, Memi[hold], index, nitem)
+ call sfree (sp)
+end
+
+
+# DP_DORECT -- Shuffle a vector based upon an input index vector using
+# a preallocated dummy array.
+
+procedure dp_dorect (x, hold, index, nitem)
+
+real x[ARB]
+real hold[ARB]
+int index[ARB]
+int nitem
+
+int i
+
+begin
+ call amovr (x, hold, nitem)
+ do i = 1, nitem
+ x[i] = hold[index[i]]
+end
+
+
+# DP_IDORECT -- Shuffle an integer vector based upon an input index vector
+# using a preallocated dummy array.
+
+procedure dp_idorect (x, hold, index, nitem)
+
+int x[ARB]
+int hold[ARB]
+int index[ARB]
+int nitem
+
+int i
+
+begin
+ call amovi (x, hold, nitem)
+ do i = 1, nitem
+ x[i] = hold[index[i]]
+end