# UPOLDAR Namespace Reference

## Detailed Description

Module for Univariate POLynomials with a Direct Access Representation.

It contains generic implementations on univariate (dense) polynomials. This set of functions apply when R provides the following methods or definitions:

  typename R::value_type;
typename R::size_type;
typename R::iterator;
typename R::reverse_iterator;

iterator_t R::begin();
iterator_t R::end();
value_type R::operator[](int);


## Functions

template<class OSTREAM, class POL>
OSTREAM & lisp (OSTREAM &os, const POL &P)
template<class C, class O, class R>
std::ostream & print_as_coeff (std::ostream &os, const MPol< C, O, R > &p)
template<class R>
int degree (const R &p)
template<class R>
R::value_type lcoeff (const R &p)
template<class R>
R::value_type tcoeff (const R &p)
template<class C>
std::ostream & print_as_coeff (std::ostream &os, const C &c)
template<class R>
std::ostream & print (std::ostream &os, const R &p, char *x="x")
template<class R, class C>
void set_monomial (R &x, const C &c, unsigned n)
template<class R, class S>
void add_cst (R &r, const R &a, const S &c)
template<class R, class S>
void add_cst (R &r, const S &c)
template<class R, class A, class B>
void mul_index (R &r, const A &a, const B &b)
template<class R>
void mul_index_it (R &r, const R &a, const R &b)
template<class R>
void mul (R &r, const R &a, const R &b)
template<class R>
void mul (R &a, const R &b)
template<class R>
void mul_index (R &a, const R &b)
template<class R>
void mul_karatsuba (R &r, const R &a, const R &b)
template<class C, class R>
eval_horner (const R &p, const C &c)
template<class C, class R>
eval_horner_idx (const R &p, const C &c)
template<typename POL, typename X>
int sign_at (const POL &p, const X &x)
template<class C, class R>
eval (const R &p, const C &c)
template<class R>
void div_rem (R &q, R &a, const R &b)
template<class R>
void checkdegree (R &p)
template<class R>
void diff (R &r, const R &p)
template<class R>
diff (const R &p)
Returns the derivative of the polynomial p.
template<class R>
void reciprocal (R &w, const R &p)
template<class R>
void reverse (R &p, typename R::size_type n)
template<class R>
R::value_type derive (const R p, typename R::value_type x)
template<class R>
void reduce (R &p, const typename R::size_type &e)
template<class R>
void shift (R &t, const typename R::value_type &x0)
template<class R>
void shift (R &t, const R &p, const typename R::value_type &x0)
template<class R, class C>
void scale (R &t, const R &p, const C &l)
template<class T>
void reduce (T &p, const typename T::size_type &e)
template<class T>
void reverse (T &p, int n)
template<class O, class R, class I>
void eval (O &p, O &dp, const R &Pol, const I &x)
template<class R>
R::value_type derive (const R &Pol, const typename R::value_type &x)
template<class R>
void coeff_modulo (R &r, const typename R::value_type &x)

## Function Documentation

template<class R>
 R::value_type UPOLDAR::derive ( const R & Pol, const typename R::value_type & x )

Return an evaluation of the derivation of an univariate polynomial for the value . Example:

    UPolDse<R> p(...);
UPolDse<R>::value_type x,d;
d=UPOLDAR::derive(p,x);


Definition at line 469 of file UPOLDAR.m.

References eval().

template<class R>
 R UPOLDAR::diff ( const R & p )

Returns the derivative of the polynomial p.

The derivative of the polynomial p is put in r.

Definition at line 344 of file UPOLDAR.m.

References diff().

template<class R>
 void UPOLDAR::diff ( R & r, const R & p )

The derivative of the polynomial p is put in r. r should be allocated with the correct size.

Definition at line 322 of file UPOLDAR.m.

References degree().

Referenced by diff().

template<class O, class R, class I>
 void UPOLDAR::eval ( O & p, O & dp, const R & Pol, const I & x )

Return an evaluation of the polynomial and its derivative at Example:

    UPolDse<R> p(...);
UPolDse<R>::value_type x,vp,vd;
d=UPOLDAR::eval(vp,vd,p,x);


Definition at line 452 of file UPOLDAR.m.

template<class R>
 R::value_type UPOLDAR::lcoeff ( const R & p )

Returns the leading coefficient of the polynomial p.

Definition at line 63 of file UPOLDAR.m.

Referenced by bound(), CoeffStHa(), and Solve_with_subres().

template<class R>
 void UPOLDAR::reciprocal ( R & w, const R & p )

Compute the reciprocal of the univariate polynomial . The result is given in . We assume . For this, we consider the equation , where , over the ring of formal power series in , and apply Newton's iteration to this equation. So we have : , and where By reducing the different polynomials modulo at each step, we have two convolutions of two pairs of vectors of dimensions at most by step.

Definition at line 374 of file UPOLDAR.m.

References degree().

template<class T>
 void UPOLDAR::reduce ( T & p, const typename T::size_type & e )

Truncate an univariate polynomial which is modified in output, with a new degree of .

Definition at line 410 of file UPOLDAR.m.

template<class T>
 void UPOLDAR::reverse ( T & p, int n )

Reverse the coefficients of an univariate polynomial, it is performed in place. For a call of this function, the list of arguments must specify, in last, an instance of UPOLDAR, the generic type is assumed to be a valid class of univariate polynomial. Example of such a call:

   UPolDse<...> p(...);
UPOLDAR::reverse(p,i);


Definition at line 430 of file UPOLDAR.m.

template<class R, class C>
 void UPOLDAR::scale ( R & r, const R & p, const C & l )

Scale the variable in the polynomial p by l and put the result r. It computes the coefficients of the polynomial .

Definition at line 526 of file UPOLDAR.m.

template<class R>
 void UPOLDAR::shift ( R & r, const R & p, const typename R::value_type & x0 )

Shift the polynomial p at the point x0 and put the result in r. In other words, it computes the coefficients of the polynomial .

Definition at line 504 of file UPOLDAR.m.

References shift().

template<class R>
 void UPOLDAR::shift ( R & p, const typename R::value_type & c )

Inplace shift of the polynomial r at the point x0. It computes the coefficients of the polynomial .

Definition at line 492 of file UPOLDAR.m.

Referenced by Exclusion::operator()(), and shift().

template<class R>
 R::value_type UPOLDAR::tcoeff ( const R & p )

Return the tail coefficient of the polynomial p.

Definition at line 72 of file UPOLDAR.m.

SYNAPS DOCUMENTATION