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,notoperations. - Codegen
Options - Configuration for Rust code generation.
- Compiled
Fn - A compiled scalar function
f(x₁, …, xₙ) → f64. - Compiled
FnVec - 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 ofPare eigenvectors,Dis diagonal with the eigenvalues in the same order. - Equation
- A symbolic equation
lhs = rhs. - Expand
Opts - Hints controlling
Ex::expand_with. - Expr
- A symbolic expression handle, parameterized by sort.
- Expr
View - A non-locking, read-only view into an expression node within the arena.
- Formal
Power Series - A formal power series
Σ a_k (x − point)^kwith exact, lazily computed coefficients. See the module docs for the design. - Fourier
Series - The trigonometric Fourier series of a function on an interval
[a, b](periodT = b − a, fundamental frequencyω₀ = 2π/T): - General
Solution - Result of
Ex::solve_general: solution families plus the integer parameters they are expressed with. - Hermite
Normal Form - Row-style Hermite normal form
H = U·AwithUunimodular (det U = ±1). - Hessenberg
- Upper Hessenberg form by similarity:
H = P⁻¹·A·P(equivalentlyA·P = P·H) withh_ij = 0fori > j + 1. - Initial
Condition - One initial condition of an ODE initial-value problem:
y^(order)(x) = value, i.e. theorder-th derivative of the unknown function, evaluated at the pointx, equalsvalue. - Jordan
Form - Jordan normal form
A = P·J·P⁻¹:Jis block diagonal with Jordan blocksJ_k(λ)(eigenvalue on the diagonal, ones on the superdiagonal),Pholds the (generalized) eigenvectors. - Ldl
- LDLᵀ decomposition
A = L·D·Lᵀof a symmetric matrix:Lunit lower triangular,Ddiagonal. - LllReduction
- LLL reduction of the lattice basis formed by the rows of
A:reduced = transform·Awithtransformunimodular (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:Lunit lower triangular,Uupper triangular, andpermthe row permutation — rowiofP·Ais rowperm[i]ofA. - Matrix
- A dense matrix of symbolic expressions.
- Minimize
Opts - Options for
nelder_mead,minimize_scalarandgolden_section. - Minimize
Result - Outcome of a multivariate minimisation (
nelder_mead,differential_evolutionand theExwrappers). - Multi
Poly - A sparse multivariate polynomial over ℚ.
- Newton
Opts - 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:Qhas orthonormal columns,Ris upper triangular. - Quad
Opts - Options for
quadratureandEx::integrate_numeric_with. - Quad
Result - Result of
quadratureandEx::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. - Rank
Decomposition - Full-rank factorisation
A = C·Fwithr = rank A:C(m × r) is made of the pivot columns ofA,F(r × n) of the nonzero rows ofrref(A). - Rewrite
Opts - Options controlling
Ex::rewrite_with. - Root
Opts - Options for the scalar root finders
brent_root,bisectandnewton_root. - Rule
- A named rewrite rule
lhs → rhsover expressions of oneContext. - RuleSet
- An ordered collection of
Rules. - SetValued
- Set-valued sort: intervals, finite sets, unions. Supports set operations (union, intersection, complement).
- Simplify
Opts - Options controlling
Expr::simplify_with. Options for configuring the simplification engine. - Smith
Normal Form - Smith normal form
S = U·A·VwithU,Vunimodular (det U = det V = ±1) andS = diag(d₁, …, dᵣ, 0, …),dᵢ | dᵢ₊₁. - State
Space - A linear time-invariant (LTI) state-space model.
- Step
- One step of a rewrite or simplification trace.
- Transfer
Function - A transfer function G(s) = num(s) / den(s).
Enums§
- Coordinate
System - Orthogonal coordinate systems supported by the vector-calculus operators.
- Direction
- The direction from which a limit point is approached.
- Euler
Convention - Euler angle convention for rotation composition.
- Expr
Type - Structural classification of an expression node.
- Feasibility
- Outcome of an exact feasibility question (see
feasible_nonneg_certifiedandnonneg_combination). - Fourier
Convention - Normalisation convention of the Fourier transform pair.
- Linear
Solution - Result of solving a linear system with
linsolve. - LpStatus
- Outcome of a linear program.
- Math
Backend - Math function dispatch strategy for generated code.
- Monomial
Order - A monomial order chosen at run time — the value-level counterpart of
the zero-sized order types
LexandGrevLex, for APIs that take the order as an argument (Ex::groebner,Ex::reduce_modulo). - Precision
- Floating-point precision for generated code.
- Rewrite
Strategy - Traversal order used by
Ex::rewrite_with.
Traits§
- Scalar
- Rust numeric types accepted as the right-hand operand of
+ - * /(and+= -= *= /=) onEx: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. - Zero
Form - Types that can be viewed as an equation
expr = 0.
Functions§
- linsolve
- Solve a system of linear equations symbolically.
- linsolve_
matrix - Solve
A·x = bfor a coefficient matrixa(m×n) and right-hand sideb(m×1), with symbolic entries allowed. - reduce_
inequalities - Reduce a system of univariate conditions in
varto its solution set. - solve_
numeric_ system - Newton’s method for the square nonlinear system
eqs = 0invars, starting fromx0, 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
BigIntentries.