Skip to main content

Module prelude

Module prelude 

Source
Expand description

The symplex prelude — one import to get started.

use symplex::prelude::*;

Re-exports§

pub use crate::base::assumptions::Assumption;
pub use crate::base::assumptions::Assumptions;
pub use crate::base::assumptions::Props;
pub use crate::base::config::EvalConfig;
pub use crate::base::errors::SymplexError;
pub use crate::base::extended::Extended;
pub use crate::base::interval::Bounds;
pub use crate::base::interval::Interval;
pub use crate::base::interval::IntervalKind;
pub use crate::domains::linprog::Q;

Macros§

dim
Build a dimension-checked physical quantity using natural math syntax.
eq
Build a symbolic equation using natural math syntax.
expr
Build a symbolic expression using natural math syntax.
matrix
Build a symbolic matrix using natural math syntax.
rule
Define a rewrite rule with pattern/template syntax.

Structs§

Bindings
Wildcard bindings produced by a successful match: wildcard name → matched sub-expression.
Boolean
Boolean sort: true/false values from comparisons and logic. Supports and, or, not operations.
CodegenOptions
Configuration for Rust code generation.
CompiledFn
A compiled scalar function f(x₁, …, xₙ) → f64.
CompiledFnVec
A compiled vector-valued function F(x₁, …, xₙ) → (f₁, …, fₖ).
Context
The user-facing entry point for symplex.
Diagonalization
Eigendecomposition A = P·D·P⁻¹: the columns of P are eigenvectors, D is diagonal with the eigenvalues in the same order.
Equation
A symbolic equation lhs = rhs.
ExpandOpts
Hints controlling Ex::expand_with.
Expr
A symbolic expression handle, parameterized by sort.
ExprView
A non-locking, read-only view into an expression node within the arena.
FormalPowerSeries
A formal power series Σ a_k (x − point)^k with exact, lazily computed coefficients. See the module docs for the design.
FourierSeries
The trigonometric Fourier series of a function on an interval [a, b] (period T = b − a, fundamental frequency ω₀ = 2π/T):
GeneralSolution
Result of Ex::solve_general: solution families plus the integer parameters they are expressed with.
HermiteNormalForm
Row-style Hermite normal form H = U·A with U unimodular (det U = ±1).
Hessenberg
Upper Hessenberg form by similarity: H = P⁻¹·A·P (equivalently A·P = P·H) with h_ij = 0 for i > j + 1.
InitialCondition
One initial condition of an ODE initial-value problem: y^(order)(x) = value, i.e. the order-th derivative of the unknown function, evaluated at the point x, equals value.
JordanForm
Jordan normal form A = P·J·P⁻¹: J is block diagonal with Jordan blocks J_k(λ) (eigenvalue on the diagonal, ones on the superdiagonal), P holds the (generalized) eigenvectors.
Ldl
LDLᵀ decomposition A = L·D·Lᵀ of a symmetric matrix: L unit lower triangular, D diagonal.
LllReduction
LLL reduction of the lattice basis formed by the rows of A: reduced = transform·A with transform unimodular (det = ±1), so both span the same lattice.
LpProblem
A linear program in builder form. See the module docs for the problem shape and the meaning of the results.
LpSolution
Result of LpProblem::solve / linprog.
Lu
LU decomposition with partial pivoting P·A = L·U: L unit lower triangular, U upper triangular, and perm the row permutation — row i of P·A is row perm[i] of A.
Matrix
A dense matrix of symbolic expressions.
MinimizeOpts
Options for nelder_mead, minimize_scalar and golden_section.
MinimizeResult
Outcome of a multivariate minimisation (nelder_mead, differential_evolution and the Ex wrappers).
MultiPoly
A sparse multivariate polynomial over ℚ.
NewtonOpts
Options for solve_numeric_system_with.
Numeric
Numeric sort: real, complex, and integer values. Supports arithmetic, calculus, and algebraic operations.
Poly
A sparse multivariate polynomial view of an expression over explicit generators, with coefficients that are expressions free of the generators.
Qr
QR decomposition A = Q·R: Q has orthonormal columns, R is upper triangular.
QuadOpts
Options for quadrature and Ex::integrate_numeric_with.
QuadResult
Result of quadrature and Ex::integrate_numeric_with: the integral estimate and the estimated absolute error of that estimate.
Quaternion
A symbolic quaternion q = w + x·i + y·j + z·k.
RankDecomposition
Full-rank factorisation A = C·F with r = rank A: C (m × r) is made of the pivot columns of A, F (r × n) of the nonzero rows of rref(A).
RewriteOpts
Options controlling Ex::rewrite_with.
RootOpts
Options for the scalar root finders brent_root, bisect and newton_root.
Rule
A named rewrite rule lhs → rhs over expressions of one Context.
RuleSet
An ordered collection of Rules.
SetValued
Set-valued sort: intervals, finite sets, unions. Supports set operations (union, intersection, complement).
SimplifyOpts
Options controlling Expr::simplify_with. Options for configuring the simplification engine.
SmithNormalForm
Smith normal form S = U·A·V with U, V unimodular (det U = det V = ±1) and S = diag(d₁, …, dᵣ, 0, …), dᵢ | dᵢ₊₁.
StateSpace
A linear time-invariant (LTI) state-space model.
Step
One step of a rewrite or simplification trace.
TransferFunction
A transfer function G(s) = num(s) / den(s).

Enums§

CoordinateSystem
Orthogonal coordinate systems supported by the vector-calculus operators.
Direction
The direction from which a limit point is approached.
EulerConvention
Euler angle convention for rotation composition.
ExprType
Structural classification of an expression node.
Feasibility
Outcome of an exact feasibility question (see feasible_nonneg_certified and nonneg_combination).
FourierConvention
Normalisation convention of the Fourier transform pair.
LinearSolution
Result of solving a linear system with linsolve.
LpStatus
Outcome of a linear program.
MathBackend
Math function dispatch strategy for generated code.
MonomialOrder
A monomial order chosen at run time — the value-level counterpart of the zero-sized order types Lex and GrevLex, for APIs that take the order as an argument (Ex::groebner, Ex::reduce_modulo).
Precision
Floating-point precision for generated code.
RewriteStrategy
Traversal order used by Ex::rewrite_with.

Traits§

Scalar
Rust numeric types accepted as the right-hand operand of + - * / (and += -= *= /=) on Ex: i32, i64, i128, u32, u64, f64, BigInt, Ratio<BigInt>.
Sort
Marker trait for expression sorts.
ToEx
A Rust value that can be turned into an exact expression in a Context.
ZeroForm
Types that can be viewed as an equation expr = 0.

Functions§

linsolve
Solve a system of linear equations symbolically.
linsolve_matrix
Solve A·x = b for a coefficient matrix a (m×n) and right-hand side b (m×1), with symbolic entries allowed.
reduce_inequalities
Reduce a system of univariate conditions in var to its solution set.
solve_numeric_system
Newton’s method for the square nonlinear system eqs = 0 in vars, starting from x0, with default options (tol = 1e-12, max_iter = 100, damping on).
solve_numeric_system_with
Newton’s method with explicit NewtonOpts.

Type Aliases§

BoolEx
A boolean expression — comparisons and logical operations.
Complex64
Alias for a Complex<f64>
Ex
A numeric expression — the primary type for symbolic math.
QMatrix
Dense matrix over ℚ with Ratio<BigInt> entries.
SetEx
A set-valued expression — intervals, finite sets, unions.
ZMatrix
Dense matrix over ℤ with BigInt entries.