public class RealFunctionOnIndex extends Object implements RealFunction.OnIndex
RealFunction.OnIndex
. Function values are stored
internally, so using this class to make a copy of a
RealFunction.OnIndex 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 |
---|
RealFunctionOnIndex() |
RealFunctionOnIndex(double[] c)
Interpret the array
c as an n-tupel of
and create a copy of it. |
RealFunctionOnIndex(int n)
Creates a tupel of
n zeroes. |
RealFunctionOnIndex(RealFunction.OnIndex c)
Creates a copy of the tupel
c |
Modifier and Type | Method and Description |
---|---|
void |
assign(double[] c)
Interpret the array
c as an n-tupel
and become a copy of it. |
void |
assign(RealFunction.OnIndex c)
Become a copy of the tupel
c |
void |
assignZero()
Keep the number of indices but set all values to zero.
|
void |
assignZero(int n)
Become a tupel of
n zeroes. |
int |
getNumIndices()
Returns the number of indices (a non-negative integer).
|
protected void |
setNumIndices(int n)
Do nothing if
n is equal to the current number of
indices, become a tupel of n zeroes otherwise. |
void |
setValueAt(int j,
double x)
Set the value at index j to x.
|
double |
valueAt(int j)
returns the value of this function at
j . |
public RealFunctionOnIndex()
public RealFunctionOnIndex(double[] c)
c
as an n-tupel of
and create a copy of it.public RealFunctionOnIndex(int n)
n
zeroes.public RealFunctionOnIndex(RealFunction.OnIndex c)
c
public void assign(double[] c)
c
as an n-tupel
and become a copy of it.public void assign(RealFunction.OnIndex c)
c
public void assignZero()
public void assignZero(int n)
n
zeroes.public int getNumIndices()
Domain.OnIndex
getNumIndices
in interface Domain.OnIndex
protected void setNumIndices(int n)
n
is equal to the current number of
indices, become a tupel of n
zeroes otherwise.public void setValueAt(int j, double x)
public double valueAt(int j)
j
.