vector element indexing is 0-based -- e.g., getEntry(0)
returns the first element of the vector.
The various mapXxx
and mapXxxToSelf
methods operate on vectors element-wise, i.e. they perform the same operation (adding a scalar, applying a function ...) on each element in turn. The mapXxx
versions create a new vector to hold the result and do not change the instance. The mapXxxToSelf
versions use the instance itself to store the results, so the instance is changed by these methods. In both cases, the result vector is returned by the methods, this allows to use the fluent API style, like this:
RealVector result = v.mapAddToSelf(3.0).mapTanToSelf().mapSquareToSelf();
Remark on the deprecated {@code mapXxx} and {@code mapXxxToSelf} methods: InCommons-Math v3.0, the same functionality will be achieved by directly using the {@link #map(UnivariateRealFunction)} and {@link #mapToSelf(UnivariateRealFunction)}together with new function objects (not available in v2.2).
@version $Revision: 1070725 $ $Date: 2011-02-15 02:31:12 +0100 (mar. 15 févr. 2011) $ @since 2.0vector element indexing is 0-based -- e.g., {@code getEntry(0)}returns the first element of the vector.
The {@code code map} and {@code mapToSelf} methods operateon vectors element-wise, i.e. they perform the same operation (adding a scalar, applying a function ...) on each element in turn. The {@code map}versions create a new vector to hold the result and do not change the instance. The {@code mapToSelf} version uses the instance itself to store theresults, so the instance is changed by this method. In all cases, the result vector is returned by the methods, allowing the fluent API style, like this:
RealVector result = v.mapAddToSelf(3.4).mapToSelf(new Tan()).mapToSelf(new Power(2.3));@since 2.1
|
|