Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

Polynomial< K > Class Template Reference

#include <polynomials.H>

List of all members.


Detailed Description

template<class K>
class Polynomial< K >

Polynomial class.

these are polynomials on a countable set of variables, indexed by "long" indices. A polynomial is basically a map which assigns to a PowProd class a scalar K. K is assumed to be a ring with 1, ie is has +=, *=, and x==1 (and so on).

Definition at line 42 of file polynomials.H.

Public Member Functions

 Polynomial (const Polynomial< K > &that)
 Polynomial (const PowProd &pow)
 turns a powerproduct into a polynomial with coefficient 1
bool is_zero () const
 checks if the polynomial is zero
void sets_to_zero ()
 sets the polynomial to 0
bool involves_variable (long i) const
 checks if a variable shows up
long nvars () const
 returns the highest index of a variable showing up
long has_lonely_variable (Polynomial< K > &replacement)
 looks for a relation
long has_unitary_variable (Polynomial< K > &replacement)
 looks for a relation
coeff_of (const PowProd &pow) const
 returns a coefficient
PowProd lp () const
 leading power product
Polynomial< K > lt () const
 leading term
lc () const
 leading coefficient
void add_term (const PowProd &pow, const K &c)
 adds a power product to a polynomial. Mostly used internally
Polynomial< K > & operator+= (const Polynomial< K > &that)
Polynomial< K > operator+ (const Polynomial< K > &that) const
Polynomial< K > & operator *= (const K &c)
 multiplies by a constant
Polynomial< K > operator * (const Polynomial< K > &that) const
Polynomial< K > & operator *= (const Polynomial< K > &that)
Polynomial< K > operator * (const K &c) const
void swap_variables (long i, long j)
 exchanges variables i and j
void shift_variables (long n)
 shifts the variables (ie, add n to the variable indices)
void substitute_variable (long i, const Polynomial< K > &f)
evaluate (const map< long, K > &augmentation) const
 evaluates at scalar values

Static Public Member Functions

void set_order_override (int theorder)
void default_order ()
int get_order_override ()
void set_variable_priority (long thepriority)
void no_variable_priority ()
long get_variable_priority ()

Public Attributes

Alphabetalphabet
 this points to an alphabet, and will be used when printing (only).
map< PowProd, K > coeffs
 a polynomial associates an element in K to a power product: simple!

Static Private Attributes

int order_override = 0
 override mechanism
long variable_priority = 0

Friends

void polyprod (const Polynomial< K > &P, const Polynomial< K > &Q, Polynomial< K > &R)
ostream & operator<< (ostream &os, const Polynomial< K > &P)
 prints a polynomial
ofstream & operator<< (ofstream &file, Polynomial< K > &P)
 write to file
void operator>> (ifstream &file, Polynomial< K > &P)
 read from file
Polynomial< K > S_polynomial (const Polynomial< K > &f, const Polynomial< K > &g)
 computes the S polynomial in the sense of Buchberger. f and g MUST be nonzero.
Polynomial< K > S_polynomial_with_coefficients (const Polynomial< K > &f, const Polynomial< K > &g, pair< Polynomial< K >, Polynomial< K > > &coeffs)


Constructor & Destructor Documentation

template<class K>
Polynomial< K >::Polynomial const PowProd pow  )  [inline]
 

turns a powerproduct into a polynomial with coefficient 1


Member Function Documentation

template<class K>
void Polynomial< K >::add_term const PowProd pow,
const K &  c
[inline]
 

adds a power product to a polynomial. Mostly used internally

Definition at line 303 of file polynomials.H.

Referenced by Exponentiator< F_2 >::clean_up_equations(), Polynomial< F_2 >::has_lonely_variable(), Polynomial< F_2 >::has_unitary_variable(), AffineHomomorphism< F_2 >::read_from_GAP_file(), Polynomial< F_2 >::shift_variables(), Polynomial< F_2 >::swap_variables(), AffineAlgebra< F_2 >::top_variable_redundant(), and AffineAlgebra< F_2 >::variable_redundant().

template<class K>
K Polynomial< K >::coeff_of const PowProd pow  )  const [inline]
 

returns a coefficient

normally if P is a polynomial, you check or change its coefficients with P.coeffs[ pow ]. however when P is const, we need to provide the following so the compiler knows we will not change anything.

Definition at line 213 of file polynomials.H.

Referenced by Exponentiator< F_2 >::compute_lambda_relation(), and Exponentiator< F_2 >::compute_tensor_relation().

template<class K>
K Polynomial< K >::evaluate const map< long, K > &  augmentation  )  const [inline]
 

evaluates at scalar values

Definition at line 461 of file polynomials.H.

Referenced by Exponentiator< F_2 >::clean_up_equations().

template<class K>
long Polynomial< K >::has_lonely_variable Polynomial< K > &  replacement  )  [inline]
 

looks for a relation

returns a variable number iff the polynomial has a term of degree 1, ie a single variable, say x, such that x does not appear in the other terms. The polynomial is thus 0 iff we have x = P(other variables), that is, x may be replaced by other variables modulo the polynomial. The polynomial P is computed and written to "replacement". K must be a field. otherwise, returns 0.

Definition at line 150 of file polynomials.H.

template<class K>
long Polynomial< K >::has_unitary_variable Polynomial< K > &  replacement  )  [inline]
 

looks for a relation

returns a variable number iff the polynomial has a term of degree 1, and coefficient 1 or -1, ie a single variable, say x, such that x does not appear in the other terms. (remark: The polynomial is thus 0 iff we have x = P(other variables), that is, x may be replaced by other variables modulo the polynomial.) The polynomial P is computed and written to "replacement". otherwise, returns 0.

Definition at line 181 of file polynomials.H.

template<class K>
bool Polynomial< K >::involves_variable long  i  )  const [inline]
 

checks if a variable shows up

Definition at line 117 of file polynomials.H.

Referenced by Polynomial< F_2 >::has_lonely_variable(), Polynomial< F_2 >::has_unitary_variable(), AbstractHomomorphism< F_2 >::of(), and HomFinder::weight().

template<class K>
bool Polynomial< K >::is_zero  )  const [inline]
 

checks if the polynomial is zero

Definition at line 103 of file polynomials.H.

Referenced by AffineAlgebra< F_2 >::add_relation(), HomFinder::branch(), Exponentiator< F_2 >::compute_lambda_relation(), Exponentiator< F_2 >::compute_tensor_relation(), DerivationAnalyzer::constant_subalgebra(), HomFinder::extend(), HomFinder::extend_all(), AffineAlgebra< F_2 >::find_redundancies(), AffineAlgebra< F_2 >::find_unitary_redundancies(), Ideal< F_2 >::grobnerize(), Ideal< F_2 >::grobnerize_with_coefficients(), AffineAlgebra< F_2 >::is_polynomial_variable(), UnstableAlgebra::is_saturated(), GradedAlgebra< F_2 >::list_monomials(), MilnorAnalyzer::re_setup(), HomFinder::restrict_to_elemab(), UnstableAlgebra::saturate_and_reduce(), MilnorAnalyzer::setup_for_Sq1(), GradedAlgebra< F_2 >::split_and_sort_relations(), UnstableAlgebra::Sq(), HomFinder::test_steenrod(), and SW_Maker::translate_homomorphism().

template<class K>
K Polynomial< K >::lc  )  const [inline]
 

leading coefficient

Definition at line 292 of file polynomials.H.

template<class K>
PowProd Polynomial< K >::lp  )  const [inline]
 

leading power product

Polynomials rely on the order specified by PowProd::order to sort out internally their power products. So if the leading powprod is is needed, it is simply the last one in the list.

However, if PowProd::order is changed while the program is running, only the polynomials created after the change will work correctly. So changing PowProd::order is not the right thing to do if you need the leading pow prod of a polynomial with respect to an order which is not the current PowProd::order.

Instead, we provide the 'override' mechanism. When Polynomial<K>::override is set to 0 (default), PowProd::order is used (pretty efficient). When Polynomial<K>::order specifies something nonzero, we take it as an order and look for the lp with respect to that (sgnificantly less efficient). Note: you can also specify a variable priority in Polynomial<K>::variable_priority, some orders need this information (eg LEXSV). Generally it means that the variable whose index is variable_priority is greater than all the others (elimination order).

Definition at line 249 of file polynomials.H.

Referenced by Exponentiator< F_2 >::compute_lambda_relation(), Exponentiator< F_2 >::compute_tensor_relation(), Ideal< F_2 >::grobnerize(), GradedAlgebra< F_2 >::hom_degree_of(), AffineAlgebra< F_2 >::is_polynomial_variable(), GradedAlgebra< F_2 >::list_monomials(), and UnstableAlgebra::Sq().

template<class K>
Polynomial<K> Polynomial< K >::lt  )  const [inline]
 

leading term

Definition at line 280 of file polynomials.H.

Referenced by UnstableAlgebra::Sq().

template<class K>
long Polynomial< K >::nvars  )  const [inline]
 

returns the highest index of a variable showing up

Definition at line 128 of file polynomials.H.

Referenced by Polynomial< F_2 >::has_unitary_variable(), AbstractHomomorphism< F_2 >::of(), and AbstractHomomorphism< F_2 >::set_image().

template<class K>
Polynomial<K>& Polynomial< K >::operator *= const K &  c  )  [inline]
 

multiplies by a constant

Definition at line 334 of file polynomials.H.

template<class K>
void Polynomial< K >::sets_to_zero  )  [inline]
 

sets the polynomial to 0

Definition at line 110 of file polynomials.H.

Referenced by HomFinder::branch(), Exponentiator< F_2 >::clean_up_equations(), Exponentiator< F_2 >::compute_lambda_relation(), Exponentiator< F_2 >::compute_tensor_relation(), DerivationAnalyzer::constant_subalgebra(), SW_Maker::create_regular_variables(), Chern_Maker::create_regular_variables(), HomFinder::define_polynomial_variables(), HomFinder::define_polynomial_variables_brutally(), AffineHomomorphism< F_2 >::fill_zeroes(), Ideal< F_2 >::grobnerize(), Ideal< F_2 >::grobnerize_with_coefficients(), AbstractHomomorphism< F_2 >::of(), multiPolynomial< F_2 >::operator/(), HomFinder::polynomial_test(), RepresentationRing::read_from_GAP_file(), AffineHomomorphism< F_2 >::read_from_GAP_file(), HomFinder::set_hom_from_matrix(), HomFinder::sort(), and UnstableAlgebra::Sq().

template<class K>
void Polynomial< K >::shift_variables long  n  )  [inline]
 

shifts the variables (ie, add n to the variable indices)

Definition at line 407 of file polynomials.H.

Referenced by AffineHomomorphism< F_2 >::compute_kernel(), AbstractHomomorphism< F_2 >::of(), AffineHomomorphism< F_2 >::populate_associated_algebra(), and AffineAlgebra< F_2 >::tensor_with().

template<class K>
void Polynomial< K >::swap_variables long  i,
long  j
[inline]
 

exchanges variables i and j

Definition at line 392 of file polynomials.H.

Referenced by AffineAlgebra< F_2 >::find_redundancies(), AffineAlgebra< F_2 >::find_unitary_redundancies(), UnstableAlgebra::saturate_and_reduce(), and AffineAlgebra< F_2 >::swap_variables_order().


Friends And Related Function Documentation

template<class K>
ofstream& operator<< ofstream &  file,
Polynomial< K > &  P
[friend]
 

write to file

Definition at line 544 of file polynomials.H.

template<class K>
ostream& operator<< ostream &  os,
const Polynomial< K > &  P
[friend]
 

prints a polynomial

Mechanism is: we change the static PowProd::default_alphabet and replace it with P.alphabet. Then we rely on the class PowProd, or rather its friend <<, to print. Then we set the default alphabet back to its previous value, usually the default one.

Definition at line 515 of file polynomials.H.

template<class K>
void operator>> ifstream &  file,
Polynomial< K > &  P
[friend]
 

read from file

Definition at line 563 of file polynomials.H.

template<class K>
Polynomial<K> S_polynomial const Polynomial< K > &  f,
const Polynomial< K > &  g
[friend]
 

computes the S polynomial in the sense of Buchberger. f and g MUST be nonzero.

Definition at line 587 of file polynomials.H.

template<class K>
Polynomial<K> S_polynomial_with_coefficients const Polynomial< K > &  f,
const Polynomial< K > &  g,
pair< Polynomial< K >, Polynomial< K > > &  coeffs
[friend]
 

Given f and g, this computes S= af + bg and writes a and b in coeffs. Here a=lcm( lp(f), lp(g) )/lt(f) and b= - lcm( lp(f), lp(g) )/lt(g) (note the - sign).

Definition at line 616 of file polynomials.H.


Member Data Documentation

template<class K>
Alphabet* Polynomial< K >::alphabet
 

this points to an alphabet, and will be used when printing (only).

Definition at line 53 of file polynomials.H.

Referenced by SW_Maker::add_complex_relations(), Exponentiator< F_2 >::clean_up_equations(), AffineHomomorphism< F_2 >::compute_kernel(), DerivationAnalyzer::constant_subalgebra(), SW_Maker::create_regular_variables(), Chern_Maker::create_regular_variables(), multiIdeal< K >::grobnerize_with_coefficients(), Ideal< F_2 >::grobnerize_with_coefficients(), GradedAlgebra< F_2 >::list_monomials(), Polynomial< F_2 >::lt(), AffineAlgebra< F_2 >::new_variable(), AbstractHomomorphism< F_2 >::of(), AffineAlgebra< F_2 >::one(), multiPolynomial< F_2 >::operator/(), AffineHomomorphism< F_2 >::populate_associated_algebra(), MilnorAnalyzer::re_setup(), and UnstableAlgebra::Sq().

template<class K>
map<PowProd, K> Polynomial< K >::coeffs
 

a polynomial associates an element in K to a power product: simple!

Definition at line 55 of file polynomials.H.

Referenced by GradedAlgebra< F_2 >::add_relation(), Exponentiator< F_2 >::clean_up_equations(), Exponentiator< F_2 >::compute_exp_relations(), DerivationAnalyzer::coords_of(), Polynomial< F_2 >::shift_variables(), Polynomial< F_2 >::swap_variables(), and SW_Maker::translate_homomorphism().

template<class K>
int Polynomial< K >::order_override = 0 [static, private]
 

override mechanism

See lp() for details.

Definition at line 644 of file polynomials.H.


The documentation for this class was generated from the following file:
Generated on Wed Jun 18 17:22:46 2008 for Pierre Guillot by  doxygen 1.3.9.1