public class Projection extends java.lang.Object implements RealScalarFunction
RealScalarFunction from a vector-valued function RealVectorFunction by
taking only one of its coordinate components in the vector output.
For example, suppose we have a \(R^n \rightarrow R^m\) function, \(f_1 = [y_1, y_2, y_3]'\).
We construct a \(R^n \rightarrow R\) function by taking its second coordinate.
That is, \(f_2 = y_2\).Function.EvaluationException| Constructor and Description |
|---|
Projection(RealVectorFunction f,
int dimension)
Construct a \(R^n \rightarrow R\) projection from a \(R^n \rightarrow R^m\) function f.
|
| Modifier and Type | Method and Description |
|---|---|
int |
dimensionOfDomain()
Get the number of variables the function has.
|
int |
dimensionOfRange()
Get the dimension of the range space of the function.
|
java.lang.Double |
evaluate(Vector x)
Evaluate the function f at x, where x is from the domain.
|
public Projection(RealVectorFunction f, int dimension)
f - a vector-valued functiondimension - the dimension/coordinate of the f value to outputpublic java.lang.Double evaluate(Vector x)
Functionpublic int dimensionOfDomain()
FunctiondimensionOfDomain in interface Function<Vector,java.lang.Double>public int dimensionOfRange()
FunctiondimensionOfRange in interface Function<Vector,java.lang.Double>