public class Dimensions extends Object
Modifier and Type | Field and Description |
---|---|
static Dimensions |
ONE |
static Dimensions |
THREE |
static Dimensions |
TWO |
static Dimensions |
UNKNOWN |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Dimensions dims2)
Two dimensions are equal if the element of dims are the same.
|
boolean |
equals(Object arg) |
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
override 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 matrices
|
String |
toString()
A string representation.
|
static Dimensions |
valueOf(Dimensions inDim,
int d)
return a dimension [inDim[0],...,inDim[n],d]
|
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],...,inDim[n]]
|
static Dimensions |
valueOf(int rows,
int cols)
returns dimensions for a matrix.
|
public static final Dimensions UNKNOWN
public static final Dimensions ONE
public static final Dimensions TWO
public static final Dimensions THREE
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 String toString()
public boolean equals(Dimensions dims2)
public int hashcode()
Jas4pp 1.5 © Java Analysis Studio for Particle Physics