37template <
typename FloatingType>
78 template <
typename...
Values>
97 for (
int i = coeffs.
size(); --i >= 0;)
106 return coeffs.
size() - 1;
115 for (
auto&
c : result.coeffs)
125 return other.getSumWith (*
this);
129 for (
int i = 0; i <
other.coeffs.
size(); ++i)
130 result[i] +=
other[i];
145 auto N =
N1 +
N2 - 1;
147 for (
int i = 0; i <
N; ++i)
153 value = value + (*this)[
j] *
other[i -
j];
155 result.coeffs.
add (value);
ElementType getUnchecked(int index) const
bool isEmpty() const noexcept
int size() const noexcept
void add(const ElementType &newElement)
ElementType & getReference(int index) noexcept
Polynomial & operator=(const Polynomial &)=default
Polynomial(Values... items)
FloatingType operator[](int index) const noexcept
Polynomial(const Polynomial &)=default
Polynomial< FloatingType > getSumWith(const Polynomial< FloatingType > &other) const
Polynomial< FloatingType > withGain(double gain) const
Polynomial(const FloatingType *coefficients, int numCoefficients)
Polynomial< FloatingType > getProductWith(const Polynomial< FloatingType > &other) const
Polynomial(Polynomial &&)=default
FloatingType operator()(FloatingType x) const noexcept