Further routines |

- NAME:
*init_polynom* - SYNOPSIS:
*INT init_polynom(OP result)* - DESCRIPTION: the result becomes a POLYNOMobject, which is a LISTobject, with NULL as next and NULL as self

produces an error, because the self part is not yet initialised.main() { OP c; anfang(); c =callocobject(); init(POLYNOM,c); println(s_po_s(c)); freeall(c); ende(); }

If you want to get a TeX-readable output of a polynom, then
the standard routine
*tex()* calls the special routine *tex_polynom()* which numbers
the variables of the POLYNOMobject by *a,b,c,....*

- NAME:
*tex_polynom* - SYNOPSIS:
*INT tex_polynom(OP a)* - DESCRIPTION: Provides a TeX-readable output of the POLYNOMobject,
if the
coefficient is not unity it calls
*tex()*for the coefficient, then it prints the variables named*a,b,c,...*In general you should use the standard routine*tex,*and*not*the special routine*tex_polynom.*

- NAME:
*degree_polynom* - SYNOPSIS:
*INT degree_polynom(OP a,b)*

- NAME:
*eval_polynom* - SYNOPSIS:
*INT eval_polynom(OP a,b,c)* - DESCRIPTION: you enter a POLYNOMobject
*a,*and a VECTORobject*b,*where the*i*th entry of the VECTORobject*b*gives the value for the specialization of the*i*th variable. If the*i*th entry is an empty object, you don't specialize the*i*th variable. The output will be in*c.*

- NAME:
*gauss_polynom* - SYNOPSIS:
*INT gauss_polynom(a,b,c)* - DESCRIPTION:

- NAME:
*lagrange_polynom* - SYNOPSIS:
*INT lagrange_polynom(OP a,b,c)* - DESCRIPTION: This routine computes the Lagrange polynomial which
interpolates at the points in the VECTORobject
*a*(which must be pairwise different), with the values in the VECTOR object*b,*which must be of the same length as*a.*The result is a POLYNOMobject*c*in one variable.

In order easily to build monomials we have the following routine which allows to build polynomials likeExample:#include "def.h" #include "macro.h" main() { OP a,b,c; anfang(); a=callocobject(); b=callocobject(); c=callocobject(); m_il_v(2L,a); m_i_i(1L, s_v_i(a,0L)); m_i_i(7L, s_v_i(a,1L)); m_il_v(2L,b); m_i_i(5L, s_v_i(b,0L)); m_i_i(7L, s_v_i(b,1L)); lagrange_polynom(a,b,c);println(c); freeall(a); freeall(b); freeall(c); ende(); }

- NAME:
*m_iindex_monom* - SYNOPSIS:
*INT m_iindex_monom(INT i; OP erg)* - DESCRIPTION: It builds a POLYNOMobject consisting of a single monomial
which is the
*i*th variable. At first it frees the result to an empty object. There is a check whether*i³0.* - RETURN: ERROR if an error occurs, OK else.

This routine is a special case of the following one: which allows you to generate the polynomialExample:... { OP a,b; INT i; anfang(); a=callocobject(); b=callocobject(); for (i=0L; i<= 10L; i++) { m_iindex_monom(i,b); add(b,a,a); mult(a,a,b); println(b); } freeall(a); freeall(b); ende(); } ...

- NAME:
*m_iindex_iexponent_monom* - SYNOPSIS:
*INT m_iindex_iexponent_monom(INT i,ex; OP erg)* - DESCRIPTION: builds a POLYNOMobject consisting of a single monomial
which is the
*i*th variable, and the exponent of this variable is given by*ex.*First it frees the result to an empty object. There is a check whether*i³0.* - RETURN: ERROR if an error occurs, OK else.

- NAME:
*m_scalar_polynom* - SYNOPSIS:
*INT m_scalar_polynom(OP a,b)* - DESCRIPTION:
*a*is a scalar object,*b*becomes the result, again a POLYNOMobject.*a*becomes the coefficent of the POLYNOMobject with one single monomial, namely the monomial*[0],*i.e. a single variable, whose exponent is zero.

- NAME:
*mult_disjunkt_polynom_polynom* - SYNOPSIS:
*INT mult_disjunkt_polynom_polynom(OP a,b,c)* - DESCRIPTION:
*a*and*b*are POLYNOMobjects and*c*becomes the result of the multiplication of*a*and*b,*where the alphabets of the two POLYNOMobjects are taken different

The next routine allows the so-calledExample:The following example program reads a POLYNOMobject and multiplies it with itself, assumming the two alphabets to be different#include "def.h" #include "macro.h" main() { OP b,d; anfang(); b=callocobject(); d=callocobject(); scan(POLYNOM,b); mult_disjunkt_polynom_polynom(b,b,d); println(d); freeall(b); freeall(d); ende(); }

- NAME:
*polya_sub* - SYNOPSIS:
*INT polya_sub(OP a,b,c)* - DESCRIPTION:
*a*is a POLYNOMobject,*b*becomes the result, again a POLYNOMobject,*c*is an INTEGERobject, which gives the number of different variables in*a.*There is the substitution:*x*is replaced by_{i}*1 + q*and so the result is a POLYNOMobject in one variable.^{i},

There is also a routine that does Pólya-substitution in a prescribable number of indeterminates:Example:The following example program computes the Pólya-substitution in a Schur polynomial (see the fileex21.c,a Pólya-substitution into cycle indicator polynomials can be found inex20.c):#include "def.h" #include "macro.h" main() { OP a,b,c,d; anfang(); a=callocobject(); b=callocobject(); c=callocobject(); d=callocobject(); scan(PARTITION,a);println(a); scan(INTEGER,b);println(b); compute_schur_with_alphabet(a,b,c);println(c); polya_sub(c,b,d); println(d); freeall(a); freeall(b); freeall(c); freeall(d); ende(); }

- NAME:
*polya_n_sub* - SYNOPSIS:
*INT polya_n_sub(OP pol,n,res)* - DESCRIPTION:
*pol*is a POLYNOMobject,*res*becomes the result, again a POLYNOMobject,*n*is an INTEGERobject, which gives the number of different indeterminates for the substitution into*pol.*Here is the substitution:*x*is replaced by the polynomial_{i}*a*and so the result is a POLYNOMobject in the^{i}+b^{i}+...,*n*indeterminates*a,b,....*

- NAME:
*test_poly* - SYNOPSIS:
*INT test_poly()* - DESCRIPTION:

- NAME:
*unimodalp* - SYNOPSIS:
*INT unimodalp(OP a)* - DESCRIPTION: tests unimodality of a POLYNOMobject
- RETURN: TRUE or FALSE

harald.fripertinger@kfunigraz.ac.at,

last changed: November 19, 2001

Further routines |