|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.lists.AbstractSequence gnu.lists.GeneralArray
public class GeneralArray
A class to handle general multi-dimensional arrays. This class is unfinished. If the number of dimensions (the "rank") is one, should use a class that implements Sequence. GeneralArray uses a SimpleVector 'base' to store the actual data, and provides general linear mapping from the array indexes to an element index in the 'base' SimpleVector. Thus such uperations as transposing an array can be implement as just creating a simple re-mapping of the indexes.
Constructor Summary | |
---|---|
GeneralArray()
|
|
GeneralArray(int[] dimensions)
|
Method Summary | |
---|---|
int |
createPos(int index,
boolean isAfter)
Generate a position at a given index. |
java.lang.Object |
get(int index)
See java.util.List. |
java.lang.Object |
get(int[] indexes)
|
int |
getEffectiveIndex(int[] indexes)
|
int |
getLowBound(int dim)
Get the least dimension along the specified dimension. |
java.lang.Object |
getRowMajor(int index)
|
int |
getSize(int dim)
Get length along specified dimension. |
static Array |
makeSimple(int[] lowBounds,
int[] dimensions,
SimpleVector base)
|
int |
rank()
Get the rank (number of dimensions) of this array. |
java.lang.Object |
set(int[] indexes,
java.lang.Object value)
|
int |
size()
See java.util.Collection. |
java.lang.String |
toString()
|
static void |
toString(Array array,
java.lang.StringBuffer sbuf)
|
Array |
transpose(int[] lowBounds,
int[] dimensions,
int offset0,
int[] factors)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface gnu.lists.Array |
---|
isEmpty |
Constructor Detail |
---|
public GeneralArray()
public GeneralArray(int[] dimensions)
Method Detail |
---|
public static Array makeSimple(int[] lowBounds, int[] dimensions, SimpleVector base)
public int rank()
Array
rank
in interface Array
rank
in class AbstractSequence
public int getEffectiveIndex(int[] indexes)
getEffectiveIndex
in interface Array
getEffectiveIndex
in class AbstractSequence
public java.lang.Object get(int index)
AbstractSequence
get
in class AbstractSequence
public int createPos(int index, boolean isAfter)
AbstractSequence
createPos
in class AbstractSequence
index
- offset from beginning of desired positionisAfter
- should the position have the isAfter propertypublic java.lang.Object getRowMajor(int index)
getRowMajor
in interface Array
public java.lang.Object get(int[] indexes)
get
in interface Array
get
in class AbstractSequence
public java.lang.Object set(int[] indexes, java.lang.Object value)
set
in interface Array
set
in class AbstractSequence
public int size()
size
in class AbstractSequence
public int getLowBound(int dim)
Array
getLowBound
in interface Array
getLowBound
in class AbstractSequence
public int getSize(int dim)
Array
getSize
in interface Array
getSize
in class AbstractSequence
public Array transpose(int[] lowBounds, int[] dimensions, int offset0, int[] factors)
transpose
in interface Array
public static void toString(Array array, java.lang.StringBuffer sbuf)
public java.lang.String toString()
toString
in class AbstractSequence
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |