Further routines |
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,….
Example:In order easily to build monomials we have the following routine which allows to build polynomials like a + b + c+…:
#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(); }
Example:This routine is a special case of the following one: which allows you to generate the polynomial aiex:
... { 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(); } ...
INT m_iindex_iexponent_monom(INT i,ex; OP erg)
INT mult_disjunkt_polynom_polynom(OP a,b,c)
Example: The following example program reads a POLYNOMobject and multiplies it with itself, assumming the two alphabets to be differentThe next routine allows the so-called Pólya-substitution (in two variables):
#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(); }
Example: The following example program computes the Pólya-substitution in a Schur polynomial (see the file ex21.c, a Pólya-substitution into cycle indicator polynomials can be found in ex20.c):There is also a routine that does Pólya-substitution in a prescribable number of indeterminates:
#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(); }
Further routines |