Expand description
oCAS — open Computer Algebra System.
This crate is the top-level Rust API for oCAS. It re-exports the public items from the lower-level crates so that most users only need one import:
use ocas::prelude::*;Backends (GMP, MPFR, FLINT, LLVM, Python, GPL) are opt-in via feature flags to keep the default build portable, including on Windows MSVC where GMP is not readily available.
Modules§
- normalize
- Normalization for
Atomexpression trees. - prelude
- Convenience prelude that brings commonly used oCAS types and functions into scope.
- simplify
- Rule-based simplification for oCAS.
Structs§
- Arena
- A bump-allocated region of memory.
- Assumptions
- A set of assumptions about a symbolic variable.
- Atom
- A reference to an expression node allocated in an arena.
- Atom
Arena - A context that allocates
Atoms in anArena. - Bindings
- A collection of wildcard bindings produced by a successful match.
- Complex
- A complex number whose real and imaginary parts live in a base domain.
- Complex
Domain - The complex domain over a base domain
D. - Dense
Univariate Polynomial - A dense univariate polynomial with coefficients in a domain
D. - Diophantine
Solution - A solution to a linear Diophantine equation ax + by = c.
- Expression
Evaluator - A compiled expression ready for numeric evaluation.
- Finite
Field - A prime finite field $\mathbb{Z}/p\mathbb{Z}$.
- Finite
Field Element - An element of a prime finite field.
- Function
Map - A map of named functions that can be called during evaluation.
- Grevlex
- Graded reverse lexicographic ordering: first by total degree descending, then reverse lexicographic.
- Groebner
Basis - A Gröbner basis for a polynomial ideal.
- Integer
- Arbitrary-precision integer backed by
num-bigint. - Integer
Domain - The integer domain.
- Lex
- Lexicographic ordering: compare exponents left-to-right.
- Matrix
- A dense matrix with elements from a
EuclideanDomain. - Rational
- Arbitrary-precision rational number backed by
num-rational. - Rational
Domain - The rational number domain.
- Rational
Polynomial - A rational polynomial $\frac{\text{num}}{\text{den}}$ over a domain
D. - Real
Ball - A real ball: midpoint with radius.
- Real
Ball Domain - The real ball domain.
- Root
Interval - A real interval known to contain exactly one root.
- Rule
- A rewrite rule.
- Sparse
Multivariate Polynomial - A sparse multivariate polynomial with coefficients in a domain
Dand monomial orderingO. - Symbol
- An interned symbolic name (variable, function, or constant).
- Symbol
Assumptions - A mapping from symbol names to their domain and assumptions.
Enums§
- Assumption
- A single predicate that can be asserted about a symbolic variable.
- Atom
Node - The concrete data stored for each expression node.
- Eval
Tree - An owned intermediate representation of a symbolic expression.
- Evaluation
Error - Errors that can occur during expression evaluation.
- Instr
- An internal, index-based instruction executed by
super::ExpressionEvaluator. - Instruction
- A public, self-documenting instruction.
- Match
Error - Errors that can occur during matching.
- Matrix
Error - Errors that can occur during matrix operations.
- Ocas
Error - The primary error type returned by oCAS operations.
- Parse
Error - Errors that can occur while parsing an expression.
- Pattern
- A pattern that can be matched against an
Atom. - Slot
- A named slot in the evaluator stack.
- Solve
Error - Errors that can occur when solving equations.
- Wildcard
Level - The scope of a wildcard match.
Traits§
- Domain
- A coefficient domain for generic computer-algebra routines.
- Euclidean
Domain - Marker trait for domains that support exact division with remainder.
- Evaluation
Domain - Trait for types that can serve as evaluation domains.
- Monomial
Order - A monomial ordering determines how terms are sorted and compared.
- Powf
Extension - Extension to
EvaluationDomainfor floating-point exponentiation.
Functions§
- apart
- Perform partial fraction decomposition of
num / den. - buchberger
- Convenience: compute a Gröbner basis and inter-reduce it.
- diff
- Differentiate
exprwith respect tovar. - integrate
- Integrate
exprwith respect tovar. - match_
pattern - Match a pattern against an atom, returning bindings on success.
- monomial_
are_ coprime - Return true if the two monomials are coprime (no variable appears in both).
- monomial_
divides - Check whether monomial
adivides monomialb:a[i] >= b[i]for all i. - monomial_
lcm - Compute the least common multiple of two monomials: element-wise max.
- parse
- Parse an expression string into an
Atom. - simplify
- Simplify an atom using the supplied rewrite rules.
- solve_
diophantine - Solve the linear Diophantine equation
a*x + b*y = c. - solve_
linear_ integer - Solve a linear system of equations over the integers.
- solve_
linear_ rational - Solve a linear system of equations over the rational numbers.
- solve_
polynomial_ system - Solve a system of polynomial equations using Gröbner bases.
- substitute
- Replace every occurrence of
varinsideexprwithreplacement. - taylor
- Compute the Taylor expansion of
expraroundpointwith respect tovar, up to the givenorder(inclusive). - transform
Type Aliases§
- Result
- A convenient result type for oCAS operations.