LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
LSST Data Management Base Package
|
Low-level polynomials (including special polynomials) in C++. More...
Namespaces | |
namespace | detail |
Classes | |
class | Basis1d |
A basis interface for 1-d series expansions. More... | |
class | Basis2d |
A basis interface for 2-d series expansions. More... | |
class | BinomialMatrix |
A class that computes binomial coefficients up to a certain power. More... | |
class | Chebyshev1Recurrence |
A Recurrence for Chebyshev polynomials of the first kind. More... | |
class | Function1d |
A 1-d function defined by a series expansion and its coefficients. More... | |
class | Function2d |
A 2-d function defined by a series expansion and its coefficients. More... | |
struct | Index2d |
A custom tuple that relates the indices of two 1-d functions for x and y to the flattened index for the 2-d function they form. More... | |
class | PackedBasis2d |
A Basis2d formed from the product of a Basis1d for each of x and y, truncated at the sum of their orders. More... | |
class | PackedBasisWorkspace2d |
A workspace object that can be used to avoid extra memory allocations in repeated calls to PackedBasis2d methods. More... | |
class | PackedIndexIterator |
An iterator for traversing "packed" triangular 2-d series expansions, in which two 1-d expansions are truncated according to the sum of their orders and all values for one order are stored before any values of the subsequent order. More... | |
class | PackedIndexRange |
A specialized iterator range class for PackedIndexIterator, providing size calculation, comparison, and range-based for support. More... | |
class | PolynomialRecurrence |
A Recurrence for standard polynomials. More... | |
struct | Recurrence |
A recurrence relation concept for RecurrenceBasis1d. More... | |
class | RecurrenceBasis1d |
A basis for 1-d series expansions defined by a recurrence relation. More... | |
class | SafeSum |
A numerically stable summation algorithm for floating-point numbers. More... | |
class | ScaledBasis1d |
A 1-d basis that transforms all input points before evaluating nested basis. More... | |
class | ScaledBasis2d |
A 2-d basis that transforms all input points before evaluating nested basis. More... | |
class | Scaling1d |
A 1-d affine transform that can be used to map one interval to another. More... | |
class | Scaling2d |
A 2-d separable affine transform that can be used to map one interval to another. More... | |
Enumerations | |
enum class | PackingOrder { YX , XY } |
Enum defining the packing orders used to order 2-d polynomial coefficients. More... | |
enum class | SumMode { FAST , SAFE } |
Enum used to control how to sum polynomial terms. More... | |
Functions | |
template<typename Basis > | |
Function1d< Basis > | makeFunction1d (Basis const &basis, Eigen::VectorXd const &coefficients) |
Create a Function1d of the appropriate type from a Basis1d and an Eigen object containing coefficients. | |
template<typename Basis , typename Iterator > | |
Function1d< Basis > | makeFunction1d (Basis const &basis, Iterator first, Iterator last) |
Create a Function1d of the appropriate type from a Basis1d and an iterator range to copy coefficients from. | |
template<typename Basis > | |
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 coefficients. | |
template<typename Basis , typename Iterator > | |
Function2d< Basis > | makeFunction2d (Basis const &basis, Iterator first, Iterator last) |
Create a Function2d of the appropriate type from a Basis2d and an iterator range to copy coefficients from. | |
PolynomialFunction1d | simplified (ScaledPolynomialFunction1d const &f) |
Calculate the standard polynomial function that is equivalent to a scaled standard polynomial function. | |
template<PackingOrder packing> | |
PolynomialFunction2d< packing > | simplified (ScaledPolynomialFunction2d< packing > const &f) |
Calculate the standard polynomial function that is equivalent to a scaled standard polynomial function. | |
Scaling1d | makeUnitRangeScaling1d (double min, double max) noexcept |
Return a Scaling1d that maps the interval [min, max] to [-1, 1]. | |
Scaling2d | makeUnitRangeScaling2d (geom::Box2D const &box) |
Return a Scaling1d that maps the given box to [-1, 1]x[-1, 1]. | |
template PolynomialFunction2d< PackingOrder::XY > | simplified (ScaledPolynomialFunction2d< PackingOrder::XY > const &) |
template PolynomialFunction2d< PackingOrder::YX > | simplified (ScaledPolynomialFunction2d< PackingOrder::YX > const &) |
Low-level polynomials (including special polynomials) in C++.
The geom::polynomials library provides low-level classes for efficiently evaluating polynomial basis functions and expansions in C++. The classes here:
They are intended to be used as the building blocks of higher-level objects that are visible to Python users and persisted with our data products, such as afw::math::ChebyshevBoundedField and the afw::math::Function hierarchy.
At present, the library only includes support for 1-d and 2-d standard polynomials and Chebyshev polynomials of the first kind, but adding support for any other function defined by a recurrence relation (i.e. any other special polynomial) should be extremely easy (see RecurrenceBasis1d), and need not be done within the polynomials library itself.
For both 1-d and 2-d, the library contains the following kinds of objects:
The library also includes a few utility classes and functions:
A Basis1d for Chebyshev polynomials of the first kind.
Definition at line 48 of file Chebyshev1Basis1d.h.
using lsst::geom::polynomials::Chebyshev1Basis2d = PackedBasis2d<Chebyshev1Basis1d, packing> |
A Basis2d for Chebyshev polynomials of the first kind, templated on packing order.
Definition at line 34 of file Chebyshev1Basis2d.h.
A Basis2d for Chebyshev polynomials of the first kind, ordered via PackingOrder::XY.
Definition at line 41 of file Chebyshev1Basis2d.h.
A Basis2d for Chebyshev polynomials of the first kind, ordered via PackingOrder::YX.
Definition at line 44 of file Chebyshev1Basis2d.h.
A Function1d for Chebyshev polynomials of the first kind.
Definition at line 31 of file Chebyshev1Function1d.h.
using lsst::geom::polynomials::Chebyshev1Function2d = Function2d<Chebyshev1Basis2d<packing>> |
A Function2d for Chebyshev polynomials of the first kind, templated on packing order.
Definition at line 32 of file Chebyshev1Function2d.h.
A Function2d for Chebyshev polynomials of the first kind, ordered via PackingOrder::XY.
Definition at line 39 of file Chebyshev1Function2d.h.
A Function2d for Chebyshev polynomials of the first kind, ordered via PackingOrder::YX.
Definition at line 42 of file Chebyshev1Function2d.h.
A Basis1d for standard polynomials.
Definition at line 50 of file PolynomialBasis1d.h.
using lsst::geom::polynomials::PolynomialBasis2d = PackedBasis2d<PolynomialBasis1d, packing> |
A Basis2d for standard polynomials, templated on packing order.
Definition at line 34 of file PolynomialBasis2d.h.
A Basis2d for standard polynomials, ordered via PackingOrder::XY.
Definition at line 41 of file PolynomialBasis2d.h.
A Basis2d for standard polynomials, ordered via PackingOrder::YX.
Definition at line 44 of file PolynomialBasis2d.h.
A Function1d for standard polynomials.
Definition at line 31 of file PolynomialFunction1d.h.
using lsst::geom::polynomials::PolynomialFunction2d = Function2d<PolynomialBasis2d<packing>> |
A Function2d for standard polynomials.
Definition at line 32 of file PolynomialFunction2d.h.
A Function2d for standard polynomials, ordered via PackingOrder::XY.
Definition at line 39 of file PolynomialFunction2d.h.
A Function2d for standard polynomials, ordered via PackingOrder::YX.
Definition at line 42 of file PolynomialFunction2d.h.
A Basis1d for scaled Chebyshev polynomials of the first kind.
Definition at line 51 of file Chebyshev1Basis1d.h.
using lsst::geom::polynomials::ScaledChebyshev1Basis2d = ScaledBasis2d<Chebyshev1Basis2d<packing>> |
A Basis2d for scaled Chebyshev polynomials of the first kind, templated on packing order.
Definition at line 38 of file Chebyshev1Basis2d.h.
using lsst::geom::polynomials::ScaledChebyshev1Basis2dXY = ScaledChebyshev1Basis2d<PackingOrder::XY> |
A Basis2d for scaled Chebyshev polynomials of the first kind, ordered via PackingOrder::XY.
Definition at line 47 of file Chebyshev1Basis2d.h.
using lsst::geom::polynomials::ScaledChebyshev1Basis2dYX = ScaledChebyshev1Basis2d<PackingOrder::YX> |
A Basis2d for scaled Chebyshev polynomials of the first kind, ordered via PackingOrder::YX.
Definition at line 50 of file Chebyshev1Basis2d.h.
A Function1d for scaled Chebyshev polynomials of the first kind.
Definition at line 34 of file Chebyshev1Function1d.h.
using lsst::geom::polynomials::ScaledChebyshev1Function2d = Function2d<ScaledChebyshev1Basis2d<packing>> |
A Function2d for scaled Chebyshev polynomials of the first kind, templated on packing order.
Definition at line 36 of file Chebyshev1Function2d.h.
using lsst::geom::polynomials::ScaledChebyshev1Function2dXY = ScaledChebyshev1Function2d<PackingOrder::XY> |
A Function2d for scaled Chebyshev polynomials of the first kind, ordered via PackingOrder::XY.
Definition at line 45 of file Chebyshev1Function2d.h.
using lsst::geom::polynomials::ScaledChebyshev1Function2dYX = ScaledChebyshev1Function2d<PackingOrder::YX> |
A Function2d for scaled Chebyshev polynomials of the first kind, ordered via PackingOrder::YX.
Definition at line 48 of file Chebyshev1Function2d.h.
A ScaledBasis1d for standard polynomials.
Definition at line 53 of file PolynomialBasis1d.h.
using lsst::geom::polynomials::ScaledPolynomialBasis2d = ScaledBasis2d<PolynomialBasis2d<packing>> |
A Basis2d for scaled standard polynomials, templated on packing order.
Definition at line 38 of file PolynomialBasis2d.h.
using lsst::geom::polynomials::ScaledPolynomialBasis2dXY = ScaledPolynomialBasis2d<PackingOrder::XY> |
A Basis2d for scaled standard polynomials, ordered via PackingOrder::XY.
Definition at line 47 of file PolynomialBasis2d.h.
using lsst::geom::polynomials::ScaledPolynomialBasis2dYX = ScaledPolynomialBasis2d<PackingOrder::YX> |
A Basis2d for scaled standard polynomials, ordered via PackingOrder::YX.
Definition at line 50 of file PolynomialBasis2d.h.
A Function1d for scaled standard polynomials.
Definition at line 34 of file PolynomialFunction1d.h.
using lsst::geom::polynomials::ScaledPolynomialFunction2d = Function2d<ScaledPolynomialBasis2d<packing>> |
A Function2d for scaled standard polynomials.
Definition at line 36 of file PolynomialFunction2d.h.
using lsst::geom::polynomials::ScaledPolynomialFunction2dXY = ScaledPolynomialFunction2d<PackingOrder::XY> |
A Function2d for scaled standard polynomials, ordered via PackingOrder::XY.
Definition at line 45 of file PolynomialFunction2d.h.
using lsst::geom::polynomials::ScaledPolynomialFunction2dYX = ScaledPolynomialFunction2d<PackingOrder::YX> |
A Function2d for scaled standard polynomials, ordered via PackingOrder::YX.
Definition at line 48 of file PolynomialFunction2d.h.
|
strong |
Enum defining the packing orders used to order 2-d polynomial coefficients.
Definition at line 28 of file PackedIndex.h.
|
strong |
Enum used to control how to sum polynomial terms.
Enumerator | |
---|---|
FAST | Summation using regular floating-point addition. |
SAFE | Compensated summation using SafeSum. Involves ~4x as many floating point operations. |
Function1d< Basis > lsst::geom::polynomials::makeFunction1d | ( | Basis const & | basis, |
Eigen::VectorXd const & | coefficients ) |
Create a Function1d of the appropriate type from a Basis1d and an Eigen object containing coefficients.
Definition at line 144 of file Function1d.h.
Function1d< Basis > lsst::geom::polynomials::makeFunction1d | ( | Basis const & | basis, |
Iterator | first, | ||
Iterator | last ) |
Create a Function1d of the appropriate type from a Basis1d and an iterator range to copy coefficients from.
Definition at line 150 of file Function1d.h.
Function2d< Basis > lsst::geom::polynomials::makeFunction2d | ( | Basis const & | basis, |
Eigen::VectorXd const & | coefficients ) |
Create a Function2d of the appropriate type from a Basis2d and an Eigen object containing coefficients.
Definition at line 155 of file Function2d.h.
Function2d< Basis > lsst::geom::polynomials::makeFunction2d | ( | Basis const & | basis, |
Iterator | first, | ||
Iterator | last ) |
Create a Function2d of the appropriate type from a Basis2d and an iterator range to copy coefficients from.
Definition at line 161 of file Function2d.h.
|
inlinenoexcept |
Return a Scaling1d that maps the interval [min, max] to [-1, 1].
Definition at line 120 of file Scaling1d.h.
|
inline |
Return a Scaling1d that maps the given box to [-1, 1]x[-1, 1].
Definition at line 112 of file Scaling2d.h.
PolynomialFunction1d lsst::geom::polynomials::simplified | ( | ScaledPolynomialFunction1d const & | f | ) |
Calculate the standard polynomial function that is equivalent to a scaled standard polynomial function.
The returned polynomial will course have different coefficients than the input one, as these need to account for the scaling without it being explicitly applied.
Definition at line 32 of file PolynomialFunction1d.cc.
PolynomialFunction2d< packing > lsst::geom::polynomials::simplified | ( | ScaledPolynomialFunction2d< packing > const & | f | ) |
Calculate the standard polynomial function that is equivalent to a scaled standard polynomial function.
The coefficients of the returned polynomial will be different from those of the input in order to fold in the scaling. This is primarily useful in contexts where external code does not support the (more numerically stable) scaled representation, such as the FITS WCS SIP convention.
Definition at line 47 of file PolynomialFunction2d.cc.
template PolynomialFunction2d< PackingOrder::XY > lsst::geom::polynomials::simplified | ( | ScaledPolynomialFunction2d< PackingOrder::XY > const & | ) |
template PolynomialFunction2d< PackingOrder::YX > lsst::geom::polynomials::simplified | ( | ScaledPolynomialFunction2d< PackingOrder::YX > const & | ) |