22 #ifndef LSST_AFW_MATH_POLYNOMIALS_ScaledBasis2d_h_INCLUDED 23 #define LSST_AFW_MATH_POLYNOMIALS_ScaledBasis2d_h_INCLUDED 27 namespace lsst {
namespace geom {
namespace polynomials {
29 template <
typename Basis>
42 template <
typename Nested>
95 Nested
const &
getNested() const noexcept {
return _nested; }
162 template <
typename Vector>
169 template <
typename Vector>
172 return getNested().sumWith(
getScaling().applyForward(point), coefficients, workspace, mode);
185 template <
typename Vector>
188 std::forward<Vector>(
basis));
192 template <
typename Vector>
195 std::forward<Vector>(
basis),
206 #endif // !LSST_AFW_MATH_POLYNOMIALS_ScaledBasis2d_h_INCLUDED
Scaling2d const & getScaling() const noexcept
Return the scaling transform.
A floating-point coordinate rectangle geometry.
int index(int x, int y) const
Return the flattened index of the basis function with the given x and y orders.
Summation using regular floating-point addition.
ScaledBasis2d & operator=(ScaledBasis2d const &)=default
Default copy assignment.
std::size_t size() const
Return the number of elements in the basis.
std::size_t getOrder() const
Return the order of the basis.
A 2-d function defined by a series expansion and its coefficients.
typename Nested::IndexRange IndexRange
The type returned by getIndices().
SumMode
Enum used to control how to sum polynomial terms.
ScaledBasis2d(std::size_t order, Box2D const &box)
Construct a basis that remaps the given box to [-1, 1]x[-1, 1] before evaluating the nested polynomia...
A 2-d separable affine transform that can be used to map one interval to another. ...
Nested const & getNested() const noexcept
Return the nested basis.
A base class for image defects.
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Typedefs to be used for probability and parameter values.
double sumWith(geom::Point2D const &point, Vector const &coefficients, SumMode mode=SumMode::FAST) const
Evaluate a basis expansion with the given coefficients.
typename Nested::Workspace Workspace
The type returned by makeWorkspace().
table::Key< table::Array< double > > basis
Scaling2d then(Scaling2d const &second) const noexcept
Compose two transforms.
A 2-d basis that transforms all input points before evaluating nested basis.
Scaled scaled(Scaling2d const &first) const
Return a scaled basis that delegates to a copy of this.
Scaling2d makeUnitRangeScaling2d(geom::Box2D const &box)
Return a Scaling1d that maps the given box to [-1, 1]x[-1, 1].
ScaledBasis2d(Nested const &nested, Scaling2d const &scaling)
Construct a scaled basis from a nested basis and a scaling transform.
IndexRange getIndices() const
Return a range of iterators that dereference to Index2d.
double sumWith(geom::Point2D const &point, Vector const &coefficients, Workspace &workspace, SumMode mode=SumMode::FAST) const
Evaluate a basis expansion with the given coefficients (external workspace version).
void fill(geom::Point2D const &point, Vector &&basis) const
Evaluate the basis at a given point.
Workspace makeWorkspace() const
Allocate a workspace that can be passed to sumWith() and fill() to avoid repeated memory allocations...
ndarray::Array< double const, 2, 2 > coefficients
void fill(geom::Point2D const &point, Vector &&basis, Workspace &workspace) const
Evaluate the basis at a given point (external workspace version).