public class Dimensions
extends java.lang.Object
implements java.io.Serializable
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(java.lang.Object arg) |
boolean |
equalsDim(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
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 |
order()
Order of dimensions 0 for numbers, 1 for vectors, 2 for matrices
|
java.lang.String |
toString()
A string representation.
|
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.
|
static Dimensions |
valueOf(MatrixI mat) |
static Dimensions |
valueOf(VectorI vec) |
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 static Dimensions valueOf(VectorI vec)
public static Dimensions valueOf(MatrixI mat)
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 order()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equalsDim(Dimensions dims2)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object arg)
equals
in class java.lang.Object
Copyright © 2018 Singular Systems http://www.singularsys.com/jep