commons-math3-3.6.1-org.apache.commons.math3.analysis包-中英对照文档及源码赏析
摘要:中英对照文档、源码赏析、org.apache.commons.math3.analysis、BivariateFunction、DifferentiableMultivariateFunction、DifferentiableMultivariateVectorFunction、DifferentiableUnivariateFunction、DifferentiableUnivariateMatrixFunction、DifferentiableUnivariateVectorFunction、FunctionUtils、MultivariateFunction、MultivariateMatrixFunction、MultivariateVectorFunction、package-info、ParametricUnivariateFunction、RealFieldUnivariateFunction、TrivariateFunction、UnivariateFunction、UnivariateMatrixFunction、UnivariateVectorFunction
完整中文文档、中英对照文档下载请移步:
commons-math3-中文文档、中英对照文档-CSDN下载
1. 开源组件说明
jar包名称:
commons-math3-3.6.1.jar
Maven 依赖:
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.6.1</version>
</dependency>
完整中文文档、中英对照文档下载请移步:
commons-math3-中文文档、中英对照文档-CSDN下载
本文介绍的接口和类:
org.apache.commons.math3.analysis.BivariateFunction
org.apache.commons.math3.analysis.DifferentiableMultivariateFunction
org.apache.commons.math3.analysis.DifferentiableMultivariateVectorFunction
org.apache.commons.math3.analysis.DifferentiableUnivariateFunction
org.apache.commons.math3.analysis.DifferentiableUnivariateMatrixFunction
org.apache.commons.math3.analysis.DifferentiableUnivariateVectorFunction
org.apache.commons.math3.analysis.MultivariateFunction
org.apache.commons.math3.analysis.MultivariateMatrixFunction
org.apache.commons.math3.analysis.MultivariateVectorFunction
org.apache.commons.math3.analysis.ParametricUnivariateFunction
org.apache.commons.math3.analysis.RealFieldUnivariateFunction
org.apache.commons.math3.analysis.TrivariateFunction
org.apache.commons.math3.analysis.UnivariateFunction
org.apache.commons.math3.analysis.UnivariateMatrixFunction
org.apache.commons.math3.analysis.UnivariateVectorFunction
org.apache.commons.math3.analysis.FunctionUtils
程序包 org.apache.commons.math3.analysis
父包用于常见的数值分析过程,包括根查找,功能插补和集成。
See:
说明
-
接口概要
接口 说明
BivariateFunction
An interface representing a bivariate real function.
代表双相对于实际功能的界面。
DifferentiableMultivariateFunction
Deprecated
DifferentiableMultivariateVectorFunction
Deprecated
DifferentiableUnivariateFunction
Deprecated
DifferentiableUnivariateMatrixFunction
Deprecated
DifferentiableUnivariateVectorFunction
Deprecated
MultivariateFunction
An interface representing a multivariate real function.
表示多变量实际功能的接口。
MultivariateMatrixFunction
An interface representing a multivariate matrix function.
表示多变量矩阵函数的接口。
MultivariateVectorFunction
An interface representing a multivariate vectorial function.
表示多变量矢量函数的界面。
ParametricUnivariateFunction
An interface representing a real function that depends on one independent variable plus some extra parameters.
表示真正函数的接口,取决于一个独立变量加上一些额外的参数。
RealFieldUnivariateFunction
<T extends
RealFieldElement
<T>>An interface representing a univariate real function.
表示单变量真实功能的接口。
TrivariateFunction
An interface representing a trivariate real function.
表示琐碎的实际功能的接口。
UnivariateFunction
An interface representing a univariate real function.
表示单变量真实功能的接口。
UnivariateMatrixFunction
An interface representing a univariate matrix function.
表示单变量矩阵函数的接口。
UnivariateVectorFunction
An interface representing a univariate vectorial function.
表示单变量矢量函数的接口。
-
类 Summary
类 说明
FunctionUtils
Utilities for manipulating function objects.
用于操纵函数对象的实用程序。
程序包 org.apache.commons.math3.analysis 的说明
Parent package for common numerical analysis procedures, including root finding, function interpolation and integration. Note that optimization (i.e. minimization and maximization) is a separate top-level package.
Function interfaces are intended to be implemented by user code to represent domain problems. The algorithms provided by the library operate on these functions to find their roots, or integrate them, or … Functions can be multivariate or univariate, real vectorial or matrix-valued, and they can be differentiable or not.
父包用于常见的数值分析过程,包括根查找,功能插补和集成。请注意,优化(即最小化和最大化)是单独的顶级包。功能接口旨在通过用户代码来实现以表示域问题。由图书馆提供的算法在这些功能上操作以查找它们的根,或者集成它们,或……功能可以是多变量或单变量,真正的矢量或矩阵值,它们可以是可差的。
2.
org.apache.commons.math3.analysis.BivariateFunction
org.apache.commons.math3.analysis.BivariateFunction
2.1.
BivariateFunction
中文-英语对照文档
BivariateFunction
接口 BivariateFunction
-
-
All Known Implementing Classes:
-
Add
,
Atan2
,
BicubicInterpolatingFunction
,
BicubicSplineInterpolatingFunction
,
Divide
,
Max
,
Min
,
Multiply
,
PiecewiseBicubicSplineInterpolatingFunction
,
Pow
,
Subtract
添加,atan2,bicubicintpolatingfunction,双臂夹住函数功能,划分,max,min,繁殖,分段issbicuspline interpolationfunction,pow,减去
public interface BivariateFunction
An interface representing a bivariate real function.
代表双相对于实际功能的界面。
-
2.1
2.1
从以下版本开始:
-
-
-
方法概要
Methods
限定符和类型 方法和说明
double
value
(double x, double y)
Compute the value for the function.
计算函数的值。
-
-
-
方法详细说明
-
value
double value(double x, double y)
Compute the value for the function.
计算函数的值。
-
x
– Abscissa for which the function value should be computed.
应计算函数值的X – 横坐标。
-
y
– Ordinate for which the function value should be computed.
Y型纵坐标应计算函数值。
-
the value.
价值。
参数:
返回:
-
-
-
2.2.
BivariateFunction
源码赏析
BivariateFunction
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis;
/**
* An interface representing a bivariate real function.
*
* @since 2.1
*/
public interface BivariateFunction {
/**
* Compute the value for the function.
*
* @param x Abscissa for which the function value should be computed.
* @param y Ordinate for which the function value should be computed.
* @return the value.
*/
double value(double x, double y);
}
3.
org.apache.commons.math3.analysis.DifferentiableMultivariateFunction
org.apache.commons.math3.analysis.DifferentiableMultivariateFunction
3.1.
DifferentiableMultivariateFunction
中文-英语对照文档
DifferentiableMultivariateFunction
接口 DifferentiableMultivariateFunction
-
-
All Superinterfaces:
-
MultivariateFunction
多变量功能
Deprecated.
弃用。截至3.1由多变量引前功能替换
@Deprecated public interface DifferentiableMultivariateFunction extends MultivariateFunction
Extension of
MultivariateFunction
representing a differentiable multivariate real function.
代表不同多变量实际功能的多种式功能的扩展。
-
2.0
2.0
从以下版本开始:
-
-
-
方法概要
Methods
限定符和类型 方法和说明
MultivariateVectorFunction
gradient
()
Deprecated.
弃用。
Returns the gradient function.
返回渐变函数。
MultivariateFunction
partialDerivative
(int k)
Deprecated.
弃用。
Returns the partial derivative of the function with respect to a point coordinate.
返回相对于点坐标的函数的部分导数。
-
Methods inherited from interface org.apache.commons.math3.analysis.
MultivariateFunction
value
-
-
-
-
方法详细说明
-
partialDerivative
MultivariateFunction partialDerivative(int k)
Deprecated.
弃用。
Returns the partial derivative of the function with respect to a point coordinate.The partial derivative is defined with respect to point coordinate x
k
. If the partial derivatives with respect to all coordinates are needed, it may be more efficient to use the
gradient()
method which will compute them all at once.返回相对于点坐标的函数的部分导数。局部导数是关于点坐标XK限定的。如果需要相对于所有坐标的部分导数,则使用将一体地计算它们的渐变()方法可能更有效。
-
k
– index of the coordinate with respect to which the partial derivative is computed
K – 计算部分导数的坐标索引
-
the partial derivative function with respect to k
th
point coordinate
关于kth点坐标的部分导数函数
参数:
返回:
-
-
gradient
MultivariateVectorFunction gradient()
Deprecated.
弃用。
Returns the gradient function.If only one partial derivative with respect to a specific coordinate is needed, it may be more efficient to use the
partialDerivative(int)
method which will compute only the specified component.返回渐变函数。如果仅需要一个关于特定坐标的一个部分导数,则使用将仅计算指定组件的PartialDerivative(int)方法可以更有效。
-
the gradient function
梯度函数
返回:
-
the gradient function
-
-
3.2.
DifferentiableMultivariateFunction
源码赏析
DifferentiableMultivariateFunction
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis;
/**
* Extension of {@link MultivariateFunction} representing a differentiable
* multivariate real function.
* @since 2.0
* @deprecated as of 3.1 replaced by {@link org.apache.commons.math3.analysis.differentiation.MultivariateDifferentiableFunction}
*/
@Deprecated
public interface DifferentiableMultivariateFunction extends MultivariateFunction {
/**
* Returns the partial derivative of the function with respect to a point coordinate.
* <p>
* The partial derivative is defined with respect to point coordinate
* x<sub>k</sub>. If the partial derivatives with respect to all coordinates are
* needed, it may be more efficient to use the {@link #gradient()} method which will
* compute them all at once.
* </p>
* @param k index of the coordinate with respect to which the partial
* derivative is computed
* @return the partial derivative function with respect to k<sup>th</sup> point coordinate
*/
MultivariateFunction partialDerivative(int k);
/**
* Returns the gradient function.
* <p>If only one partial derivative with respect to a specific coordinate is
* needed, it may be more efficient to use the {@link #partialDerivative(int)} method
* which will compute only the specified component.</p>
* @return the gradient function
*/
MultivariateVectorFunction gradient();
}
4.
org.apache.commons.math3.analysis.DifferentiableMultivariateVectorFunction
org.apache.commons.math3.analysis.DifferentiableMultivariateVectorFunction
4.1.
DifferentiableMultivariateVectorFunction
中文-英语对照文档
DifferentiableMultivariateVectorFunction
接口 DifferentiableMultivariateVectorFunction
-
-
All Superinterfaces:
-
MultivariateVectorFunction
MultivariatevectorFunction.
Deprecated.
弃用。从3.1替换为多变量等求验障碍功能
@Deprecated public interface DifferentiableMultivariateVectorFunction extends MultivariateVectorFunction
Extension of
MultivariateVectorFunction
representing a differentiable multivariate vectorial function.
多元射灯的扩展代表可分辨率的多变量矢量函数。
-
2.0
2.0
从以下版本开始:
-
-
-
方法概要
Methods
限定符和类型 方法和说明
MultivariateMatrixFunction
jacobian
()
Deprecated.
弃用。
Returns the jacobian function.
返回Jacobian函数。
-
Methods inherited from interface org.apache.commons.math3.analysis.
MultivariateVectorFunction
value
-
-
-
-
方法详细说明
-
jacobian
MultivariateMatrixFunction jacobian()
Deprecated.
弃用。
Returns the jacobian function.
返回Jacobian函数。
-
the jacobian function
雅各碧眼的功能
返回:
-
the jacobian function
-
-
4.2.
DifferentiableMultivariateVectorFunction
源码赏析
DifferentiableMultivariateVectorFunction
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis;
/**
* Extension of {@link MultivariateVectorFunction} representing a differentiable
* multivariate vectorial function.
* @since 2.0
* @deprecated as of 3.1 replaced by {@link org.apache.commons.math3.analysis.differentiation.MultivariateDifferentiableVectorFunction}
*/
@Deprecated
public interface DifferentiableMultivariateVectorFunction
extends MultivariateVectorFunction {
/**
* Returns the jacobian function.
* @return the jacobian function
*/
MultivariateMatrixFunction jacobian();
}
5.
org.apache.commons.math3.analysis.DifferentiableUnivariateFunction
org.apache.commons.math3.analysis.DifferentiableUnivariateFunction
5.1.
DifferentiableUnivariateFunction
中文-英语对照文档
DifferentiableUnivariateFunction
接口 DifferentiableUnivariateFunction
-
-
All Superinterfaces:
-
UnivariateFunction
非凡透明
-
All Known Implementing Classes:
-
Acos
,
Acosh
,
Asin
,
Asinh
,
Atan
,
Atanh
,
Cbrt
,
Constant
,
Cos
,
Cosh
,
Exp
,
Expm1
,
Gaussian
,
HarmonicOscillator
,
Identity
,
Inverse
,
Log
,
Log10
,
Log1p
,
Logistic
,
Logit
,
Minus
,
PolynomialFunction
,
PolynomialSplineFunction
,
Power
,
Sigmoid
,
Sin
,
Sinc
,
Sinh
,
Sqrt
,
Tan
,
Tanh
ACOS,Acosh,Asin,Asinh,atan,atanh,cbrt,常数,cos,cosh,exp,expm1,高斯,Hysoniccillator,身份,逆,日志,log10,log1p,Logistic,Logit,minus,Polynomialfunction,PolynomialsplineFunction,Power,Power,Sigmoid,Sin,Sinc,Sinh,Sqrt,Tan,Tanh
Deprecated.
弃用。截至3.1替换为单偏见的异常功能
@Deprecated public interface DifferentiableUnivariateFunction extends UnivariateFunction
Extension of
UnivariateFunction
representing a differentiable univariate real function.
延伸非凡因子功能,代表可分辨率的单变量实际功能。
-
-
-
方法概要
Methods
限定符和类型 方法和说明
UnivariateFunction
derivative
()
Deprecated.
弃用。
Returns the derivative of the function
返回函数的衍生物
-
Methods inherited from interface org.apache.commons.math3.analysis.
UnivariateFunction
value
-
-
-
-
方法详细说明
-
derivative
UnivariateFunction derivative()
Deprecated.
弃用。
Returns the derivative of the function
返回函数的衍生物
-
the derivative function
衍生功能
返回:
-
the derivative function
-
-
5.2.
DifferentiableUnivariateFunction
源码赏析
DifferentiableUnivariateFunction
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis;
/**
* Extension of {@link UnivariateFunction} representing a differentiable univariate real function.
*
* @deprecated as of 3.1 replaced by {@link org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction}
*/
@Deprecated
public interface DifferentiableUnivariateFunction
extends UnivariateFunction {
/**
* Returns the derivative of the function
*
* @return the derivative function
*/
UnivariateFunction derivative();
}
6.
org.apache.commons.math3.analysis.DifferentiableUnivariateMatrixFunction
org.apache.commons.math3.analysis.DifferentiableUnivariateMatrixFunction
6.1.
DifferentiableUnivariateMatrixFunction
中文-英语对照文档
DifferentiableUnivariateMatrixFunction
接口 DifferentiableUnivariateMatrixFunction
-
-
All Superinterfaces:
-
UnivariateMatrixFunction
UnivariateMatrixFunction.
Deprecated.
弃用。截至3.1替换为UnivariedifferentiaBlexFunctix
@Deprecated public interface DifferentiableUnivariateMatrixFunction extends UnivariateMatrixFunction
Extension of
UnivariateMatrixFunction
representing a differentiable univariate matrix function.
扩展UnivariateMatrixFunction代表可分辨率的单变量矩阵函数。
-
2.0
2.0
从以下版本开始:
-
-
-
方法概要
Methods
限定符和类型 方法和说明
UnivariateMatrixFunction
derivative
()
Deprecated.
弃用。
Returns the derivative of the function
返回函数的衍生物
-
Methods inherited from interface org.apache.commons.math3.analysis.
UnivariateMatrixFunction
value
-
-
-
-
方法详细说明
-
derivative
UnivariateMatrixFunction derivative()
Deprecated.
弃用。
Returns the derivative of the function
返回函数的衍生物
-
the derivative function
衍生功能
返回:
-
the derivative function
-
-
6.2.
DifferentiableUnivariateMatrixFunction
源码赏析
DifferentiableUnivariateMatrixFunction
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis;
/**
* Extension of {@link UnivariateMatrixFunction} representing a differentiable univariate matrix function.
*
* @since 2.0
* @deprecated as of 3.1 replaced by {@link org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableMatrixFunction}
*/
@Deprecated
public interface DifferentiableUnivariateMatrixFunction
extends UnivariateMatrixFunction {
/**
* Returns the derivative of the function
*
* @return the derivative function
*/
UnivariateMatrixFunction derivative();
}
7.
org.apache.commons.math3.analysis.DifferentiableUnivariateVectorFunction
org.apache.commons.math3.analysis.DifferentiableUnivariateVectorFunction
7.1.
DifferentiableUnivariateVectorFunction
中文-英语对照文档
DifferentiableUnivariateVectorFunction
接口 DifferentiableUnivariateVectorFunction
-
-
All Superinterfaces:
-
UnivariateVectorFunction
UnivariatevectorFunction.
Deprecated.
弃用。截至3.1替换为单偏见异常的障碍功能
@Deprecated public interface DifferentiableUnivariateVectorFunction extends UnivariateVectorFunction
Extension of
UnivariateVectorFunction
representing a differentiable univariate vectorial function.
延伸非凡维亚特函数,代表可分辨率的单变量矢量函数。
-
2.0
2.0
从以下版本开始:
-
-
-
方法概要
Methods
限定符和类型 方法和说明
UnivariateVectorFunction
derivative
()
Deprecated.
弃用。
Returns the derivative of the function
返回函数的衍生物
-
Methods inherited from interface org.apache.commons.math3.analysis.
UnivariateVectorFunction
value
-
-
-
-
方法详细说明
-
derivative
UnivariateVectorFunction derivative()
Deprecated.
弃用。
Returns the derivative of the function
返回函数的衍生物
-
the derivative function
衍生功能
返回:
-
the derivative function
-
-
7.2.
DifferentiableUnivariateVectorFunction
源码赏析
DifferentiableUnivariateVectorFunction
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis;
/**
* Extension of {@link UnivariateVectorFunction} representing a differentiable univariate vectorial function.
*
* @since 2.0
* @deprecated as of 3.1 replaced by {@link org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableVectorFunction}
*/
@Deprecated
public interface DifferentiableUnivariateVectorFunction
extends UnivariateVectorFunction {
/**
* Returns the derivative of the function
*
* @return the derivative function
*/
UnivariateVectorFunction derivative();
}
8.
org.apache.commons.math3.analysis.MultivariateFunction
org.apache.commons.math3.analysis.MultivariateFunction
8.1.
MultivariateFunction
中文-英语对照文档
MultivariateFunction
接口 MultivariateFunction
-
-
All Known Subinterfaces:
-
DifferentiableMultivariateFunction
,
MultivariateDifferentiableFunction
oversiaBlueGRIVARIATEFUNction,多变量等功能
-
All Known Implementing Classes:
-
LeastSquaresConverter
,
LeastSquaresConverter
,
LinearObjectiveFunction
,
MicrosphereInterpolatingFunction
,
MultivariateFunctionMappingAdapter
,
MultivariateFunctionMappingAdapter
,
MultivariateFunctionPenaltyAdapter
,
MultivariateFunctionPenaltyAdapter
最不可思议的QuareSconverter,最不可思议的调度变频器,LineArebjectiveFunction,MicroviateFyenctionMappingAdapter,Multivariate FunctionMappingAdapter,Multivariate FunctionPenaltyAdapter,MultivariateFunctionPenaltyAdapter
public interface MultivariateFunction
An interface representing a multivariate real function.
表示多变量实际功能的接口。
-
2.0
2.0
从以下版本开始:
-
-
-
方法概要
Methods
限定符和类型 方法和说明
double
value
(double[] point)
Compute the value for the function at the given point.
计算给定点的函数的值。
-
-
-
方法详细说明
-
value
double value(double[] point)
Compute the value for the function at the given point.
计算给定点的函数的值。
-
point
– Point at which the function must be evaluated.
点 – 必须评估功能的点。
-
the function value for the given point.
给定点的函数值。
-
DimensionMismatchException
– if the parameter’s dimension is wrong for the function being evaluated.
DimensionMismatchException – 如果参数的尺寸是错误的正在评估的功能。
-
MathIllegalArgumentException
– when the activated method itself can ascertain that preconditions, specified in the API expressed at the level of the activated method, have been violated. In the vast majority of cases where Commons Math throws this exception, it is the result of argument checking of actual parameters immediately passed to a method.
MathilleGalargumentException – 当激活的方法本身可以确定在激活方法级别的API中指定的前提条件时,已经违反了。在广泛的大部分情况下,Commons Math抛出这个例外,它是立即传递给方法的实际参数的参数检查结果。
参数:
返回:
抛出:
-
-
-
8.2.
MultivariateFunction
源码赏析
MultivariateFunction
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis;
/**
* An interface representing a multivariate real function.
*
* @since 2.0
*/
public interface MultivariateFunction {
/**
* Compute the value for the function at the given point.
*
* @param point Point at which the function must be evaluated.
* @return the function value for the given point.
* @throws org.apache.commons.math3.exception.DimensionMismatchException
* if the parameter's dimension is wrong for the function being evaluated.
* @throws org.apache.commons.math3.exception.MathIllegalArgumentException
* when the activated method itself can ascertain that preconditions,
* specified in the API expressed at the level of the activated method,
* have been violated. In the vast majority of cases where Commons Math
* throws this exception, it is the result of argument checking of actual
* parameters immediately passed to a method.
*/
double value(double[] point);
}
9.
org.apache.commons.math3.analysis.MultivariateMatrixFunction
org.apache.commons.math3.analysis.MultivariateMatrixFunction
9.1.
MultivariateMatrixFunction
中文-英语对照文档
MultivariateMatrixFunction
接口 MultivariateMatrixFunction
-
-
All Known Implementing Classes:
-
JacobianFunction
雅各比奥功能
public interface MultivariateMatrixFunction
An interface representing a multivariate matrix function.
表示多变量矩阵函数的接口。
-
2.0
2.0
从以下版本开始:
-
-
-
方法概要
Methods
限定符和类型 方法和说明
double[][]
value
(double[] point)
Compute the value for the function at the given point.
计算给定点的函数的值。
-
-
-
方法详细说明
-
value
double[][] value(double[] point) throws IllegalArgumentException
Compute the value for the function at the given point.
计算给定点的函数的值。
-
point
– point at which the function must be evaluated
点 – 必须评估功能的点
-
function value for the given point
给定点的函数值
-
IllegalArgumentException
– if point’s dimension is wrong
IllegalArgumentException – 如果点的维度是错误的
参数:
返回:
抛出:
-
-
-
9.2.
MultivariateMatrixFunction
源码赏析
MultivariateMatrixFunction
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis;
/**
* An interface representing a multivariate matrix function.
* @since 2.0
*/
public interface MultivariateMatrixFunction {
/**
* Compute the value for the function at the given point.
* @param point point at which the function must be evaluated
* @return function value for the given point
* @exception IllegalArgumentException if point's dimension is wrong
*/
double[][] value(double[] point)
throws IllegalArgumentException;
}
10.
org.apache.commons.math3.analysis.MultivariateVectorFunction
org.apache.commons.math3.analysis.MultivariateVectorFunction
10.1.
MultivariateVectorFunction
中文-英语对照文档
MultivariateVectorFunction
接口 MultivariateVectorFunction
-
-
All Known Subinterfaces:
-
DifferentiableMultivariateVectorFunction
,
MultivariateDifferentiableVectorFunction
SomeveIaBlueLivariatevectorFunction,多变量异前求挡功能
-
All Known Implementing Classes:
-
GradientFunction
渐变功能
public interface MultivariateVectorFunction
An interface representing a multivariate vectorial function.
表示多变量矢量函数的界面。
-
2.0
2.0
从以下版本开始:
-
-
-
方法概要
Methods
限定符和类型 方法和说明
double[]
value
(double[] point)
Compute the value for the function at the given point.
计算给定点的函数的值。
-
-
-
方法详细说明
-
value
double[] value(double[] point) throws IllegalArgumentException
Compute the value for the function at the given point.
计算给定点的函数的值。
-
point
– point at which the function must be evaluated
点 – 必须评估功能的点
-
function value for the given point
给定点的函数值
-
IllegalArgumentException
– if point’s dimension is wrong
IllegalArgumentException – 如果点的维度是错误的
参数:
返回:
抛出:
-
-
-
10.2.
MultivariateVectorFunction
源码赏析
MultivariateVectorFunction
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis;
/**
* An interface representing a multivariate vectorial function.
* @since 2.0
*/
public interface MultivariateVectorFunction {
/**
* Compute the value for the function at the given point.
* @param point point at which the function must be evaluated
* @return function value for the given point
* @exception IllegalArgumentException if point's dimension is wrong
*/
double[] value(double[] point)
throws IllegalArgumentException;
}
11.
org.apache.commons.math3.analysis.ParametricUnivariateFunction
org.apache.commons.math3.analysis.ParametricUnivariateFunction
11.1.
ParametricUnivariateFunction
中文-英语对照文档
ParametricUnivariateFunction
接口 ParametricUnivariateFunction
-
-
All Known Implementing Classes:
-
Gaussian.Parametric
,
HarmonicOscillator.Parametric
,
Logistic.Parametric
,
Logit.Parametric
,
PolynomialFunction.Parametric
,
Sigmoid.Parametric
高斯.Parametric,Handonic阳镜。参数,逻辑.Parametric,logit.Parametric,PolyNomialFunction.Parametric,Sigmoid.Parametric
public interface ParametricUnivariateFunction
An interface representing a real function that depends on one independent variable plus some extra parameters.
表示真正函数的接口,取决于一个独立变量加上一些额外的参数。
-
3.0
3.0
从以下版本开始:
-
-
-
方法概要
Methods
限定符和类型 方法和说明
double[]
gradient
(double x, double... parameters)
Compute the gradient of the function with respect to its parameters.
计算函数的渐变相对于其参数。
double
value
(double x, double... parameters)
Compute the value of the function.
计算函数的值。
-
-
-
方法详细说明
-
value
double value(double x, double... parameters)
Compute the value of the function.
计算函数的值。
-
x
– Point for which the function value should be computed.
应计算函数值的X点。
-
parameters
– Function parameters.
参数 – 功能参数。
-
the value.
价值。
参数:
返回:
-
-
gradient
double[] gradient(double x, double... parameters)
Compute the gradient of the function with respect to its parameters.
计算函数的渐变相对于其参数。
-
x
– Point for which the function value should be computed.
应计算函数值的X点。
-
parameters
– Function parameters.
参数 – 功能参数。
-
the value.
价值。
参数:
返回:
-
-
-
11.2.
ParametricUnivariateFunction
源码赏析
ParametricUnivariateFunction
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis;
/**
* An interface representing a real function that depends on one independent
* variable plus some extra parameters.
*
* @since 3.0
*/
public interface ParametricUnivariateFunction {
/**
* Compute the value of the function.
*
* @param x Point for which the function value should be computed.
* @param parameters Function parameters.
* @return the value.
*/
double value(double x, double ... parameters);
/**
* Compute the gradient of the function with respect to its parameters.
*
* @param x Point for which the function value should be computed.
* @param parameters Function parameters.
* @return the value.
*/
double[] gradient(double x, double ... parameters);
}
12.
org.apache.commons.math3.analysis.RealFieldUnivariateFunction
org.apache.commons.math3.analysis.RealFieldUnivariateFunction
12.1.
RealFieldUnivariateFunction
中文-英语对照文档
RealFieldUnivariateFunction
接口 RealFieldUnivariateFunction<T extends
RealFieldElement
<T>>
-
-
T
– the type of the field elements
t – 现场元素的类型
Type Parameters:
public interface RealFieldUnivariateFunction<T extends RealFieldElement<T>>
An interface representing a univariate real function.When a
user-defined
function encounters an error during evaluation, the
value
method should throw a
user-defined
unchecked exception.The following code excerpt shows the recommended way to do that using a root solver as an example, but the same construct is applicable to ODE integrators or optimizers.
private static class LocalException extends RuntimeException { // The x value that caused the problem. private final SomeFieldType x; public LocalException(SomeFieldType x) { this.x = x; } public double getX() { return x; } } private static class MyFunction implements FieldUnivariateFunction<SomeFieldType> { public SomeFieldType value(SomeFieldType x) { SomeFieldType y = hugeFormula(x); if (somethingBadHappens) { throw new LocalException(x); } return y; } } public void compute() { try { solver.solve(maxEval, new MyFunction(a, b, c), min, max); } catch (LocalException le) { // Retrieve the x value. } }
As shown, the exception is local to the user’s code and it is guaranteed that Apache Commons Math will not catch it.
表示单变量真实功能的接口。当用户定义的函数在评估期间遇到错误时,value方法应该抛出用户定义的未经检查的异常。以下代码摘录显示了使用根求解器作为示例的推荐方式,但相同的构造适用于ode集成商或优化器。私有静态类LocalException扩展了Runtimeexception { //导致问题的x值。 私人最终FineFieldType X; 公共LocalException(某人菲尔德蒂x){ this.x = x; } public double getx(){ 返回x; } } 私有静态类MyFunction实现FieldUnivariatefunction { public somefieldype值(somefieldtype x){ Somefieldtype y =巨大形式(x); if(somethingbadhappens){ 抛出新的LocalException(x); } 返回y; } } 公共void compute(){ 尝试 { solver.solve(maxeval,新myfunction(a,b,c),min,max); catch(localException Le){ //检索x值。 } } 如图所示,异常是用户代码的本地,并且保证Apache Commons Math不会捕获它。
-
3.6
3.6
-
UnivariateFunction
非凡透明
从以下版本开始:
另请参阅:
-
-
-
方法详细说明
-
value
T value(T x)
Compute the value of the function.
计算函数的值。
-
x
– Point at which the function value should be computed.
应计算函数值的X点。
-
the value of the function.
函数的值。
-
IllegalArgumentException
– when the activated method itself can ascertain that a precondition, specified in the API expressed at the level of the activated method, has been violated. When Commons Math throws an
IllegalArgumentException
, it is usually the consequence of checking the actual parameters passed to the method.
IllegalArgumentException – 当激活的方法本身可以确定在激活方法的API中指定的API中指定的前提条件时,已被侵犯。当Commons Math抛出IllegalArgumentException时,通常是检查传递给该方法的实际参数的结果。
参数:
返回:
抛出:
-
-
-
12.2.
RealFieldUnivariateFunction
源码赏析
RealFieldUnivariateFunction
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis;
import org.apache.commons.math3.RealFieldElement;
/**
* An interface representing a univariate real function.
* <p>
* When a <em>user-defined</em> function encounters an error during
* evaluation, the {@link #value(RealFieldElement) value} method should throw a
* <em>user-defined</em> unchecked exception.</p>
* <p>
* The following code excerpt shows the recommended way to do that using
* a root solver as an example, but the same construct is applicable to
* ODE integrators or optimizers.</p>
*
* <pre>
* private static class LocalException extends RuntimeException {
* // The x value that caused the problem.
* private final SomeFieldType x;
*
* public LocalException(SomeFieldType x) {
* this.x = x;
* }
*
* public double getX() {
* return x;
* }
* }
*
* private static class MyFunction implements FieldUnivariateFunction<SomeFieldType> {
* public SomeFieldType value(SomeFieldType x) {
* SomeFieldType y = hugeFormula(x);
* if (somethingBadHappens) {
* throw new LocalException(x);
* }
* return y;
* }
* }
*
* public void compute() {
* try {
* solver.solve(maxEval, new MyFunction(a, b, c), min, max);
* } catch (LocalException le) {
* // Retrieve the x value.
* }
* }
* </pre>
*
* As shown, the exception is local to the user's code and it is guaranteed
* that Apache Commons Math will not catch it.
*
* @param <T> the type of the field elements
* @since 3.6
* @see UnivariateFunction
*/
public interface RealFieldUnivariateFunction<T extends RealFieldElement<T>> {
/**
* Compute the value of the function.
*
* @param x Point at which the function value should be computed.
* @return the value of the function.
* @throws IllegalArgumentException when the activated method itself can
* ascertain that a precondition, specified in the API expressed at the
* level of the activated method, has been violated.
* When Commons Math throws an {@code IllegalArgumentException}, it is
* usually the consequence of checking the actual parameters passed to
* the method.
*/
T value(T x);
}
13.
org.apache.commons.math3.analysis.TrivariateFunction
org.apache.commons.math3.analysis.TrivariateFunction
13.1.
TrivariateFunction
中文-英语对照文档
TrivariateFunction
接口 TrivariateFunction
-
-
All Known Implementing Classes:
-
TricubicInterpolatingFunction
,
TricubicSplineInterpolatingFunction
TricubicInterpolationFunction,TricubicsplinePlinePolatingFunction
public interface TrivariateFunction
An interface representing a trivariate real function.
表示琐碎的实际功能的接口。
-
2.2
2.2
从以下版本开始:
-
-
-
方法概要
Methods
限定符和类型 方法和说明
double
value
(double x, double y, double z)
Compute the value for the function.
计算函数的值。
-
-
-
方法详细说明
-
value
double value(double x, double y, double z)
Compute the value for the function.
计算函数的值。
-
x
– x-coordinate for which the function value should be computed.
x – x坐标应该计算函数值的x坐标。
-
y
– y-coordinate for which the function value should be computed.
y – y坐标应该计算函数值。
-
z
– z-coordinate for which the function value should be computed.
z – z坐标应该计算函数值。
-
the value.
价值。
参数:
返回:
-
-
-
13.2.
TrivariateFunction
源码赏析
TrivariateFunction
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis;
/**
* An interface representing a trivariate real function.
*
* @since 2.2
*/
public interface TrivariateFunction {
/**
* Compute the value for the function.
*
* @param x x-coordinate for which the function value should be computed.
* @param y y-coordinate for which the function value should be computed.
* @param z z-coordinate for which the function value should be computed.
* @return the value.
*/
double value(double x, double y, double z);
}
14.
org.apache.commons.math3.analysis.UnivariateFunction
org.apache.commons.math3.analysis.UnivariateFunction
14.1.
UnivariateFunction
中文-英语对照文档
UnivariateFunction
接口 UnivariateFunction
-
-
All Known Subinterfaces:
-
DifferentiableUnivariateFunction
,
UnivariateDifferentiableFunction
CommanyAindeUnivariatefunction,单变化性功能
-
All Known Implementing Classes:
-
Abs
,
Acos
,
Acosh
,
Asin
,
Asinh
,
Atan
,
Atanh
,
BesselJ
,
Cbrt
,
Ceil
,
Constant
,
Cos
,
Cosh
,
Exp
,
Expm1
,
Floor
,
Gaussian
,
HarmonicOscillator
,
Identity
,
Inverse
,
Log
,
Log10
,
Log1p
,
Logistic
,
Logit
,
Minus
,
PolynomialFunction
,
PolynomialFunctionLagrangeForm
,
PolynomialFunctionNewtonForm
,
PolynomialSplineFunction
,
Power
,
Rint
,
Sigmoid
,
Signum
,
Sin
,
Sinc
,
Sinh
,
Sqrt
,
StepFunction
,
Tan
,
Tanh
,
Ulp
ABS,ACOS,Acosh,Asin,Asinh,atan,atanh,贝塞尔j,cbrt,ceil,常数,cos,cosh,exp,expm1,楼层,高斯,Hymoniccillator,身份,逆,日志,log10,log1p,logistic,logit,减号,多项式功能,多项式功能,PolyNomialFunctionnewtonFunce,PolynomialSpineFunction,PowernomalsplineFunction,Power,Rint,Sigmoid,Signum,Sin,Sinc,Sinh,SQRT,Spefcunction,Tan,Tanh,ULP
public interface UnivariateFunction
An interface representing a univariate real function.When a
user-defined
function encounters an error during evaluation, the
value
method should throw a
user-defined
unchecked exception.The following code excerpt shows the recommended way to do that using a root solver as an example, but the same construct is applicable to ODE integrators or optimizers.
private static class LocalException extends RuntimeException { // The x value that caused the problem. private final double x; public LocalException(double x) { this.x = x; } public double getX() { return x; } } private static class MyFunction implements UnivariateFunction { public double value(double x) { double y = hugeFormula(x); if (somethingBadHappens) { throw new LocalException(x); } return y; } } public void compute() { try { solver.solve(maxEval, new MyFunction(a, b, c), min, max); } catch (LocalException le) { // Retrieve the x value. } }
As shown, the exception is local to the user’s code and it is guaranteed that Apache Commons Math will not catch it.
表示单变量真实功能的接口。当用户定义的函数在评估期间遇到错误时,value方法应该抛出用户定义的未经检查的异常。以下代码摘录显示了使用根求解器作为示例的推荐方式,但相同的构造适用于ode集成商或优化器。私有静态类LocalException扩展了Runtimeexception { //导致问题的x值。 私人最终双x; 公共LocalException(双X){ this.x = x; } public double getx(){ 返回x; } } 私有静态类MyFunction实现单轴电功能{ 公共双值(双x){ 双y =巨大形式(x); if(somethingbadhappens){ 抛出新的LocalException(x); } 返回y; } } 公共void compute(){ 尝试 { solver.solve(maxeval,新myfunction(a,b,c),min,max); catch(localException Le){ //检索x值。 } } 如图所示,异常是用户代码的本地,并且保证Apache Commons Math不会捕获它。
-
-
-
方法概要
Methods
限定符和类型 方法和说明
double
value
(double x)
Compute the value of the function.
计算函数的值。
-
-
-
方法详细说明
-
value
double value(double x)
Compute the value of the function.
计算函数的值。
-
x
– Point at which the function value should be computed.
应计算函数值的X点。
-
the value of the function.
函数的值。
-
IllegalArgumentException
– when the activated method itself can ascertain that a precondition, specified in the API expressed at the level of the activated method, has been violated. When Commons Math throws an
IllegalArgumentException
, it is usually the consequence of checking the actual parameters passed to the method.
IllegalArgumentException – 当激活的方法本身可以确定在激活方法的API中指定的API中指定的前提条件时,已被侵犯。当Commons Math抛出IllegalArgumentException时,通常是检查传递给该方法的实际参数的结果。
参数:
返回:
抛出:
-
-
-
14.2.
UnivariateFunction
源码赏析
UnivariateFunction
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis;
/**
* An interface representing a univariate real function.
* <p>
* When a <em>user-defined</em> function encounters an error during
* evaluation, the {@link #value(double) value} method should throw a
* <em>user-defined</em> unchecked exception.</p>
* <p>
* The following code excerpt shows the recommended way to do that using
* a root solver as an example, but the same construct is applicable to
* ODE integrators or optimizers.</p>
*
* <pre>
* private static class LocalException extends RuntimeException {
* // The x value that caused the problem.
* private final double x;
*
* public LocalException(double x) {
* this.x = x;
* }
*
* public double getX() {
* return x;
* }
* }
*
* private static class MyFunction implements UnivariateFunction {
* public double value(double x) {
* double y = hugeFormula(x);
* if (somethingBadHappens) {
* throw new LocalException(x);
* }
* return y;
* }
* }
*
* public void compute() {
* try {
* solver.solve(maxEval, new MyFunction(a, b, c), min, max);
* } catch (LocalException le) {
* // Retrieve the x value.
* }
* }
* </pre>
*
* As shown, the exception is local to the user's code and it is guaranteed
* that Apache Commons Math will not catch it.
*
*/
public interface UnivariateFunction {
/**
* Compute the value of the function.
*
* @param x Point at which the function value should be computed.
* @return the value of the function.
* @throws IllegalArgumentException when the activated method itself can
* ascertain that a precondition, specified in the API expressed at the
* level of the activated method, has been violated.
* When Commons Math throws an {@code IllegalArgumentException}, it is
* usually the consequence of checking the actual parameters passed to
* the method.
*/
double value(double x);
}
15.
org.apache.commons.math3.analysis.UnivariateMatrixFunction
org.apache.commons.math3.analysis.UnivariateMatrixFunction
15.1.
UnivariateMatrixFunction
中文-英语对照文档
UnivariateMatrixFunction
接口 UnivariateMatrixFunction
-
-
All Known Subinterfaces:
-
DifferentiableUnivariateMatrixFunction
,
UnivariateDifferentiableMatrixFunction
CommanyAindeUntivariateMatrixFunction,UnivariedifferentiaBlexFunctixFunctix
public interface UnivariateMatrixFunction
An interface representing a univariate matrix function.
表示单变量矩阵函数的接口。
-
2.0
2.0
从以下版本开始:
-
-
-
方法概要
Methods
限定符和类型 方法和说明
double[][]
value
(double x)
Compute the value for the function.
计算函数的值。
-
-
-
方法详细说明
-
value
double[][] value(double x)
Compute the value for the function.
计算函数的值。
-
x
– the point for which the function value should be computed
X – 应计算函数值的点
-
the value
价值
参数:
返回:
-
-
-
15.2.
UnivariateMatrixFunction
源码赏析
UnivariateMatrixFunction
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis;
/**
* An interface representing a univariate matrix function.
*
* @since 2.0
*/
public interface UnivariateMatrixFunction {
/**
* Compute the value for the function.
* @param x the point for which the function value should be computed
* @return the value
*/
double[][] value(double x);
}
16.
org.apache.commons.math3.analysis.UnivariateVectorFunction
org.apache.commons.math3.analysis.UnivariateVectorFunction
16.1.
UnivariateVectorFunction
中文-英语对照文档
UnivariateVectorFunction
接口 UnivariateVectorFunction
-
-
All Known Subinterfaces:
-
DifferentiableUnivariateVectorFunction
,
UnivariateDifferentiableVectorFunction
CommanyAindeUnivariatevectorFunction,单偏见异位障碍功能
-
All Known Implementing Classes:
-
HermiteInterpolator
Hermiteinterpolator.
public interface UnivariateVectorFunction
An interface representing a univariate vectorial function.
表示单变量矢量函数的接口。
-
2.0
2.0
从以下版本开始:
-
-
-
方法概要
Methods
限定符和类型 方法和说明
double[]
value
(double x)
Compute the value for the function.
计算函数的值。
-
-
-
方法详细说明
-
value
double[] value(double x)
Compute the value for the function.
计算函数的值。
-
x
– the point for which the function value should be computed
X – 应计算函数值的点
-
the value
价值
参数:
返回:
-
-
-
16.2.
UnivariateVectorFunction
源码赏析
UnivariateVectorFunction
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis;
/**
* An interface representing a univariate vectorial function.
*
* @since 2.0
*/
public interface UnivariateVectorFunction {
/**
* Compute the value for the function.
* @param x the point for which the function value should be computed
* @return the value
*/
double[] value(double x);
}
17.
org.apache.commons.math3.analysis.FunctionUtils
org.apache.commons.math3.analysis.FunctionUtils
17.1.
FunctionUtils
中文-英语对照文档
FunctionUtils
类 FunctionUtils
-
java.lang.Object
-
- org.apache.commons.math3.analysis.FunctionUtils
-
public class FunctionUtils extends Object
Utilities for manipulating function objects.
用于操纵函数对象的实用程序。
-
3.0
3.0
从以下版本开始:
-
3.0
-
-
方法概要
Methods
限定符和类型 方法和说明
static
DifferentiableUnivariateFunction
add
(
DifferentiableUnivariateFunction
... f)
Deprecated.
as of 3.1 replaced by
add(UnivariateDifferentiableFunction...)
截至3.1替换(UnivariedifferiudeFunction …)
弃用。截至3.1替换(UnivariedifferiudeFunction …)
static
UnivariateDifferentiableFunction
add
(
UnivariateDifferentiableFunction
... f)
Adds functions.
添加函数。
static
UnivariateFunction
add
(
UnivariateFunction
... f)
Adds functions.
添加函数。
static
MultivariateFunction
collector
(
BivariateFunction
combiner, double initialValue)
Returns a MultivariateFunction h(x[]) defined by
返回由
static
MultivariateFunction
collector
(
BivariateFunction
combiner,
UnivariateFunction
f, double initialValue)
Returns a MultivariateFunction h(x[]) defined by
返回由
static
UnivariateFunction
combine
(
BivariateFunction
combiner,
UnivariateFunction
f,
UnivariateFunction
g)
Returns the univariate function
h(x) = combiner(f(x), g(x)).
返回单变量函数h(x)=组合器(f(x),g(x))。
static
DifferentiableUnivariateFunction
compose
(
DifferentiableUnivariateFunction
... f)
Deprecated.
as of 3.1 replaced by
compose(UnivariateDifferentiableFunction...)
截至3.1由Compose替换(单偏见异常的功能……)
弃用。截至3.1由Compose替换(单偏见异常的功能……)
static
UnivariateDifferentiableFunction
compose
(
UnivariateDifferentiableFunction
... f)
Composes functions.
撰写功能。
static
UnivariateFunction
compose
(
UnivariateFunction
... f)
Composes functions.
撰写功能。
static
UnivariateFunction
fix1stArgument
(
BivariateFunction
f, double fixed)
Creates a unary function by fixing the first argument of a binary function.
通过修复二进制函数的第一个参数创建一项功能。
static
UnivariateFunction
fix2ndArgument
(
BivariateFunction
f, double fixed)
Creates a unary function by fixing the second argument of a binary function.
通过修复二进制函数的第二个参数来创建一定的功能。
static
DifferentiableUnivariateFunction
multiply
(
DifferentiableUnivariateFunction
... f)
Deprecated.
as of 3.1 replaced by
multiply(UnivariateDifferentiableFunction...)
截至3.1替换为多个(单变量可差函数……)
弃用。截至3.1替换为乘法(单识别异导功能……)
static
UnivariateDifferentiableFunction
multiply
(
UnivariateDifferentiableFunction
... f)
Multiplies functions.
乘法功能。
static
UnivariateFunction
multiply
(
UnivariateFunction
... f)
Multiplies functions.
乘法功能。
static double[]
sample
(
UnivariateFunction
f, double min, double max, int n)
Samples the specified univariate real function on the specified interval.
在指定的时间间隔上示例指定的单变量实际功能。
static
DifferentiableMultivariateFunction
toDifferentiableMultivariateFunction
(
MultivariateDifferentiableFunction
f)
Deprecated.
this conversion method is temporary in version 3.1, as the
DifferentiableMultivariateFunction
interface itself is deprecated
此转换方法在3.1版中是暂时的,因为overiaLiveGariativentive界面本身已被推荐
弃用。此转换方法在3.1版中是暂时的,因为overiaLiveGariativentive界面本身已被推荐
static
DifferentiableMultivariateVectorFunction
toDifferentiableMultivariateVectorFunction
(
MultivariateDifferentiableVectorFunction
f)
Deprecated.
this conversion method is temporary in version 3.1, as the
DifferentiableMultivariateVectorFunction
interface itself is deprecated
此转换方法在3.1版中是临时的,因为overSiaLiveLivariatevectionFunction接口本身已被推荐
弃用。此转换方法在3.1版中是临时的,因为overSiaLiveLivariatevectionFunction接口本身已被推荐
static
DifferentiableUnivariateFunction
toDifferentiableUnivariateFunction
(
UnivariateDifferentiableFunction
f)
Deprecated.
this conversion method is temporary in version 3.1, as the
DifferentiableUnivariateFunction
interface itself is deprecated
此转换方法在3.1版中是临时的,因为弃用了不同的保险条件函数函数本身本身被弃用
弃用。此转换方法在3.1版中是临时的,因为弃用了不同的保险条件函数函数本身本身被弃用
static
MultivariateDifferentiableFunction
toMultivariateDifferentiableFunction
(
DifferentiableMultivariateFunction
f)
Deprecated.
this conversion method is temporary in version 3.1, as the
DifferentiableMultivariateFunction
interface itself is deprecated
此转换方法在3.1版中是暂时的,因为overiaLiveGariativentive界面本身已被推荐
弃用。此转换方法在3.1版中是暂时的,因为overiaLiveGariativentive界面本身已被推荐
static
MultivariateDifferentiableVectorFunction
toMultivariateDifferentiableVectorFunction
(
DifferentiableMultivariateVectorFunction
f)
Deprecated.
this conversion method is temporary in version 3.1, as the
DifferentiableMultivariateFunction
interface itself is deprecated
此转换方法在3.1版中是暂时的,因为overiaLiveGariativentive界面本身已被推荐
弃用。此转换方法在3.1版中是暂时的,因为overiaLiveGariativentive界面本身已被推荐
static
UnivariateDifferentiableFunction
toUnivariateDifferential
(
DifferentiableUnivariateFunction
f)
Deprecated.
this conversion method is temporary in version 3.1, as the
DifferentiableUnivariateFunction
interface itself is deprecated
此转换方法在3.1版中是临时的,因为弃用了不同的保险条件函数函数本身本身被弃用
弃用。此转换方法在3.1版中是临时的,因为弃用了不同的保险条件函数函数本身本身被弃用
-
-
-
方法详细说明
-
compose
public static UnivariateFunction compose(UnivariateFunction... f)
Composes functions.The functions in the argument list are composed sequentially, in the given order. For example, compose(f1,f2,f3) acts like f1(f2(f3(x))).
撰写功能。参数列表中的函数按照给定的顺序顺序组成。例如,撰写(F1,F2,F3),如F1(F2(F3(x)))。
-
f
– List of functions.
F – 功能列表。
-
the composite function.
复合功能。
参数:
返回:
-
-
compose
public static UnivariateDifferentiableFunction compose(UnivariateDifferentiableFunction... f)
Composes functions.The functions in the argument list are composed sequentially, in the given order. For example, compose(f1,f2,f3) acts like f1(f2(f3(x))).
撰写功能。参数列表中的函数按照给定的顺序顺序组成。例如,撰写(F1,F2,F3),如F1(F2(F3(x)))。
-
f
– List of functions.
F – 功能列表。
-
the composite function.
复合功能。
-
3.1
3.1
参数:
返回:
从以下版本开始:
-
-
compose
@Deprecated public static DifferentiableUnivariateFunction compose(DifferentiableUnivariateFunction... f)
Deprecated.
as of 3.1 replaced by
compose(UnivariateDifferentiableFunction...)
弃用。截至3.1由Compose替换(单偏见异常的功能……)
Composes functions.The functions in the argument list are composed sequentially, in the given order. For example, compose(f1,f2,f3) acts like f1(f2(f3(x))).
撰写功能。参数列表中的函数按照给定的顺序顺序组成。例如,撰写(F1,F2,F3),如F1(F2(F3(x)))。
-
f
– List of functions.
F – 功能列表。
-
the composite function.
复合功能。
参数:
返回:
-
-
add
public static UnivariateFunction add(UnivariateFunction... f)
Adds functions.
添加函数。
-
f
– List of functions.
F – 功能列表。
-
a function that computes the sum of the functions.
一个计算功能总和的函数。
参数:
返回:
-
-
add
public static UnivariateDifferentiableFunction add(UnivariateDifferentiableFunction... f)
Adds functions.
添加函数。
-
f
– List of functions.
F – 功能列表。
-
a function that computes the sum of the functions.
一个计算功能总和的函数。
-
3.1
3.1
参数:
返回:
从以下版本开始:
-
-
add
@Deprecated public static DifferentiableUnivariateFunction add(DifferentiableUnivariateFunction... f)
Deprecated.
as of 3.1 replaced by
add(UnivariateDifferentiableFunction...)
弃用。截至3.1替换(UnivariedifferiudeFunction …)
Adds functions.
添加函数。
-
f
– List of functions.
F – 功能列表。
-
a function that computes the sum of the functions.
一个计算功能总和的函数。
参数:
返回:
-
-
multiply
public static UnivariateFunction multiply(UnivariateFunction... f)
Multiplies functions.
乘法功能。
-
f
– List of functions.
F – 功能列表。
-
a function that computes the product of the functions.
计算功能乘积的函数。
参数:
返回:
-
-
multiply
public static UnivariateDifferentiableFunction multiply(UnivariateDifferentiableFunction... f)
Multiplies functions.
乘法功能。
-
f
– List of functions.
F – 功能列表。
-
a function that computes the product of the functions.
计算功能乘积的函数。
-
3.1
3.1
参数:
返回:
从以下版本开始:
-
-
multiply
@Deprecated public static DifferentiableUnivariateFunction multiply(DifferentiableUnivariateFunction... f)
Deprecated.
as of 3.1 replaced by
multiply(UnivariateDifferentiableFunction...)
弃用。截至3.1替换为乘法(单识别异导功能……)
Multiplies functions.
乘法功能。
-
f
– List of functions.
F – 功能列表。
-
a function that computes the product of the functions.
计算功能乘积的函数。
参数:
返回:
-
-
combine
public static UnivariateFunction combine(BivariateFunction combiner, UnivariateFunction f, UnivariateFunction g)
Returns the univariate function
h(x) = combiner(f(x), g(x)).
返回单变量函数h(x)=组合器(f(x),g(x))。
-
combiner
– Combiner function.
Combiner – Combiner功能。
-
f
– Function.
F – 功能。
-
g
– Function.
G – 功能。
-
the composite function.
复合功能。
参数:
返回:
-
-
collector
public static MultivariateFunction collector(BivariateFunction combiner, UnivariateFunction f, double initialValue)
Returns a MultivariateFunction h(x[]) defined byh(x[]) = combiner(...combiner(combiner(initialValue,f(x[0])),f(x[1]))...),f(x[x.length-1]))
返回由 h(x [])= Combiner(… Combiner(Combiner(InitalValue,F(x [0])),f(x [1]))…),f(x [x.length-1]))
-
combiner
– Combiner function.
Combiner – Combiner功能。
-
f
– Function.
F – 功能。
-
initialValue
– Initial value.
initialValue – 初始值。
-
a collector function.
收集器功能。
参数:
返回:
-
-
collector
public static MultivariateFunction collector(BivariateFunction combiner, double initialValue)
Returns a MultivariateFunction h(x[]) defined byh(x[]) = combiner(...combiner(combiner(initialValue,x[0]),x[1])...),x[x.length-1])
返回由 h(x [])= Combiner(… Combiner(Combiner(InitalValue,X 0]),X [1])……),X [X.Length-1])
-
combiner
– Combiner function.
Combiner – Combiner功能。
-
initialValue
– Initial value.
initialValue – 初始值。
-
a collector function.
收集器功能。
参数:
返回:
-
-
fix1stArgument
public static UnivariateFunction fix1stArgument(BivariateFunction f, double fixed)
Creates a unary function by fixing the first argument of a binary function.
通过修复二进制函数的第一个参数创建一项功能。
-
f
– Binary function.
F – 二进制功能。
-
fixed
– value to which the first argument of
f
is set.
固定值设置F的第一个参数的值。
-
the unary function h(x) = f(fixed, x)
一元函数h(x)= f(固定,x)
参数:
返回:
-
-
fix2ndArgument
public static UnivariateFunction fix2ndArgument(BivariateFunction f, double fixed)
Creates a unary function by fixing the second argument of a binary function.
通过修复二进制函数的第二个参数来创建一定的功能。
-
f
– Binary function.
F – 二进制功能。
-
fixed
– value to which the second argument of
f
is set.
固定值设置F的第二个参数的固定值。
-
the unary function h(x) = f(x, fixed)
一元函数h(x)= f(x,固定)
参数:
返回:
-
-
sample
public static double[] sample(UnivariateFunction f, double min, double max, int n) throws NumberIsTooLargeException, NotStrictlyPositiveException
Samples the specified univariate real function on the specified interval.The interval is divided equally into
n
sections and sample points are taken from
min
to
max - (max - min) / n
; therefore
f
is not sampled at the upper bound
max
.在指定的时间间隔上示例指定的单变量实际功能。间隔同样地划分为n个部分,并从min到max – (max-min)/ n;因此,F未在上限最多上采样。
-
f
– Function to be sampled
f – 要采样的功能
-
min
– Lower bound of the interval (included).
间隔的最小限制(包括)。
-
max
– Upper bound of the interval (excluded).
间隔(不包括)的最大 – 上限。
-
n
– Number of sample points.
n – 样品点数。
-
the array of samples.
样本数组。
-
NumberIsTooLargeException
– if the lower bound
min
is greater than, or equal to the upper bound
max
.
NumberStoolarGeexception – 如果下限最小值大于或等于上限最多。
-
NotStrictlyPositiveException
– if the number of sample points
n
is negative.
NOTSTRICLYPositiveException – 如果样本点N的数量是否定的。
参数:
返回:
抛出:
-
-
toDifferentiableUnivariateFunction
@Deprecated public static DifferentiableUnivariateFunction toDifferentiableUnivariateFunction(UnivariateDifferentiableFunction f)
Deprecated.
this conversion method is temporary in version 3.1, as the
DifferentiableUnivariateFunction
interface itself is deprecated
弃用。此转换方法在3.1版中是临时的,因为弃用了不同的保险条件函数函数本身本身被弃用
Convert a
UnivariateDifferentiableFunction
into a
DifferentiableUnivariateFunction
.
将单变量可分辨率的功能转换为可差的单变量功能。
-
f
– function to convert
F – 函数转换
-
converted function
转换功能
参数:
返回:
-
-
toUnivariateDifferential
@Deprecated public static UnivariateDifferentiableFunction toUnivariateDifferential(DifferentiableUnivariateFunction f)
Deprecated.
this conversion method is temporary in version 3.1, as the
DifferentiableUnivariateFunction
interface itself is deprecated
弃用。此转换方法在3.1版中是临时的,因为弃用了不同的保险条件函数函数本身本身被弃用
Convert a
DifferentiableUnivariateFunction
into a
UnivariateDifferentiableFunction
.Note that the converted function is able to handle
DerivativeStructure
up to order one. If the function is called with higher order, a
NumberIsTooLargeException
is thrown.将不同的保险芯站转换为单偏见的功能功能。请注意,转换后的功能能够处理衍生设计到订单。如果使用更高阶调用函数,则抛出NumberStoolGeexception。
-
f
– function to convert
F – 函数转换
-
converted function
转换功能
参数:
返回:
-
-
toDifferentiableMultivariateFunction
@Deprecated public static DifferentiableMultivariateFunction toDifferentiableMultivariateFunction(MultivariateDifferentiableFunction f)
Deprecated.
this conversion method is temporary in version 3.1, as the
DifferentiableMultivariateFunction
interface itself is deprecated
弃用。此转换方法在3.1版中是暂时的,因为overiaLiveGariativentive界面本身已被推荐
Convert a
MultivariateDifferentiableFunction
into a
DifferentiableMultivariateFunction
.
将多变量可差化函数转换为可差化的多变量功能。
-
f
– function to convert
F – 函数转换
-
converted function
转换功能
参数:
返回:
-
-
toMultivariateDifferentiableFunction
@Deprecated public static MultivariateDifferentiableFunction toMultivariateDifferentiableFunction(DifferentiableMultivariateFunction f)
Deprecated.
this conversion method is temporary in version 3.1, as the
DifferentiableMultivariateFunction
interface itself is deprecated
弃用。此转换方法在3.1版中是暂时的,因为overiaLiveGariativentive界面本身已被推荐
Convert a
DifferentiableMultivariateFunction
into a
MultivariateDifferentiableFunction
.Note that the converted function is able to handle
DerivativeStructure
elements that all have the same number of free parameters and order, and with order at most 1. If the function is called with inconsistent numbers of free parameters or higher order, a
DimensionMismatchException
or a
NumberIsTooLargeException
will be thrown.将offeriaIaplifulivariate功能转换为多变量异位功能。注意,转换后的功能能够处理所有具有相同数量的可用参数和订单的衍生体属性元素,并且最多有1.如果调用不一致的空闲参数或更高阶的函数,则虚拟ismatchException或NumberStoolGeexception。将被抛出。
-
f
– function to convert
F – 函数转换
-
converted function
转换功能
参数:
返回:
-
-
toDifferentiableMultivariateVectorFunction
@Deprecated public static DifferentiableMultivariateVectorFunction toDifferentiableMultivariateVectorFunction(MultivariateDifferentiableVectorFunction f)
Deprecated.
this conversion method is temporary in version 3.1, as the
DifferentiableMultivariateVectorFunction
interface itself is deprecated
弃用。此转换方法在3.1版中是临时的,因为overSiaLiveLivariatevectionFunction接口本身已被推荐
Convert a
MultivariateDifferentiableVectorFunction
into a
DifferentiableMultivariateVectorFunction
.
将多变量的uiriediuderFectorFunction转换为oversiaLiveLivariatevectorFunction。
-
f
– function to convert
F – 函数转换
-
converted function
转换功能
参数:
返回:
-
-
toMultivariateDifferentiableVectorFunction
@Deprecated public static MultivariateDifferentiableVectorFunction toMultivariateDifferentiableVectorFunction(DifferentiableMultivariateVectorFunction f)
Deprecated.
this conversion method is temporary in version 3.1, as the
DifferentiableMultivariateFunction
interface itself is deprecated
弃用。此转换方法在3.1版中是暂时的,因为overiaLiveGariativentive界面本身已被推荐
Convert a
DifferentiableMultivariateVectorFunction
into a
MultivariateDifferentiableVectorFunction
.Note that the converted function is able to handle
DerivativeStructure
elements that all have the same number of free parameters and order, and with order at most 1. If the function is called with inconsistent numbers of free parameters or higher order, a
DimensionMismatchException
or a
NumberIsTooLargeException
will be thrown.将offeriaIveLiveRivariatFectionFunction函数转换为多变量等前方。注意,转换后的功能能够处理所有具有相同数量的可用参数和订单的衍生体属性元素,并且最多有1.如果调用不一致的空闲参数或更高阶的函数,则虚拟ismatchException或NumberStoolGeexception。将被抛出。
-
f
– function to convert
F – 函数转换
-
converted function
转换功能
参数:
返回:
-
-
-
17.2.
FunctionUtils
源码赏析
FunctionUtils
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.math3.analysis;
import org.apache.commons.math3.analysis.differentiation.DerivativeStructure;
import org.apache.commons.math3.analysis.differentiation.MultivariateDifferentiableFunction;
import org.apache.commons.math3.analysis.differentiation.MultivariateDifferentiableVectorFunction;
import org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction;
import org.apache.commons.math3.analysis.function.Identity;
import org.apache.commons.math3.exception.DimensionMismatchException;
import org.apache.commons.math3.exception.NotStrictlyPositiveException;
import org.apache.commons.math3.exception.NumberIsTooLargeException;
import org.apache.commons.math3.exception.util.LocalizedFormats;
/**
* Utilities for manipulating function objects.
*
* @since 3.0
*/
public class FunctionUtils {
/**
* Class only contains static methods.
*/
private FunctionUtils() {}
/**
* Composes functions.
* <p>
* The functions in the argument list are composed sequentially, in the
* given order. For example, compose(f1,f2,f3) acts like f1(f2(f3(x))).</p>
*
* @param f List of functions.
* @return the composite function.
*/
public static UnivariateFunction compose(final UnivariateFunction ... f) {
return new UnivariateFunction() {
/** {@inheritDoc} */
public double value(double x) {
double r = x;
for (int i = f.length - 1; i >= 0; i--) {
r = f[i].value(r);
}
return r;
}
};
}
/**
* Composes functions.
* <p>
* The functions in the argument list are composed sequentially, in the
* given order. For example, compose(f1,f2,f3) acts like f1(f2(f3(x))).</p>
*
* @param f List of functions.
* @return the composite function.
* @since 3.1
*/
public static UnivariateDifferentiableFunction compose(final UnivariateDifferentiableFunction ... f) {
return new UnivariateDifferentiableFunction() {
/** {@inheritDoc} */
public double value(final double t) {
double r = t;
for (int i = f.length - 1; i >= 0; i--) {
r = f[i].value(r);
}
return r;
}
/** {@inheritDoc} */
public DerivativeStructure value(final DerivativeStructure t) {
DerivativeStructure r = t;
for (int i = f.length - 1; i >= 0; i--) {
r = f[i].value(r);
}
return r;
}
};
}
/**
* Composes functions.
* <p>
* The functions in the argument list are composed sequentially, in the
* given order. For example, compose(f1,f2,f3) acts like f1(f2(f3(x))).</p>
*
* @param f List of functions.
* @return the composite function.
* @deprecated as of 3.1 replaced by {@link #compose(UnivariateDifferentiableFunction...)}
*/
@Deprecated
public static DifferentiableUnivariateFunction compose(final DifferentiableUnivariateFunction ... f) {
return new DifferentiableUnivariateFunction() {
/** {@inheritDoc} */
public double value(double x) {
double r = x;
for (int i = f.length - 1; i >= 0; i--) {
r = f[i].value(r);
}
return r;
}
/** {@inheritDoc} */
public UnivariateFunction derivative() {
return new UnivariateFunction() {
/** {@inheritDoc} */
public double value(double x) {
double p = 1;
double r = x;
for (int i = f.length - 1; i >= 0; i--) {
p *= f[i].derivative().value(r);
r = f[i].value(r);
}
return p;
}
};
}
};
}
/**
* Adds functions.
*
* @param f List of functions.
* @return a function that computes the sum of the functions.
*/
public static UnivariateFunction add(final UnivariateFunction ... f) {
return n