#include <polynomials.H>
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 | |
K | coeff_of (const PowProd &pow) const |
returns a coefficient | |
PowProd | lp () const |
leading power product | |
Polynomial< K > | lt () const |
leading term | |
K | 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) |
K | 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 | |
Alphabet * | alphabet |
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) |
|
turns a powerproduct into a polynomial with coefficient 1
|
|
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(). |
|
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(). |
|
evaluates at scalar values
Definition at line 461 of file polynomials.H. Referenced by Exponentiator< F_2 >::clean_up_equations(). |
|
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. |
|
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. |
|
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(). |
|
|
leading coefficient
Definition at line 292 of file polynomials.H. |
|
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(). |
|
leading term
Definition at line 280 of file polynomials.H. Referenced by UnstableAlgebra::Sq(). |
|
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(). |
|
multiplies by a constant
Definition at line 334 of file polynomials.H. |
|
|
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(). |
|
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(). |
|
write to file
Definition at line 544 of file polynomials.H. |
|
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. |
|
read from file
Definition at line 563 of file polynomials.H. |
|
computes the S polynomial in the sense of Buchberger. f and g MUST be nonzero.
Definition at line 587 of file polynomials.H. |
|
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. |
|
|
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(). |
|
override mechanism See lp() for details. Definition at line 644 of file polynomials.H. |