# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.function.rn2r1

## Class R1Projection

• All Implemented Interfaces:
Function<Vector,Double>, RealScalarFunction

public class R1Projection
extends AbstractRealScalarFunction
Projection creates a real-valued function 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$$.

• ### Nested classes/interfaces inherited from interface com.numericalmethod.suanshu.analysis.function.Function

Function.EvaluationException
• ### Constructor Summary

Constructors
Constructor and Description
R1Projection(RealVectorFunction f, int dimension)
Construct a $$R^n \rightarrow R$$ projection from a $$R^n \rightarrow R^m$$ function f.
• ### Method Summary

All Methods
Modifier and Type Method and Description
Double evaluate(Vector x)
Evaluate the function f at x, where x is from the domain.
• ### Methods inherited from class com.numericalmethod.suanshu.analysis.function.rn2r1.AbstractRealScalarFunction

dimensionOfDomain, dimensionOfRange
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### R1Projection

public R1Projection(RealVectorFunction f,
int dimension)
Construct a $$R^n \rightarrow R$$ projection from a $$R^n \rightarrow R^m$$ function f.
Parameters:
f - a vector-valued function
dimension - the dimension/coordinate of the f value to output
• ### Method Detail

• #### evaluate

public Double evaluate(Vector x)
Description copied from interface: Function
Evaluate the function f at x, where x is from the domain.
Parameters:
x - x
Returns:
f(x)