com.aquafold.openapi.math
Interface AQParametricRealFunction
public interface AQParametricRealFunction
Method Summary |
double[] |
gradient(double v,
double[] parameters)
Calculates values of gradient along each parameter [see value] |
double |
value(double v,
double[] parameters)
Allows user to define a function in terms of the independent variable (double v) and the function's coefficients (double[] parameters). |
value
double value(double v,
double[] parameters)
throws Exception
- Allows user to define a function in terms of the independent variable (double v) and the function's coefficients (double[] parameters).
Prevents coding the function for each evaluation via the value method.
For example, if the function is a polynomial y=3x^2 + 5x+7, and we wish to evaluate it at x = 1, then the incoming variables v and
parameters[] would be 1 and {3, 5, 7}, respectively; The two methods are
- value: calculates the value of the function given the incoming value of the independent variable and the function coefficients.
- gradient:
calculates the partial derivative of the function with respect to each coefficient (Used to calculate the jabobian elements in nonlinear fits)
This allows the fitting functions to operate generally, rather than being customized for every incoming fit.
- Parameters:
v
- a double precision valueparameters
- a double precision array
- Returns:
- double precision array
- Throws:
Exception
- if calculation fails
gradient
double[] gradient(double v,
double[] parameters)
throws Exception
- Calculates values of gradient along each parameter [see value]
- Parameters:
v
- a double precision valueparameters
- a double precision array
- Returns:
- double precision array
- Throws:
Exception
- if calculation fails
Copyright © 2010 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.