This is a Function_ subclass whose output value is a linear function of its arguments: f(x, y, ...) = ax+by+...+c.
More...
template<class T>
class SimTK::Function_< T >::Linear
This is a Function_ subclass whose output value is a linear function of its arguments: f(x, y, ...) = ax+by+...+c.
◆ Linear()
Create a Function_::Linear object.
- Parameters
-
coefficients | The coefficients of the linear function. The number of arguments expected by the function is equal to coefficients.size()-1. coefficients[0] is the coefficient for the first argument, coefficients[1] is the coefficient for the second argument, etc. The final element of coefficients contains the constant term. |
◆ calcValue()
Calculate the value of this function at a particular point.
- Parameters
-
x | the Vector of input arguments. Its size must equal the value returned by getArgumentSize(). |
Implements SimTK::Function_< T >.
◆ calcDerivative() [1/2]
Calculate a partial derivative of this function at a particular point.
Which derivative to take is specified by listing the input components with which to take it. For example, if derivComponents=={0}, that indicates a first derivative with respective to component 0. If derivComponents=={0, 0, 0}, that indicates a third derivative with respective to component 0. If derivComponents=={4, 7}, that indicates a partial second derivative with respect to components 4 and 7.
- Parameters
-
derivComponents | The input components with respect to which the derivative should be taken. Its size must be less than or equal to the value returned by getMaxDerivativeOrder(). |
x | The Vector of input arguments. Its size must equal the value returned by getArgumentSize(). |
- Returns
- The value of the selected derivative, which is of type T.
Implements SimTK::Function_< T >.
◆ getArgumentSize()
◆ getMaxDerivativeOrder()
◆ clone()
Create a new heap-allocated copy of this concrete Function.
For backwards compatibility this is not pure virtual; it has a default implementation that throws an exception if called. However, it should always be implemented.
Reimplemented from SimTK::Function_< T >.
◆ calcDerivative() [2/2]
template<class T>
T SimTK::Function_< T >::Linear::calcDerivative |
( |
const std::vector< int > & |
derivComponents, |
|
|
const Vector & |
x |
|
) |
| const |
|
inline |
This provides compatibility with std::vector without requiring any copying.
The documentation for this class was generated from the following file: