Template Class PolynomialFunction1

Inheritance Relationships

Base Type

Class Documentation

template<typename ReturnT>
class PolynomialFunction1 : public lsst::afw::math::Function1<ReturnT>

1-dimensional polynomial function.

f(x) = c0 + c1 x + c2 x^2 + … cn-1 x^(n-1)

Public Functions

PolynomialFunction1(unsigned int order)

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

Construct a polynomial function of the specified order.

The parameters are initialized to zero.

PolynomialFunction1(std::vector<double> params)

Parameters
  • params: polynomial coefficients (const, x, x^2…)

Construct a polynomial function with the specified parameters.

The order of the polynomial is set to the length of the params vector.

Exceptions
  • lsst::pex::exceptions::InvalidParameter: if params is empty

PolynomialFunction1(PolynomialFunction1 const&)
PolynomialFunction1(PolynomialFunction1&&)
PolynomialFunction1 &operator=(PolynomialFunction1 const&)
PolynomialFunction1 &operator=(PolynomialFunction1&&)
~PolynomialFunction1()
std::shared_ptr<Function1<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 concrete subclass must override this method.

Return

a pointer to a deep copy of the function

bool isLinearCombination() const

Is the function a linear combination of its parameters?

Return

true if the function can be expressed as: sum over i of parameter_i * function_i(args)

Warning

: subclasses must override if true.

ReturnT operator()(double x) const
unsigned int getOrder() const

Get the polynomial order

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

Return a string representation of the function

Return

a string representation of the function

Protected Functions

PolynomialFunction1()