DGtal 2.0.0
Loading...
Searching...
No Matches
DGtal::MPolynomialDerivativeComputer< N, n, Ring, Alloc > Class Template Reference

#include <DGtal/math/MPolynomial.h>

Inheritance diagram for DGtal::MPolynomialDerivativeComputer< N, n, Ring, Alloc >:
[legend]

Public Types

typedef MPolynomial< n, Ring, Alloc > MPolyN
 Type for polynomial with n variable in the ring Ring.

Static Public Member Functions

static void computeDerivative (const MPolyN &src, MPolyN &dest)

Detailed Description

template<int N, int n, typename Ring, typename Alloc>
class DGtal::MPolynomialDerivativeComputer< N, n, Ring, Alloc >

Utility class for computing the derivative of a given polynomial with respect to the N-th indeterminate, N > 0. Uses MPolynomialDerivativeComputer<N-1, n-1, T, Alloc> to partially derive the coefficients of the first indeterminate.

Template Parameters
Nthe variable used for derivation.
nthe number of variables or indeterminates.
Ringthe type chosen for the polynomial, defines also the type of the coefficents (generally int, float or double).
Allocis an allocator for Ring, for example std::allocator<Ring>; this is also the default parameter. Usually this parameter does not needs to be changed.

This class is a backport from Spielwiese.

Definition at line 1902 of file MPolynomial.h.

Member Typedef Documentation

◆ MPolyN

template<int N, int n, typename Ring, typename Alloc>
typedef MPolynomial<n, Ring, Alloc> DGtal::MPolynomialDerivativeComputer< N, n, Ring, Alloc >::MPolyN

Type for polynomial with n variable in the ring Ring.

Definition at line 1906 of file MPolynomial.h.

Member Function Documentation

◆ computeDerivative()

template<int N, int n, typename Ring, typename Alloc>
void DGtal::MPolynomialDerivativeComputer< N, n, Ring, Alloc >::computeDerivative ( const MPolyN & src,
MPolyN & dest )
inlinestatic

Computes the derivative of src with respect to X_N and puts it in dest.

Parameters
srcany polynomial
dest(returns) the polynomial d/dX_N(src).

Definition at line 1916 of file MPolynomial.h.

1917 {
1918 dest.myValue.resize(src.degree() + 1);
1919 for ( int i = 0; i <= src.degree(); ++i )
1922 dest.normalize();
1923 }

References computeDerivative(), DGtal::MPolynomial< n, TRing, TAlloc >::degree(), DGtal::MPolynomial< n, TRing, TAlloc >::myValue, DGtal::MPolynomial< n, TRing, TAlloc >::normalize(), and DGtal::IVector< T, TAlloc, usePointers >::resize().

Referenced by computeDerivative(), and DGtal::derivative().


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