|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--lnsc.pmvf.AbstractFunctionalUnit2
Abstract class containing the basic implementation for the
FunctionalUnit2
interface.
In order to implement the FunctionalUnit2
interface,
subclasses need the following 4 things:
m_InputCount
,
m_OutputCount
, m_IsDifferentiable
,
m_IsTwiceDifferentiable
, m_ParametersCount,
m_IsParametersDifferentiable
, and
m_IsParametersTwiceDifferentiable
must be filled
appropriately.
processPattern(double[], boolean, boolean, boolean, boolean)
must be implemented and should prefrerably begin by calling
preProcessPattern(double[], boolean, boolean, boolean, boolean)
.
For non stateless function, reset()
must be added.getParameters()
and setParameters(double[])
must be written accordingly. Note that get and set parameters must
work by copying values, not referencing to whole arrays.FunctionalUnit2
are Serializable
and
Cloneable
, any required extra code to make these
interfaces work properly should be added. It is necessary to at
least set the private static serialVersionUID
variable
appropriately for the Seriablizable
interface. For
complex objects, the Cloneable
interface can rely on
Tools.copyObject(Serializable)
for deep cloning.
Nested Class Summary |
Nested classes inherited from class lnsc.pmvf.FunctionalUnit2 |
FunctionalUnit2.ProcessPatternResult2 |
Nested classes inherited from class lnsc.FunctionalUnit |
FunctionalUnit.ProcessPatternResult |
Field Summary |
Fields inherited from interface lnsc.FunctionalUnit |
EMPTY_PATTERN |
Constructor Summary | |
AbstractFunctionalUnit2()
|
Method Summary | |
java.lang.Object |
clone()
|
int |
getInputCount()
Indicates the number of variables of the function. |
int |
getOutputCount()
Indicates the number of values returned by the function. |
int |
getParameterCount()
Indicates the number of parameters of the function. |
boolean |
isDifferentiable()
Indicates whether or not the function is differentiable. |
boolean |
isParameterDifferentiable()
Indicates whether or not the function is differentiable with respect to its parameters. |
boolean |
isParameterTwiceDifferentiable()
Indicates whether or not the function is twice differentiable with respect to its parameters. |
boolean |
isStateless()
Indicates whether or not the function output depends solely of the current input (and not of the previous pattern it has processed). |
boolean |
isTwiceDifferentiable()
Indicates whether or not the function is twice differentiable. |
DataSet |
processDataSet(DataSet dataSet,
java.lang.String[] recordList)
Processes a set of input patterns and record the requested information. |
FunctionalUnit.ProcessPatternResult |
processPattern(double[] inputPattern,
boolean computeDerivative,
boolean computeSecondDerivative)
Processes an input pattern and returns its output pattern and derivative (if requested). |
FunctionalUnit2.ProcessPatternResult2 |
processPattern(double[] inputPattern,
boolean computeDerivative,
boolean computeSecondDerivative,
boolean computeParameterDerivative,
boolean computeParameterSecondDerivative,
java.lang.String[] recordList)
Processes an input pattern and returns its output pattern and derivatives (if requested). |
void |
reset()
Reset internal transient state for non stateless functions. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface lnsc.pmvf.FunctionalUnit2 |
getParameters, setParameters |
Constructor Detail |
public AbstractFunctionalUnit2()
Method Detail |
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface FunctionalUnit
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public final int getInputCount()
FunctionalUnit
getInputCount
in interface FunctionalUnit
public final int getOutputCount()
FunctionalUnit
getOutputCount
in interface FunctionalUnit
public final int getParameterCount()
FunctionalUnit2
getParameterCount
in interface FunctionalUnit2
public final boolean isDifferentiable()
FunctionalUnit
isDifferentiable
in interface FunctionalUnit
true
if it differentiable, false
otherwise.public final boolean isParameterDifferentiable()
FunctionalUnit2
isParameterDifferentiable
in interface FunctionalUnit2
true
if it differentiable, false
otherwise.public final boolean isParameterTwiceDifferentiable()
FunctionalUnit2
isParameterTwiceDifferentiable
in interface FunctionalUnit2
true
if it twice differentiable,
false
otherwise.public final boolean isStateless()
FunctionalUnit
isStateless
in interface FunctionalUnit
true
if output depends solely on current input
false
otherwise.public final boolean isTwiceDifferentiable()
FunctionalUnit
isTwiceDifferentiable
in interface FunctionalUnit
true
if it twice differentiable,
false
otherwise.public DataSet processDataSet(DataSet dataSet, java.lang.String[] recordList)
FunctionalUnit
DataNames.DERIVATIVES
, for the second derivatives use
DataNames.SECOND_DERIVATIVES
and for the error patterns, use
DataNames.ERROR_PATTERNS
. Derivatives are available only when
the function is differentiable. Error patterns required
DataNames.TARGET_PATTERNS
to be in the provided data set.
processDataSet
in interface FunctionalUnit
DataNames.OUTPUT_PATTERNS
and any other keywords
supported requested. Each FunctionalUnit
may provide extra keywords of its own.DataNames
public FunctionalUnit.ProcessPatternResult processPattern(double[] inputPattern, boolean computeDerivative, boolean computeSecondDerivative)
FunctionalUnit
processPattern
in interface FunctionalUnit
public FunctionalUnit2.ProcessPatternResult2 processPattern(double[] inputPattern, boolean computeDerivative, boolean computeSecondDerivative, boolean computeParameterDerivative, boolean computeParameterSecondDerivative, java.lang.String[] recordList)
FunctionalUnit2
processPattern
in interface FunctionalUnit2
inputPattern
- The input pattern.computeDerivative
- Must be true
if the
derivative should be computed.computeSecondDerivative
- Must be true
if the
second derivative should be computed.computeParameterDerivative
- Must be true
if the
derivative with respect to the
parameters should be computed.computeParameterSecondDerivative
- Must be true
if
be the derivative with
respect to the parameters
should be computed.recordList
- Extra data to be recorded.
public void reset()
FunctionalUnit
reset
in interface FunctionalUnit
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |