|
lsst.afw gba399f52f3+9b61cfce8e
|
#include <Function.h>
Public Member Functions | |
| Function (unsigned int nParams) | |
| Construct a Function given the number of function parameters. | |
| Function (std::vector< double > const ¶ms) | |
| Construct a Function given the function parameters. | |
| Function (Function const &)=default | |
| Function (Function &&)=default | |
| Function & | operator= (Function const &)=default |
| Function & | operator= (Function &&)=default |
| ~Function () noexcept override=default | |
| unsigned int | getNParameters () const noexcept |
| Return the number of function parameters. | |
| virtual double | getParameter (unsigned int ind) const |
| Get one function parameter without range checking. | |
| std::vector< double > const & | getParameters () const noexcept |
| Return all function parameters. | |
| virtual bool | isLinearCombination () const noexcept |
| Is the function a linear combination of its parameters? | |
| void | setParameter (unsigned int ind, double newValue) |
| Set one function parameter without range checking. | |
| void | setParameters (std::vector< double > const ¶ms) |
| Set all function parameters. | |
| virtual std::string | toString (std::string const &) const |
| Return a string representation of the function. | |
Static Public Member Functions | |
| static std::shared_ptr< Function< ReturnT > > | readFits (fits::Fits &fitsfile) |
| Read an object from an already open FITS object. | |
| static std::shared_ptr< Function< ReturnT > > | dynamicCast (std::shared_ptr< Persistable > const &ptr) |
| Dynamically cast a shared_ptr. | |
Protected Member Functions | |
| std::string | getPythonModule () const override |
| Function () | |
Protected Attributes | |
| std::vector< double > | _params |
| bool | _isCacheValid |
Basic Function class.
Function objects are functions whose parameters may be read and changed using getParameters and setParameters. They were designed for use with the Kernel class.
These are simple functors with the restrictions that:
To create a function for a particular equation, subclass Function or (much more likely) Function1 or Function2. Your subclass must:
If you wish to cache any information you may use the _isCacheValid flag; this is automatically set false whenever parameters are changed.
Design Notes: The reason these functions exist (rather than using a pre-existing function class, such as Functor in VisualWorkbench) is because the Kernel class requires function objects with a standard interface for setting and getting function parameters.
The reason isLinearCombination exists is to support refactoring LinearCombinationKernels.
Definition at line 83 of file Function.h.
|
inlineexplicit |
Construct a Function given the number of function parameters.
The function parameters are initialized to 0.
| nParams | number of function parameters |
Definition at line 91 of file Function.h.
|
inlineexplicit |
Construct a Function given the function parameters.
| params | function parameters |
Definition at line 97 of file Function.h.
|
default |
|
default |
|
overridedefaultnoexcept |
|
inlineexplicitprotected |
Definition at line 191 of file Function.h.
|
staticinherited |
Dynamically cast a shared_ptr.
Dynamically cast a shared pointer and raise on failure.
You must provide an explicit template instantiation in the .cc file for each class that inherits from PersistableFacade. Designed to work around RTTI issues on macOS with hidden symbols;
| lsst::pex::exceptions::LogicError | if the cast fails |
param[in] ptr The pointer to be cast.
| lsst::pex::exceptions::TypeError | If the dynamic cast fails. |
Definition at line 218 of file Persistable.cc.
|
inlinenoexcept |
Return the number of function parameters.
Definition at line 112 of file Function.h.
|
inlinevirtual |
Get one function parameter without range checking.
| ind | index of parameter |
Definition at line 119 of file Function.h.
|
inlinenoexcept |
Return all function parameters.
Definition at line 129 of file Function.h.
|
inlineoverrideprotected |
Definition at line 188 of file Function.h.
|
inlinevirtualnoexcept |
Is the function a linear combination of its parameters?
Reimplemented in lsst::afw::math::BasePolynomialFunction2< ReturnT >, lsst::afw::math::Chebyshev1Function1< ReturnT >, and lsst::afw::math::PolynomialFunction1< ReturnT >.
Definition at line 138 of file Function.h.
|
default |
|
default |
|
inlinestaticinherited |
Read an object from an already open FITS object.
| [in] | fitsfile | FITS object to read from, already positioned at the desired HDU. |
Definition at line 183 of file Persistable.h.
|
inline |
Set one function parameter without range checking.
| ind | index of parameter |
| newValue | new value for parameter |
Definition at line 143 of file Function.h.
|
inline |
Set all function parameters.
| lsst::pex::exceptions::InvalidParameterError | if the wrong number of parameters is supplied. |
| params | vector of function parameters |
Definition at line 156 of file Function.h.
|
inlinevirtual |
Return a string representation of the function.
Reimplemented in lsst::afw::math::BilinearWarpingKernel::BilinearFunction1, lsst::afw::math::Chebyshev1Function1< ReturnT >, lsst::afw::math::Chebyshev1Function2< ReturnT >, lsst::afw::math::DoubleGaussianFunction2< ReturnT >, lsst::afw::math::Function1< ReturnT >, lsst::afw::math::Function1< Kernel::Pixel >, lsst::afw::math::Function1< Pixel >, lsst::afw::math::Function2< ReturnT >, lsst::afw::math::Function2< double >, lsst::afw::math::Function2< Pixel >, lsst::afw::math::GaussianFunction1< ReturnT >, lsst::afw::math::GaussianFunction2< ReturnT >, lsst::afw::math::IntegerDeltaFunction1< ReturnT >, lsst::afw::math::IntegerDeltaFunction2< ReturnT >, lsst::afw::math::LanczosFunction1< ReturnT >, lsst::afw::math::LanczosFunction2< ReturnT >, lsst::afw::math::NearestWarpingKernel::NearestFunction1, lsst::afw::math::PolynomialFunction1< ReturnT >, and lsst::afw::math::PolynomialFunction2< ReturnT >.
Definition at line 173 of file Function.h.
|
mutableprotected |
Definition at line 186 of file Function.h.
|
protected |
Definition at line 185 of file Function.h.