polybori.general_boolean_polynomial | index ../../../../lib/python2.7/dist-packages/polybori/general_boolean_polynomial.py

`# -*- python -*-`

Modules

``

os re | resource sys | warnings |

Classes

``

GeneralBooleanPolynomial

class GeneralBooleanPolynomial
`` | `Class to represent Boolean polynomials over F_2^k`

Methods defined here:

__add__(self, other)
  `Addition of two GeneralBooleanPolynomial`

__eq__(self, other)
  `Tests equality by testing that
  - both objects are defined over the same ring (i.e. the number of factors is the same)
  - the objects are equal in each component`

__getitem__(self, k)
  `Return the k-th component (i.e. the projection to the k-th factor)`

__init__(self, k, coeff, polynomial)
  `Construct a GeneralBooleanPolynomial given by coeff * polynomial
  Arguments:
  k : Number of factors of F_2
  coeff : Array containing natural numbers in {0, ..., k-1} representing an element of F_2^k as a set
  polynomial : Polynomial`

__len__(self)
  `Returns the number of factors k in the product of the underlying ring F_2^k`

__mul__(self, other)
  `Multiplication of two GeneralBooleanPolynomial`

__ne__(self, other)

__setitem__(self, k, value)
  `Sets the k-th component (i.e. the projection to the k-th factor)`

__str__(self)
  `Returns a representation of the polynomial as string`

__sub__(self, other)
  `Subtraction of two GeneralBooleanPolynomial`

constant_part(self)
  `Constant part as GeneralBoolenPolynomial`

constant_part_as_set(self)
  `Constant part as set containing the indices of the non-zero coefficients of the constant part`

constant_part_as_set_array(self)
  `Constant part as array containing the indices of the non-zero coefficients of the constant part (sorted increasingly)`

constant_part_binary(self)
  `Constant part as binary tuple indicading which coefficients are non-zero`

divides(self, other)
  `Tests if self divides other`

is_monomial(self)
  `Test if self is a Monomial`

is_zero(self)
  `Tests if self is zero`

lc(self)
  `Returns leading coefficient as constant GeneralBooleanPolynomial`

lc_as_set(self)
  `Returns leading coefficient as set containing the indices of the
  non-zero components of the leading coefficient.`

lc_as_set_array(self)
  `Returns leading coefficient as array containing the indices of the
  non-zero components of the leading coefficient.`

lc_binary(self)
  `Returns leading coefficient as array containing the integers 0 or 1
  representing the leading coefficient in a binary form.`

lm(self)
  `Leading monomial in form of a GeneralBooleanPolynomial`

lt(self)
  `Leading term in form of a GeneralBooleanPolynomial`

monomial(self)
  `Returns a PolyBoRi Monomial representing the leading monomial of self, where self should be a monomial`

to_expanded_polynomial_ring(self, new_variables)
  `Returns a representation in form of a Polynomial over a ring with
  additional variables, one for each factor in the product of fields
  F_2^k`

Functions

``

build_dict_from_array_of_extended_polynomials(A, e_vars)

clock(...)
  `clock() -> floating point number
  Return the CPU time or real time since the start of the process or since
  the first call to clock(). This has as much precision as the system
  records.`

contained_vars(...)
  `contained_vars( (BooleSet)arg1) -> BooleSet :
  C++ signature :
  polybori::BooleSet contained_vars(polybori::BooleSet)`

count_double(...)
  `count_double( (BooleSet)arg1) -> float :
  C++ signature :
  double count_double(polybori::BooleSet)`

easy_linear_factors(...)
  `easy_linear_factors( (Polynomial)arg1) -> BoolePolynomialVector :
  C++ signature :
  std::vector<polybori::BoolePolynomial, std::allocator<polybori::BoolePolynomial> > easy_linear_factors(polybori::BoolePolynomial)`

expanded_polynomial2general_polynomial(polynomial, new_variables, ring)
  `Returns a GeneralBooleanPolynomial associated to a Polynomial (polynomial) in
  additional variables (new_variables), where the
  GeneralBooleanPolynomial in obtained from the projections of polynomial
  to the factors of F_2^k (by specialization of the additional variables)`

if_then_else(...)
  `if_then_else( (object)arg1, (BooleSet)arg2, (BooleSet)arg3) -> BooleSet :
  if-then else operator
  C++ signature :
  polybori::BooleSet if_then_else(int,polybori::BooleSet,polybori::BooleSet)
  if_then_else( (Variable)arg1, (BooleSet)arg2, (BooleSet)arg3) -> BooleSet :
  if-then else operator
  C++ signature :
  polybori::BooleSet if_then_else(polybori::BooleVariable,polybori::BooleSet,polybori::BooleSet)`

interpolate(...)
  `interpolate( (BooleSet)arg1, (BooleSet)arg2) -> Polynomial :
  C++ signature :
  polybori::BoolePolynomial interpolate(polybori::BooleSet,polybori::BooleSet)`

interpolate_smallest_lex(...)
  `interpolate_smallest_lex( (BooleSet)arg1, (BooleSet)arg2) -> Polynomial :
  C++ signature :
  polybori::BoolePolynomial interpolate_smallest_lex(polybori::BooleSet,polybori::BooleSet)`

ll_red_nf_noredsb(...)
  `ll_red_nf_noredsb( (Polynomial)arg1, (BooleSet)arg2) -> Polynomial :
  C++ signature :
  polybori::BoolePolynomial ll_red_nf_noredsb(polybori::BoolePolynomial,polybori::BooleSet)`

ll_red_nf_noredsb_single_recursive_call(...)
  `ll_red_nf_noredsb_single_recursive_call( (Polynomial)arg1, (BooleSet)arg2) -> Polynomial :
  C++ signature :
  polybori::BoolePolynomial ll_red_nf_noredsb_single_recursive_call(polybori::BoolePolynomial,polybori::BooleSet)`

ll_red_nf_redsb(...)
  `ll_red_nf_redsb( (Polynomial)arg1, (BooleSet)arg2) -> Polynomial :
  C++ signature :
  polybori::BoolePolynomial ll_red_nf_redsb(polybori::BoolePolynomial,polybori::BooleSet)`

map_every_x_to_x_plus_one(...)
  `map_every_x_to_x_plus_one( (Polynomial)arg1) -> Polynomial :
  C++ signature :
  polybori::BoolePolynomial map_every_x_to_x_plus_one(polybori::BoolePolynomial)`

mapping(...)
  `mapping( (Polynomial)arg1, (Monomial)arg2, (Monomial)arg3) -> Polynomial :
  C++ signature :
  polybori::BoolePolynomial mapping(polybori::BoolePolynomial,polybori::BooleMonomial,polybori::BooleMonomial)`

mod_mon_set(...)
  `mod_mon_set( (BooleSet)arg1, (BooleSet)arg2) -> BooleSet :
  C++ signature :
  polybori::BooleSet mod_mon_set(polybori::BooleSet,polybori::BooleSet)
  mod_mon_set( (BooleSet)arg1, (BooleSet)arg2) -> BooleSet :
  C++ signature :
  polybori::BooleSet mod_mon_set(polybori::BooleSet,polybori::BooleSet)`

mod_var_set(...)
  `mod_var_set( (BooleSet)arg1, (BooleSet)arg2) -> BooleSet :
  C++ signature :
  polybori::BooleSet mod_var_set(polybori::BooleSet,polybori::BooleSet)`

mult_fast_sim_C(...)
  `mult_fast_sim_C( (BoolePolynomialVector)arg1, (Ring)arg2) -> Polynomial :
  C++ signature :
  polybori::BoolePolynomial mult_fast_sim_C(std::vector<polybori::BoolePolynomial, std::allocator<polybori::BoolePolynomial> >,polybori::BoolePolyRing)`

nf3(...)
  `nf3( (ReductionStrategy)arg1, (Polynomial)arg2, (Monomial)arg3) -> Polynomial :
  C++ signature :
  polybori::BoolePolynomial nf3(polybori::groebner::ReductionStrategy,polybori::BoolePolynomial,polybori::BooleMonomial)`

parallel_reduce(...)
  `parallel_reduce( (BoolePolynomialVector)arg1, (GroebnerStrategy)arg2, (object)arg3, (float)arg4) -> BoolePolynomialVector :
  C++ signature :
  std::vector<polybori::BoolePolynomial, std::allocator<polybori::BoolePolynomial> > parallel_reduce(std::vector<polybori::BoolePolynomial, std::allocator<polybori::BoolePolynomial> >,polybori::groebner::GroebnerStrategy {lvalue},int,double)`

print_matrix(A)
  `# Just for debugging`

projection_of_expanded_polynomial(f, e, e_vars)
  `Compute the projection of the expanded polynomial f to the component
  corresponding to the variable e (which is part of e_vars)`

random_set(...)
  `random_set( (Monomial)arg1, (int)arg2) -> BooleSet :
  C++ signature :
  polybori::BooleSet random_set(polybori::BooleMonomial,unsigned int)`

recursively_insert(...)
  `recursively_insert( (CCuddNavigator)arg1, (object)arg2, (BooleSet)arg3) -> BooleSet :
  C++ signature :
  polybori::BooleSet recursively_insert(polybori::CCuddNavigator,int,polybori::BooleSet)`

reduce_general_boolean_polynomial(F, polynomial)
  `Computes the reduction of polynomial via the ideal given by F`

set_random_seed(...)
  `set_random_seed( (int)arg1) -> None :
  C++ signature :
  void set_random_seed(unsigned int)`

spoly(...)
  `spoly( (Polynomial)arg1, (Polynomial)arg2) -> Polynomial :
  Compute s-Polynomial between two Polynomials
  C++ signature :
  polybori::BoolePolynomial spoly(polybori::BoolePolynomial,polybori::BoolePolynomial)`

sqrt(...)
  `sqrt(x)
  Return the square root of x.`

stratified(I)
  `Tests if I does no contain two polynomials with the same leading monomials`

stratify_dict_I_gb_I(dict, e_vars, debug=0)
  `Wrapper (calls either stratify_dict_I_gb_I_our_alg or stratify_dict_I_gb_I_Inoue`

stratify_dict_I_gb_I_Inoue(dict, e_vars, debug=0)
  `Reimplementation of a simple algorithm of Inoue from BGSet`

stratify_dict_I_gb_I_our_alg(dict, e_vars, debug=0)
  `Build a stratified Groebner bases for dict`

substitute_variables(...)
  `substitute_variables( (Ring)arg1, (BoolePolynomialVector)arg2, (Polynomial)arg3) -> Polynomial :
  C++ signature :
  polybori::BoolePolynomial substitute_variables(polybori::BoolePolyRing,std::vector<polybori::BoolePolynomial, std::allocator<polybori::BoolePolynomial> >,polybori::BoolePolynomial)`

test_iterate_lex(...)
  `test_iterate_lex( (Polynomial)arg1) -> int :
  C++ signature :
  unsigned long test_iterate_lex(polybori::BoolePolynomial {lvalue})`

test_iterate_lex_reversed(...)
  `test_iterate_lex_reversed( (Polynomial)arg1) -> int :
  C++ signature :
  unsigned long test_iterate_lex_reversed(polybori::BoolePolynomial {lvalue})`

test_iterate_ordered(...)
  `test_iterate_ordered( (Polynomial)arg1) -> int :
  C++ signature :
  unsigned long test_iterate_ordered(polybori::BoolePolynomial {lvalue})`

test_iterate_reference_ordered(...)
  `test_iterate_reference_ordered( (Polynomial)arg1) -> int :
  C++ signature :
  unsigned long test_iterate_reference_ordered(polybori::BoolePolynomial {lvalue})`

testvalidstrat(...)
  `testvalidstrat( (GroebnerStrategy)arg1) -> None :
  C++ signature :
  void testvalidstrat(polybori::groebner::GroebnerStrategy)`

time(...)
  `time() -> floating point number
  Return the current time in seconds since the Epoch.
  Fractions of a second may be present if the system clock provides them.`

top_index(...)
  `top_index( (BooleSet)arg1) -> int :
  C++ signature :
  int top_index(polybori::BooleSet)`

translate_indices(...)
  `translate_indices( (Polynomial)arg1, (IntVector)arg2) -> Polynomial :
  C++ signature :
  polybori::BoolePolynomial translate_indices(polybori::BoolePolynomial,std::vector<int, std::allocator<int> >)`

triangulate_over_F2(A, b)
  `# Simple Gaus algorithm
  # Should really be replaced by something faster (maybe from PolyBoRi)`

variety_lex_groebner_basis(...)
  `variety_lex_groebner_basis( (BooleSet)arg1, (Monomial)arg2) -> BoolePolynomialVector :
  C++ signature :
  std::vector<polybori::BoolePolynomial, std::allocator<polybori::BoolePolynomial> > variety_lex_groebner_basis(polybori::BooleSet,polybori::BooleMonomial)`

variety_lex_leading_terms(...)
  `variety_lex_leading_terms( (BooleSet)arg1, (Monomial)arg2) -> BooleSet :
  C++ signature :
  polybori::BooleSet variety_lex_leading_terms(polybori::BooleSet,polybori::BooleMonomial)`

warn(...)
  `Issue a warning, or maybe ignore it or raise an exception.`

Data

``

block_dlex = polybori.dynamic.PyPolyBoRi.OrderCode.block_dlex
block_dp_asc = polybori.dynamic.PyPolyBoRi.OrderCode.block_dp_asc
compatibility_mode = False
dlex = polybori.dynamic.PyPolyBoRi.OrderCode.dlex
dp_asc = polybori.dynamic.PyPolyBoRi.OrderCode.dp_asc
k = 4
lp = polybori.dynamic.PyPolyBoRi.OrderCode.lp
mat_counter = 0
maxint = 9223372036854775807
modules = {'StringIO': <module 'StringIO' from '/usr/lib/python2.7/StringIO.pyc'>, 'UserDict': <module 'UserDict' from '/usr/lib/python2.7/UserDict.pyc'>, '__builtin__': <module '__builtin__' (built-in)>, '__future__': <module '__future__' from '/usr/lib/python2.7/__future__.pyc'>, '__main__': <module '__main__' from 'doc/genpythondoc.py'>, '_abcoll': <module '_abcoll' from '/usr/lib/python2.7/_abcoll.pyc'>, '_codecs': <module '_codecs' (built-in)>, '_collections': <module '_collections' (built-in)>, '_functools': <module '_functools' (built-in)>, '_hashlib': <module '_hashlib' from '/usr/lib/python2.7/lib-dynload/_hashlib.x86_64-linux-gnu.so'>, ...}
snake_pattern = <_sre.SRE_Pattern object>