PolynomialTraits_d::Degree

Definition

This AdaptableUnaryFunction computes the degree of a PolynomialTraits_d::Polynomial_d with respect to a certain variable.

The degree of p with respect to a certain variable xi, is the highest power e of xi such that the coefficient of xie in p is not zero.
For instance the degree of p = x02x13+x14 with respect to x1 is 4.

The degree of the zero polynomial is set to 0. From the mathematical point of view this should be -infinity, but this would imply an inconvenient return type.

Refines

AdaptableUnaryFunction

Types

typedef int result_type;
typedef PolynomialTraits_d::Polynomial_d
argument_type;

Operations

result_type fo ( argument_type p ) Computes the degree of p with respect to the outermost variable xd-1.

result_type fo ( argument_type p , int i ) Computes the degree of p with respect to variable xi.
Precondition: 0 i < d

See Also

Polynomial_d
PolynomialTraits_d
PolynomialTraits_d::TotalDegree
PolynomialTraits_d::DegreeVector