public class ScaledDiff1FunctionNx1 extends Diff1FunctionNx1Base
Constructor and Description |
---|
ScaledDiff1FunctionNx1() |
ScaledDiff1FunctionNx1(double s,
Diff1FunctionNx1 fxn) |
Modifier and Type | Method and Description |
---|---|
ScaledDiff1FunctionNx1 |
clone() |
double |
eval(VectorNd in)
Evaluates this function for the specified inputs.
|
double |
eval(VectorNd deriv,
VectorNd in)
Evaluates this function for the specified inputs.
|
Diff1FunctionNx1 |
getFunction() |
double |
getScale() |
int |
inputSize()
Queries the number of inputs expected by this function.
|
boolean |
isWritable()
Returns
true if this component should in fact be written to
secondary storage. |
void |
scan(ReaderTokenizer rtok,
java.lang.Object ref)
Scans this element from a ReaderTokenizer.
|
void |
setFunction(Diff1FunctionNx1 fxn) |
void |
setScale(double s) |
void |
write(java.io.PrintWriter pw,
NumberFormat fmt,
java.lang.Object ref)
Writes a text description of this element to a PrintWriter.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
evalDeriv
public ScaledDiff1FunctionNx1()
public ScaledDiff1FunctionNx1(double s, Diff1FunctionNx1 fxn)
public double getScale()
public void setScale(double s)
public Diff1FunctionNx1 getFunction()
public void setFunction(Diff1FunctionNx1 fxn)
public int inputSize()
FunctionNx1
public double eval(VectorNd in)
Diff1FunctionNx1Base
FunctionNx1.inputSize()
.eval
in interface FunctionNx1
eval
in class Diff1FunctionNx1Base
public double eval(VectorNd deriv, VectorNd in)
deriv
is not
null
, the derivative is also computed and returned in this
argument. The input vector size should equal the value returned by FunctionNx1.inputSize()
. If present, deriv
will be resized, if necessary, to
FunctionNx1.inputSize()
.eval
in interface Diff1FunctionNx1
eval
in class Diff1FunctionNx1Base
deriv
- if not null
, returns the derivative valuesin
- function input valuespublic boolean isWritable()
Scannable
true
if this component should in fact be written to
secondary storage. This gives subclasses control over whether or
not they are actually written out.isWritable
in interface Scannable
isWritable
in class Diff1FunctionNx1Base
true
if this component should be written to
secondary storage.public void scan(ReaderTokenizer rtok, java.lang.Object ref) throws java.io.IOException
Scannable
write
.scan
in interface Scannable
scan
in class Diff1FunctionNx1Base
rtok
- Tokenizer from which to scan the elementref
- optional reference object which can be used for resolving references to
other objectsjava.io.IOException
- if an I/O or formatting error occuredpublic void write(java.io.PrintWriter pw, NumberFormat fmt, java.lang.Object ref) throws java.io.IOException
Scannable
scan
and complete
enough to allow full reconstruction of the element.write
in interface Scannable
write
in class Diff1FunctionNx1Base
pw
- stream for writing the elementfmt
- numeric formating informationref
- optional reference object which can be used for producing references to
other objectsjava.io.IOException
- if an I/O error occuredpublic ScaledDiff1FunctionNx1 clone()
clone
in interface Clonable
clone
in class Diff1FunctionNx1Base