File: VRfShift.html

package info (click to toggle)
libtsp 3r0-1
  • links: PTS
  • area: non-free
  • in suites: potato, woody
  • size: 5,096 kB
  • ctags: 1,798
  • sloc: ansic: 14,464; sh: 1,217; makefile: 182
file content (60 lines) | stat: -rw-r--r-- 1,464 bytes parent folder | download
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<HTML>
<HEAD>
<TITLE>TSP (libtsp/VR) - VRfShift</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFACD">
<H2>VRfShift</H2>
<HR>
<H4>Routine</H4>
<DL>
<DT>
void VRfShift (float x[], int Nkeep, int Nshift)
</DL>
<H4>Purpose</H4>
<DL>
<DT>
Shift the elements of an array of floats
</DL>
<H4>Description</H4>
This routine shifts elements of a float array.  If the number of elements to
be retained is zero, no action is taken.  For a shift down (Nshift positive),
the elements of the array are shifted down to the bottom of the array.  The
input array must have at least Nkeep + Nshift elements.
<P>
<PRE>
  x[i+Nshift] --&gt; x[i], for i from 0 to Nkeep-1
</PRE>
<P>
For a shift up (Nshift negative), the elements of the array are shifted up to
the top of the array.  The input array must have at least Nkeep - Nshift
elements (Nshift being negative).
<P>
<PRE>
  x[i] --&gt; x[i-Nshift], for i from Nkeep-1 to 0
</PRE>
<H4>Parameters</H4>
<DL>
<DT>
&lt;-&gt; float x[]
<DD>
Array of floats (Nkeep + |Nshift| elements)
<DT>
 -&gt; int Nkeep
<DD>
Number of elements to be retained
<DT>
 -&gt; int Nshift
<DD>
Number of positions to be shifted.  Nshift is positive for a shift down
and negative for a shift up.
</DL>
<H4>Author / revision</H4>
P. Kabal  Copyright (C) 1996
/ Revision 1.9  1996/06/26
<H4>See Also</H4>
<A HREF="VRfCopy.html">VRfCopy</A>
<P>
<HR>
Main Index <A HREF="../libtsp.html">libtsp</A>
</BODY>
</HTML>