public class IntegerFunctionOnIndexCrossIndexCrossIndex extends Object implements IntegerFunction.OnIndexCrossIndexCrossIndex
IntegerFunction.OnIndexCrossIndexCrossIndex
. Function values are stored
internally, so using this class to make a copy of a
IntegerFunction.OnIndexCrossIndexCrossIndex c
(by the corresponding
constructor or the assign method) will make a snapshot of the current state
of c
. No reference to c
itself is retained.Constructor and Description |
---|
IntegerFunctionOnIndexCrossIndexCrossIndex()
Creates a matrix with 1 layer, 1 row and 1 column.
|
IntegerFunctionOnIndexCrossIndexCrossIndex(int[][][] c)
Interprets the array
c as a matrix of integers
and creates a copy of it. |
IntegerFunctionOnIndexCrossIndexCrossIndex(IntegerFunction.OnIndexCrossIndexCrossIndex c)
Creates a copy of the matrix
c |
IntegerFunctionOnIndexCrossIndexCrossIndex(int k,
int m,
int n)
Creates a matrix with
k layers, m rows,
n columns and all values zero. |
Modifier and Type | Method and Description |
---|---|
void |
assign(int[][][] c)
Interpret the array
c as a matrix and become a copy of it. |
void |
assign(IntegerFunction.OnIndexCrossIndexCrossIndex c)
Become a copy of the function
c |
void |
assignZero()
Keep the number of rows and columns but set all values to zero.
|
void |
assignZero(int k,
int m,
int n)
Become a matrix with
m rows and n columns
and all values zero. |
int |
getNumColumns()
Returns the number of columns (the range of the second variable of
this function).
|
int |
getNumLayers()
Returns the number of layers (the range of the third variable of
this function).
|
int |
getNumRows()
Returns the number of rows (the range of the first variable of
this function).
|
protected void |
setSize(int k,
int m,
int n)
Do nothing if
m and n are equal to the
current numbers of rows and columns, otherwise become a matrix with
m rows and n columns and all values zero. |
void |
setValueAt(int h,
int i,
int j,
int z)
Sets the value at index
h,i,j to z . |
int |
valueAt(int h,
int i,
int j)
returns the value of this function at
i,j,k . |
public IntegerFunctionOnIndexCrossIndexCrossIndex()
public IntegerFunctionOnIndexCrossIndexCrossIndex(int[][][] c)
c
as a matrix of integers
and creates a copy of it.c
- must be a rectangular array and c[0][0][0] must be a non-nullpublic IntegerFunctionOnIndexCrossIndexCrossIndex(IntegerFunction.OnIndexCrossIndexCrossIndex c)
c
public IntegerFunctionOnIndexCrossIndexCrossIndex(int k, int m, int n)
k
layers, m
rows,
n
columns and all values zero.k
- must be at least one.m
- must be at least one.n
- must be at least one.public void assign(int[][][] c)
c
as a matrix and become a copy of it.c
- must be a rectangular array.public void assign(IntegerFunction.OnIndexCrossIndexCrossIndex c)
c
public void assignZero()
public void assignZero(int k, int m, int n)
m
rows and n
columns
and all values zero.k
- must be at least one.m
- must be at least one.n
- must be at least one.public int getNumColumns()
public int getNumLayers()
public int getNumRows()
protected void setSize(int k, int m, int n)
m
and n
are equal to the
current numbers of rows and columns, otherwise become a matrix with
m
rows and n
columns and all values zero.k
- must be at least one.m
- must be at least one.n
- must be at least one.public void setValueAt(int h, int i, int j, int z)
h,i,j
to z
.h
- must be non-negative and less than the number of layers.i
- must be non-negative and less than the number of rows.j
- must be non-negative and less than the number of columns.public int valueAt(int h, int i, int j)
i,j,k
.