JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::dsp::Polynomial< FloatingType > Class Template Reference

A class representing a polynomial. More...

#include <juce_Polynomial.h>

Collaboration diagram for juce::dsp::Polynomial< FloatingType >:

Public Member Functions

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

Private Attributes

Array< FloatingType > coeffs
 

Detailed Description

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

A class representing a polynomial.

@tags{DSP}

Constructor & Destructor Documentation

◆ Polynomial() [1/5]

template<typename FloatingType >
juce::dsp::Polynomial< FloatingType >::Polynomial ( )
inline

◆ Polynomial() [2/5]

template<typename FloatingType >
juce::dsp::Polynomial< FloatingType >::Polynomial ( const FloatingType *  coefficients,
int  numCoefficients 
)
inline

Creates a new polynomial with given coefficients.

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

References juce::dsp::Polynomial< FloatingType >::coeffs, juce::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)
inline

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 juce::dsp::Polynomial< FloatingType >::coeffs, juce::Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::isEmpty(), and jassert.

Member Function Documentation

◆ getOrder()

template<typename FloatingType >
int juce::dsp::Polynomial< FloatingType >::getOrder ( )
inlinenoexcept

◆ getProductWith()

template<typename FloatingType >
Polynomial<FloatingType> juce::dsp::Polynomial< FloatingType >::getProductWith ( const Polynomial< FloatingType > &  other) const
inline

◆ getSumWith()

template<typename FloatingType >
Polynomial<FloatingType> juce::dsp::Polynomial< FloatingType >::getSumWith ( const Polynomial< FloatingType > &  other) const
inline

◆ operator()()

template<typename FloatingType >
FloatingType juce::dsp::Polynomial< FloatingType >::operator() ( FloatingType  x) const
inlinenoexcept

◆ 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
inlinenoexcept

◆ operator[]() [2/2]

template<typename FloatingType >
FloatingType& juce::dsp::Polynomial< FloatingType >::operator[] ( int  index)
inlinenoexcept

◆ withGain()

template<typename FloatingType >
Polynomial<FloatingType> juce::dsp::Polynomial< FloatingType >::withGain ( double  gain) const
inline

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

References juce::gl::c, and juce::gl::result.

Member Data Documentation

◆ coeffs


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