public class RealFunctionOnIndexCrossIndex extends Object implements RealFunction.OnIndexCrossIndex
RealFunction.OnIndexCrossIndex
. Function values are stored
internally, so using this class to make a copy of a
RealFunction.OnIndexCrossIndex 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 |
---|
RealFunctionOnIndexCrossIndex()
Creates a matrix with 1 row and 1 column.
|
RealFunctionOnIndexCrossIndex(double[][] c)
Interprets the array
c as a function of two indices
and creates a copy of it. |
RealFunctionOnIndexCrossIndex(int m,
int n)
Creates a matrix with
m rows and n columns
and all values zero. |
RealFunctionOnIndexCrossIndex(RealFunction.OnIndexCrossIndex c)
Creates a copy of the function
c |
Modifier and Type | Method and Description |
---|---|
void |
assign(double[][] c)
Interpret the array
c as a function of two indices
and become a copy of it. |
void |
assign(RealFunction.OnIndexCrossIndex 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 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 |
getNumRows()
Returns the number of rows (the range of the first variable of
this function).
|
void |
setSize(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 i,
int j,
double z)
Sets the value at index
i,j to z . |
double |
valueAt(int i,
int j)
returns the value of this function at
i,j . |
public RealFunctionOnIndexCrossIndex()
public RealFunctionOnIndexCrossIndex(double[][] c)
c
as a function of two indices
and creates a copy of it.c
- must be a rectangular array and c[0][0] must be a non-nullpublic RealFunctionOnIndexCrossIndex(int m, int n)
m
rows and n
columns
and all values zero.m
- must be at least one.n
- must be at least one.public RealFunctionOnIndexCrossIndex(RealFunction.OnIndexCrossIndex c)
c
public void assign(double[][] c)
c
as a function of two indices
and become a copy of it.public void assign(RealFunction.OnIndexCrossIndex c)
c
public void assignZero()
public void assignZero(int m, int n)
m
rows and n
columns
and all values zero.m
- must be at least one.n
- must be at least one.public int getNumColumns()
public int getNumRows()
public void setSize(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.m
- must be at least one.n
- must be at least one.public void setValueAt(int i, int j, double z)
i,j
to z
.public double valueAt(int i, int j)
i,j
.