|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgnu.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 Arrayrank in class AbstractSequencepublic int getEffectiveIndex(int[] indexes)
getEffectiveIndex in interface ArraygetEffectiveIndex in class AbstractSequencepublic java.lang.Object get(int index)
AbstractSequence
get in class AbstractSequence
public int createPos(int index,
boolean isAfter)
AbstractSequence
createPos in class AbstractSequenceindex - offset from beginning of desired positionisAfter - should the position have the isAfter propertypublic java.lang.Object getRowMajor(int index)
getRowMajor in interface Arraypublic java.lang.Object get(int[] indexes)
get in interface Arrayget in class AbstractSequence
public java.lang.Object set(int[] indexes,
java.lang.Object value)
set in interface Arrayset in class AbstractSequencepublic int size()
size in class AbstractSequencepublic int getLowBound(int dim)
Array
getLowBound in interface ArraygetLowBound in class AbstractSequencepublic int getSize(int dim)
Array
getSize in interface ArraygetSize 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 | ||||||||