Skip to main content

Crate groebner

Crate groebner 

Source
Expand description

Groebner Basis

This library computes Groebner bases of polynomial ideals, using the Buchberger and F4 algorithms.

§Example

use groebner::{groebner_basis, is_groebner_basis, MonomialOrder, PolynomialRing};
use num_rational::BigRational;

let ring = PolynomialRing::<BigRational>::new(["x", "y"], MonomialOrder::Lex)?;
let f1 = ring.parse("x^2 - y")?;
let f2 = ring.parse("x*y - 1")?;
let basis_result = groebner_basis(vec![f1, f2], MonomialOrder::Lex, true);
match basis_result {
    Ok(basis) => {
        assert!(!basis.is_empty());
        match is_groebner_basis(&basis) {
            Ok(true) => {}
            Ok(false) => panic!("Basis is not a Groebner basis!"),
            Err(e) => panic!("Groebner basis check failed: {}", e),
        }
    }
    Err(e) => panic!("Groebner basis computation failed: {}", e),
}

Re-exports§

pub use field::Field;
pub use grebauer_moller::filter_gm_pairs;
pub use groebner::groebner_basis;
pub use groebner::groebner_basis_with_strategy;
pub use groebner::is_groebner_basis;
pub use groebner::GroebnerError;
pub use groebner::SelectionStrategy;
pub use monomial::Monomial;
pub use monomial::MonomialOrder;
pub use polynomial::Polynomial;
pub use polynomial::Term;
pub use ring::ParsePolynomialError;
pub use ring::PolynomialRing;

Modules§

field
Field trait and Rational number implementation
grebauer_moller
The selection strategy of Gebauer and Möller
groebner
Groebner basis algorithms.
monomial
Monomial types and orderings for Groebner basis computations
polynomial
Multivariate polynomial types and operations.
ring
Polynomial ring helpers for parsing and formatting user-facing polynomials.
sugar
Sugar strategy for Groebner basis computation