This method resizes the slowest moving dimension (leftmost in C/C++, rightmost in VB) of an array or matrix by interpolating all elements along that dimension to create a longer or shorter array.
For multidimensional arrays, the interpolation is done column wise, so that an array of X,Y pairs (e.g, Dim Pts(2,nPts) As Single) the X's are interplated with their neighboring X and the Y's with neighboring Y's. All rows of a multidimensional object must have the same length (i.e., if an array of Variant is passed in, each Variant in the array must have the same shape).
Expansion and contraction are different operations. If the interplation lengthens the array (expansion), adjacent input values are interpolated for each output value. That is, the first and last source values are mapped onto the first and last results values, and all intermediate values are linearly interpolated.
If the array is shortened (contraction), both interpolation and averaging are used. Each result value is made up of an average of an integral number of interpolated input values.
If the bInterpolateCounts argument is True, then the values in the array are assumed to be counts rather than analog values. In this, case the total sum of the output values are scaled to be equal to the total sum of the input values.
Note that the results of both expansion or contraction interpolations, whether treated as counts or not, will usually be non-integral values, even if the source array consists of only integers. Furthermore, a round-trip expansion-then-contraction will never yield the original source array. (E.g. the length-2 array 1,4 made length 4 becomes 1,2,3,4 which becomes 1.5,3.5 when contracted back to length-2).
Should you wish to resize some dimension other than the slowest moving one, use the McTranspose method to rearrange dimensions (see Samples).