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 $x$. 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 $x$ 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 $p$. The result is given in $w$. We assume $p[0] != 0$. For this, we consider the equation $f(w)\ =\ P - \frac{1}{w}\ =\ 0$, where $P=p(z)$, $w=w(z)= \frac{1}{p(z)}$ over the ring of formal power series in $z$, and apply Newton's iteration to this equation. So we have : $w_{0}=\frac{1}{p(0)}$, and $w_{j+1}=w_{j}(2-Pw_{j}$ where $j=0,1,\ldots$ By reducing the different polynomials modulo $z^{2^{j+1}}$ at each step, we have two convolutions of two pairs of vectors of dimensions at most $2^{j+1}=$ 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 $p$ which is modified in output, with a new degree of $e-1$.

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 $T$ 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 $p(l \, x)$.

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 $p(x+x_{0})$.

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 $p(x+x_{0})$.

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
logo