Simbody
3.7
|
This is a two-argument Function built using a shared BicubicSurface and managing current state to optimize for localized access. More...
Public Member Functions | |
BicubicFunction (const BicubicSurface &surface) | |
Create a BicubicFunction referencing the given BicubicSurface, which is shared not copied. More... | |
const BicubicSurface & | getBicubicSurface () const |
Return a reference to the BicubicSurface object being used by this BicubicFunction. More... | |
Real | calcValue (const Vector &XY) const override |
Calculate the value of the function at a particular XY coordinate. More... | |
Real | calcDerivative (const Array_< int > &derivComponents, const Vector &XY) const override |
Calculate a partial derivative of this function at a particular point. More... | |
int | getArgumentSize () const override |
This implements the Function base class pure virtual; here it always returns 2 (X and Y). More... | |
int | getMaxDerivativeOrder () const override |
This implements the Function base class pure virtual specifying how many derivatives can be taken of this function; here it is unlimited. More... | |
BicubicFunction * | clone () const override |
Create a new heap-allocated copy of this concrete Function. More... | |
Real | calcDerivative (const std::vector< int > &derivComponents, const Vector &x) const |
This provides compatibility with std::vector without requiring any copying. More... | |
Public Member Functions inherited from SimTK::Function_< Real > | |
virtual | ~Function_ () |
Real | calcDerivative (const std::vector< int > &derivComponents, const Vector &x) const |
This provides compatibility with std::vector without requiring any copying. More... | |
This is a two-argument Function built using a shared BicubicSurface and managing current state to optimize for localized access.
Each distinct use of the BicubicSurface should create its own BicubicFunction, which is a lightweight wrapper around the BicubicSurface. This allows for localized access pattern optimization to be effective for each use of the surface.
BicubicFunction is not thread-safe, but the underlying BicubicSurface is. Each thread should thus have a private BicubicFunction that it uses to access the shared surface.
|
inline |
Create a BicubicFunction referencing the given BicubicSurface, which is shared not copied.
|
inline |
Return a reference to the BicubicSurface object being used by this BicubicFunction.
Calculate the value of the function at a particular XY coordinate.
Note that XY must be a vector with only 2 elements in it (because this is a 2-argument function), anything else will throw an exception. This is the required implementation of the Function base class pure virtual.
[in] | XY | the 2-Vector of input arguments X and Y. |
Implements SimTK::Function_< Real >.
|
inlineoverridevirtual |
Calculate a partial derivative of this function at a particular point.
Which derivative to take is specified by listing the input components (0==x, 1==y) with which to take it. For example, if derivComponents=={0}, that indicates a first derivative with respective to argument x.
If derivComponents=={0, 0, 0}, that indicates a third derivative with respective to argument x. If derivComponents=={0, 1}, that indicates a partial second derivative with respect to x and y, that is Df(x,y)/DxDy. (We use capital D to indicate partial derivative.)
[in] | derivComponents | The input components with respect to which the derivative should be taken. Each entry must be 0 or 1, and if there are 4 or more entries the result will be zero since the surface has only 3 non-zero derivatives. |
[in] | XY | The vector of two input arguments that define the XY location on the surface. |
Implements SimTK::Function_< Real >.
|
inlineoverridevirtual |
This implements the Function base class pure virtual; here it always returns 2 (X and Y).
Implements SimTK::Function_< Real >.
|
inlineoverridevirtual |
This implements the Function base class pure virtual specifying how many derivatives can be taken of this function; here it is unlimited.
However, note that a bicubic surface is continuous up to the second derivative, discontinuous at the third, and zero for any derivatives equal to or higher than the fourth.
Implements SimTK::Function_< Real >.
|
inlineoverridevirtual |
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_< Real >.
|
inline |
This provides compatibility with std::vector without requiring any copying.