30 namespace lsst {
namespace geom {
namespace polynomials {
35 Eigen::VectorXd r(n + 1);
37 for (
int i = 1; i <= n; ++i) {
46 template <PackingOrder packing>
51 auto rPow = computePowers(
basis.getScaling().getX().getScale(), n);
52 auto sPow = computePowers(
basis.getScaling().getY().getScale(), n);
53 auto uPow = computePowers(
basis.getScaling().getX().getShift(), n);
54 auto vPow = computePowers(
basis.getScaling().getY().getShift(), n);
56 for (
auto const & i :
basis.getIndices()) {
58 double tmp = binomial(i.nx, j)*uPow[j] *
59 f[i.flat]*rPow[i.nx]*sPow[i.ny];
61 sums[
basis.index(i.nx - j, i.ny - k)] +=
62 binomial(i.ny, k)*vPow[k]*tmp;
66 Eigen::VectorXd
result = Eigen::VectorXd::Zero(
basis.size());
68 result[i] =
static_cast<double>(sums[i]);
A 2-d function defined by a series expansion and its coefficients.
PolynomialFunction1d simplified(ScaledPolynomialFunction1d const &f)
Calculate the standard polynomial function that is equivalent to a scaled standard polynomial functio...
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...
A base class for image defects.
A class that computes binomial coefficients up to a certain power.
table::Key< table::Array< double > > basis
Basis const & getBasis() const
Return the associated Basis2d object.
void computePowers(Eigen::VectorXd &r, double x)
Fill an array with integer powers of x, so .