|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdods.dap.BaseType
dods.dap.DVector
dods.dap.DArray
dods.clients.matlab.MatlabArray
public class MatlabArray
An extention of the DArray class, with optimizations for Matlab.
DArray
Constructor Summary | |
---|---|
MatlabArray()
Construct a new MatlabArray . |
|
MatlabArray(String name)
Construct a new MatlabArray with name name . |
Method Summary | |
---|---|
protected static int |
get_cm_offset(int[] current_index,
int ndims,
int[] dims)
Given an index into, and the dimensions of the array, return the offset needed to access the referenced element assuming column-major storage order. |
protected static boolean |
get_next_rm_index(int[] current_index,
int ndims,
int[] dims)
Given a current index tuple and the dimensionality of the data, compute the next tuple. |
protected static int |
get_rm_offset(int[] current_index,
int ndims,
int[] dims)
Given an index into, and the dimensions of the array, return the offset needed to access the referenced element assuming row-major storage order. |
String |
getArrayTypeName()
Return the type of data held in the array as a String . |
Object |
getData()
Return the data held in the MatlabArray as an array of atomic types. |
static int[] |
rm_index2cm_index(int[] rm_dims,
int ndims)
A public interface to rm_index2cm_index which doesn't require memory to be allocated for the array containing the column-major dimensions |
protected static void |
rm_index2cm_index(int[] cm_dims,
int[] rm_dims,
int ndims)
Given the row-major index array (with ndims-1 elements), load values into cm_dims so that the dimensions will be listed in Matlab's n-major order. |
static double[] |
rm2cm(double[] src,
int ndims,
int[] rm_dims)
Given the double array described by rm_dims[ndims], transform that array from row-major to column-major order. |
Methods inherited from class dods.dap.DArray |
---|
appendDim, appendDim, checkSemantics, clone, getDimension, getDimensions, getFirstDimension, getTypeName, numDimensions, printDecl, printVal |
Methods inherited from class dods.dap.DVector |
---|
addVariable, deserialize, externalize, getLength, getPrimitiveVector, setLength |
Methods inherited from class dods.dap.BaseType |
---|
checkSemantics, elementCount, elementCount, getLongName, getName, getParent, newPrimitiveVector, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printDecl, printVal, printVal, printVal, setName, setParent |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MatlabArray()
MatlabArray
.
public MatlabArray(String name)
MatlabArray
with name name
.
name
- The name of the arrayMethod Detail |
---|
public String getArrayTypeName()
String
.
public Object getData()
protected static int get_rm_offset(int[] current_index, int ndims, int[] dims)
current_index
- The index to retrieve the offset forndims
- The number of dimensionsdims
- An array containing The dimensions of the array
current_index
from
a single-dimension array in row-major order.protected static int get_cm_offset(int[] current_index, int ndims, int[] dims)
current_index
- The index to retrieve the offset forndims
- The number of dimensionsdims
- An array containing the dimensions of the array
current_index
from
a single-dimension array in column-major order.public static double[] rm2cm(double[] src, int ndims, int[] rm_dims)
Assume that the rm_dims array contains the dimension information in row-major order.
src
- The column-major array to convert to row-majorndims
- The number of dimensions in the arraydims
- An array containing the dimensions of the arrayprotected static void rm_index2cm_index(int[] cm_dims, int[] rm_dims, int ndims)
Assume that enough storage has already been allocated to cm_dims.
Algorithm: RM order: Plane, Row, Column
NM order: Row, Column, Plane.
Move the last two dimensions from the RM order to the first two of the NM order. Then copy each plane dimension from the front of the RM ordering to the back of the NM ordering reversing those entries as they are copied.
Note that if ndims is less then three then this function just copies the values and, in that case, it is better to not use this function.
cm_dims
- An array for which the appropriate memory has been already
allocated to store the column-major dimensions inrm_dims
- An array containing the row-major dimensions to be
converted into column-majorndims
- The number of dimensionspublic static int[] rm_index2cm_index(int[] rm_dims, int ndims)
rm_dims
- An array containing the row-major dimensions to be
converted into column-majorndims
- The number of dimensions
protected static boolean get_next_rm_index(int[] current_index, int ndims, int[] dims)
current_index
- An array containing the rm index to be incrementedndims
- The number of dimensions in the arraydims
- An array containing the dimensions of the array.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |