Simbody
3.3
|
This is a two-argument Function built using a shared BicubicSurface and managing current state to optimize for localized access. More...
#include <BicubicSurface.h>
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... | |
virtual Real | calcValue (const Vector &XY) const |
Calculate the value of the function at a particular XY coordinate. More... | |
virtual Real | calcDerivative (const Array_< int > &derivComponents, const Vector &XY) const |
Calculate a partial derivative of this function at a particular point. More... | |
virtual int | getArgumentSize () const |
This implements the Function base class pure virtual; here it always returns 2 (X and Y). More... | |
virtual int | getMaxDerivativeOrder () const |
This implements the Function base class pure virtual specifying how many derivatives can be taken of this function; here it is unlimited. 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.
|
inlinevirtual |
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 >.
|
inlinevirtual |
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 >.
|
inlinevirtual |
This implements the Function base class pure virtual; here it always returns 2 (X and Y).
Implements SimTK::Function_< Real >.
|
inlinevirtual |
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 >.