JUCE: juce::dsp::Polynomial< FloatingType > Class Template Reference

JUCE

- Main Page
- Related Pages
- Topics
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
Public Member Functions | List of all members
juce::dsp::Polynomial< FloatingType > Class Template Reference
juce_dsp » maths

A class representing a polynomial. More...

`#include <juce_Polynomial.h>`

## Public Member Functions
| Polynomial ()
| Creates a new polynomial which will always evaluate to zero.
| Polynomial (const FloatingType *coefficients, int numCoefficients)
| Creates a new polynomial with given coefficients.
| Polynomial (const Polynomial &)=default
| Creates a copy of another polynomial.
| Polynomial (Polynomial &&)=default
| Creates a copy of another polynomial.
Polynomial & | operator= (const Polynomial &)=default
| Creates a copy of another polynomial.
Polynomial & | operator= (Polynomial &&)=default
| Creates a copy of another polynomial.
template<typename... Values>
| Polynomial (Values... items)
| Creates a new polynomial with coefficients by a C++11 initializer list.
FloatingType | operator[] (int index) const noexcept
| Returns a single coefficient of the receiver for reading.
FloatingType & | operator[] (int index) noexcept
| Returns a single coefficient of the receiver for modifying.
FloatingType | operator() (FloatingType x) const noexcept
| Evaluates the value of the polynomial at a single point x.
int | getOrder () noexcept
| Returns the order of the polynomial.
Polynomial< FloatingType > | withGain (double gain) const
| Returns the polynomial with all its coefficients multiplied with a gain factor.
Polynomial< FloatingType > | getSumWith (const Polynomial< FloatingType > &other) const
| Returns the sum of this polynomial with another.
Polynomial< FloatingType > | getProductWith (const Polynomial< FloatingType > &other) const
| computes the product of two polynomials and return the result

## Detailed Description

template<typename FloatingType>
class juce::dsp::Polynomial< FloatingType >

A class representing a polynomial.

## Constructor & Destructor Documentation

## ◆ Polynomial() [1/5]

template<typename FloatingType >

juce::dsp::Polynomial< FloatingType >::Polynomial | ( |  | ) |

Creates a new polynomial which will always evaluate to zero.

References Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::add().

## ◆ Polynomial() [2/5]

template<typename FloatingType >

juce::dsp::Polynomial< FloatingType >::Polynomial | ( | const FloatingType * | coefficients,
|  | int | numCoefficients )

Creates a new polynomial with given coefficients.

Parameters

  numCoefficients | The number of coefficients stored in coefficients. This is also the order of the returned polynomial.
  coefficients | The coefficients which will be used by the newly created polynomial. The Polynomial class will keep a private copy of the coefficients.

References Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::isEmpty(), and jassert.

## ◆ Polynomial() [3/5]

template<typename FloatingType >

juce::dsp::Polynomial< FloatingType >::Polynomial | ( | const Polynomial< FloatingType > & |  | ) |
| default

Creates a copy of another polynomial.

## ◆ Polynomial() [4/5]

template<typename FloatingType >

juce::dsp::Polynomial< FloatingType >::Polynomial | ( | Polynomial< FloatingType > && |  | ) |
| default

Creates a copy of another polynomial.

## ◆ Polynomial() [5/5]

template<typename FloatingType >
template<typename... Values>

juce::dsp::Polynomial< FloatingType >::Polynomial | ( | Values... | items | ) |

Creates a new polynomial with coefficients by a C++11 initializer list.

This function can be used in the following way: Polynomial<float> p ({0.5f, -0.3f, 0.2f});

References Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::isEmpty(), and jassert.

## Member Function Documentation

## ◆ operator=() [1/2]

template<typename FloatingType >

Polynomial & juce::dsp::Polynomial< FloatingType >::operator= | ( | const Polynomial< FloatingType > & |  | ) |
| default

Creates a copy of another polynomial.

## ◆ operator=() [2/2]

template<typename FloatingType >

Polynomial & juce::dsp::Polynomial< FloatingType >::operator= | ( | Polynomial< FloatingType > && |  | ) |
| default

Creates a copy of another polynomial.

## ◆ operator[]() [1/2]

template<typename FloatingType >

FloatingType juce::dsp::Polynomial< FloatingType >::operator[] | ( | int | index | ) | const
| noexcept

Returns a single coefficient of the receiver for reading.

References Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::getUnchecked().

## ◆ operator[]() [2/2]

template<typename FloatingType >

FloatingType & juce::dsp::Polynomial< FloatingType >::operator[] | ( | int | index | ) |
| noexcept

Returns a single coefficient of the receiver for modifying.

References Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::getReference().

## ◆ operator()()

template<typename FloatingType >

FloatingType juce::dsp::Polynomial< FloatingType >::operator() | ( | FloatingType | x | ) | const
| noexcept

Evaluates the value of the polynomial at a single point x.

References Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::getUnchecked(), Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::size(), x, and y.

## ◆ getOrder()

template<typename FloatingType >

int juce::dsp::Polynomial< FloatingType >::getOrder | ( |  | ) |
| noexcept

Returns the order of the polynomial.

References Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::size().

## ◆ withGain()

template<typename FloatingType >

Polynomial< FloatingType > juce::dsp::Polynomial< FloatingType >::withGain | ( | double | gain | ) | const

Returns the polynomial with all its coefficients multiplied with a gain factor.

## ◆ getSumWith()

template<typename FloatingType >

Polynomial< FloatingType > juce::dsp::Polynomial< FloatingType >::getSumWith | ( | const Polynomial< FloatingType > & | other | ) | const

Returns the sum of this polynomial with another.

References juce::dsp::Polynomial< FloatingType >::getSumWith(), and Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::size().

Referenced by juce::dsp::Polynomial< FloatingType >::getSumWith().

## ◆ getProductWith()

template<typename FloatingType >

Polynomial< FloatingType > juce::dsp::Polynomial< FloatingType >::getProductWith | ( | const Polynomial< FloatingType > & | other | ) | const

computes the product of two polynomials and return the result

References Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::add(), Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::clearQuick(), jmax(), and Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::size().

The documentation for this class was generated from the following file:

- juce_Polynomial.h