34template <
typename FloatingType>
75 template <
typename...
Values>
94 for (
int i = coeffs.
size(); --i >= 0;)
103 return coeffs.
size() - 1;
112 for (
auto& c : result.coeffs)
121 if (coeffs.
size() < other.coeffs.size())
122 return other.getSumWith (*
this);
126 for (
int i = 0; i < other.coeffs.size(); ++i)
127 result[i] += other[i];
136 result.coeffs.clearQuick();
139 auto N2 = other.coeffs.size();
142 auto N =
N1 +
N2 - 1;
144 for (
int i = 0; i <
N; ++i)
150 value = value + (*this)[
j] * other[i -
j];
152 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