DGtal  1.3.beta
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
 n the number of variables or indeterminates. Ring the type chosen for the polynomial, defines also the type of the coefficents (generally int, float or double). Alloc is an allocator for TRing, for example std::allocator; 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.

## ◆ MPolyN

template<int n, typename Ring , class Alloc >
 typedef MPolynomial 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.

## ◆ 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
 src any 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  }

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