|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.lsmp.djep.vectorJep.Dimensions
A class to represent a set of dimensions. Might be 1 for 0-dimensional numbers. [3] for a 3D vector [3,3] for a matrix
Field Summary | |
static Dimensions |
ONE
|
static Dimensions |
THREE
|
static Dimensions |
TWO
|
Method Summary | |
boolean |
equals(Dimensions dims2)
Two dimensions are equal if the element of dims are the same. |
int |
getFirstDim()
get the first dimension, 1 for numbers, or the length of a vector. |
int |
getIthDim(int i)
|
int |
getLastDim()
get the last dimension, 1 for numbers, or the length of a vector. |
int |
hashcode()
apparently your should always override hashcode when you operride equals (Effective Java, Bloch). |
boolean |
is0D()
Is it 0D, ie a simple number. |
boolean |
is1D()
Is it 1D, ie a vector [1,2,3]. |
boolean |
is2D()
Is it 2D, ie a matrix [[1,2,3],[4,5,6]]. |
int |
numEles()
The total number of elements. |
int |
rank()
rank of dimensions 0 for numbers, 1 for vectors, 2 for matricies |
java.lang.String |
toString()
A string repsesentation. |
static Dimensions |
valueOf(Dimensions inDim,
int d)
return a dimension [inDim[0],... |
static Dimensions |
valueOf(int d)
Factory method returns a Dimension for vector of given length. |
static Dimensions |
valueOf(int[] dims)
returns a dimensions with given dimensions. |
static Dimensions |
valueOf(int d,
Dimensions inDim)
return a dimension [d,inDim[0],... |
static Dimensions |
valueOf(int rows,
int cols)
returns dimensions for a matrix. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Dimensions ONE
public static final Dimensions TWO
public static final Dimensions THREE
Method Detail |
public static Dimensions valueOf(int d)
public static Dimensions valueOf(int rows, int cols)
public static Dimensions valueOf(int d, Dimensions inDim)
public static Dimensions valueOf(Dimensions inDim, int d)
public static Dimensions valueOf(int[] dims)
public int getFirstDim()
public int getLastDim()
public int getIthDim(int i)
public boolean is0D()
public boolean is1D()
public boolean is2D()
public int numEles()
public int rank()
public java.lang.String toString()
public boolean equals(Dimensions dims2)
public int hashcode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |