LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
22 #ifndef LSST_AFW_MATH_POLYNOMIALS_Function2d_h_INCLUDED
23 #define LSST_AFW_MATH_POLYNOMIALS_Function2d_h_INCLUDED
29 namespace lsst {
namespace geom {
namespace polynomials {
41 template <
typename Basis_>
57 _coefficients(Eigen::VectorXd::Zero(
basis.
size()))
69 template <
typename Iterator>
111 return _basis.sumWith(point, _coefficients, mode);
116 return _basis.sumWith(point, _coefficients, workspace, mode);
138 return _coefficients.head(
size());
150 Eigen::VectorXd _coefficients;
154 template <
typename Basis>
160 template <
typename Basis,
typename Iterator>
167 #endif // !LSST_AFW_MATH_POLYNOMIALS_Function2d_h_INCLUDED
Basis const & getBasis() const
Return the associated Basis2d object.
A 2-d separable affine transform that can be used to map one interval to another.
Function2d(Basis const &basis)
Construct with zero-valued coefficients.
ndarray::Array< double const, 2, 2 > coefficients
Function2d(Basis const &basis, Eigen::VectorXd const &coefficients)
Construct with coefficients from an Eigen object.
double const * const_iterator
Function2d(Function2d const &)=default
Default copy constructor.
iterator begin()
Iterators over coefficients.
Function2d< Basis > makeFunction2d(Basis const &basis, Eigen::VectorXd const &coefficients)
Create a Function2d of the appropriate type from a Basis2d and an Eigen object containing coefficient...
Workspace makeWorkspace() const
Allocate workspace that can be passed to operator() to avoid repeated memory allocations.
const_iterator end() const
double & operator[](std::size_t n)
Return the coefficient associated with the nth basis function.
auto getCoefficients() const
double operator()(geom::Point2D const &point, Workspace &workspace, SumMode mode=SumMode::FAST) const
Evaluate the function at the given point.
FastFinder::Iterator Iterator
SumMode
Enum used to control how to sum polynomial terms.
typename Basis::Workspace Workspace
Type returned by makeWorkspace().
Basis_ Basis
The basis type used by this function.
table::Key< table::Array< double > > basis
A base class for image defects.
Function2d & operator=(Function2d const &)=default
Default copy assignment.
Function2d & operator=(Function2d &&)=default
Default move assignment.
Function2d(Basis const &basis, Iterator first, Iterator last)
Construct by copying coefficients from an STL iterator range.
Function2d(Function2d &&)=default
Default move constructor.
std::size_t size() const
Return the number of coefficients.
double operator()(geom::Point2D const &point, SumMode mode=SumMode::FAST) const
Evaluate the function at the given point.
const_iterator cend() const
double const & operator[](std::size_t n) const
Function2d< typename Basis::Scaled > scaled(Scaling2d const &scaling) const
Return a new function that applies the given scaling to all points before evaluation.
auto getCoefficients()
Return the coefficient vector as an Eigen matrix-like object.
table::Key< double > scaling
@ FAST
Summation using regular floating-point addition.
const_iterator begin() const
const_iterator cbegin() const
A 2-d function defined by a series expansion and its coefficients.