Template Class PolynomialFunction2

Inheritance Relationships

Base Type

Class Documentation

template<typename ReturnT>
class PolynomialFunction2 : public lsst::afw::math::BasePolynomialFunction2<ReturnT>

2-dimensional polynomial function with cross terms

f(x,y) = c0 (0th order)

  • c1 x + c2 y (1st order)

  • c3 x^2 + c4 x y + c5 y^2 (2nd order)

  • c6 x^3 + c7 x^2 y + c8 x y^2 + c9 y^3 (3rd order)

Intermediate products for the most recent y are cached, so when computing for a set of x, y it is more efficient to change x before you change y.

Public Functions

PolynomialFunction2(unsigned int order)

Parameters
  • order: order of polynomial (0 for constant)

Construct a polynomial function of specified order.

The polynomial will have (order + 1) * (order + 2) / 2 coefficients

The parameters are initialized to zero.

PolynomialFunction2(std::vector<double> params)

Parameters
  • params: polynomial coefficients (const, x, y, x^2, xy, y^2…); length must be one of 1, 3, 6, 10, 15…

Construct a polynomial function with specified parameters.

The order of the polynomial is determined from the length of the params vector: order = (sqrt(1 + 8 * length) - 3) / 2 and if this is not an integer then the length is unsuitable

Exceptions

PolynomialFunction2(PolynomialFunction2 const&)
PolynomialFunction2(PolynomialFunction2&&)
PolynomialFunction2 &operator=(PolynomialFunction2 const&)
PolynomialFunction2 &operator=(PolynomialFunction2&&)
~PolynomialFunction2()
std::shared_ptr<Function2<ReturnT>> clone() const

Return a pointer to a deep copy of this function

This function exists instead of a copy constructor so one can obtain a copy of an actual function instead of a useless copy of the base class.

Every non-virtual function must override this method.

Return

a pointer to a deep copy of the function

ReturnT operator()(double x, double y) const
std::vector<double> getDFuncDParameters(double x, double y) const

Return the coefficients of the Function’s parameters, evaluated at (x, y) I.e. given c0, c1, c2, c3 … return 1, x, y, x^2 …

std::string toString(std::string const&) const

Return a string representation of the function

Return

a string representation of the function

bool isPersistable() const

Return true if this particular object can be persisted using afw::table::io.

Protected Functions

std::string getPersistenceName() const

Return the unique name used to persist this object and look up its factory.

Must be less than ArchiveIndexSchema::MAX_NAME_LENGTH characters.

void write(afw::table::io::OutputArchiveHandle &handle) const

Write the object to one or more catalogs.

The handle object passed to this function provides an interface for adding new catalogs and adding nested objects to the same archive (while checking for duplicates). See OutputArchiveHandle for more information.

PolynomialFunction2()