DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions
DGtal::MPolynomialDerivativeComputer< 0, n, Ring, Alloc > Class Template Reference

#include <DGtal/math/MPolynomial.h>

Public Types

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

Static Public Member Functions

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

Detailed Description

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

Utility class for computing the derivative of a given polynomial with respect to the first indeterminate. The coefficients of the first indeterminate are left untouched.

Specialization of MPolynomialDerivativeComputer to the first indeterminate.

Template Parameters
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 TRing, for example std::allocator<TRing>; 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 1842 of file MPolynomial.h.

Member Typedef Documentation

◆ MPolyN

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

Type for polynomial with n variable in the ring Ring.

Definition at line 1846 of file MPolynomial.h.

Member Function Documentation

◆ computeDerivative()

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

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

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

Definition at line 1856 of file MPolynomial.h.

1857 {
1858 dest.myValue.resize(src.degree() >= 0 ? src.degree() : 0);
1859 for ( int i = 1; i <= src.degree(); ++i )
1860 dest[i - 1] = src[i] * (Ring)i;
1861 dest.normalize();
1862 }

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


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