-
Notifications
You must be signed in to change notification settings - Fork 3
Core Modules
The rssn library is organized into a collection of modules, each responsible for a distinct set of functionalities. This modular design, governed by feature flags, allows users to compile only the parts of the library they need.
Below is a description of the primary modules found in the src directory.
This is the heart of rssn. It contains the entire Computer Algebra System (CAS), including the core data structures for symbolic computation.
-
symbolic::core: Defines the fundamentalExpr(AST) andDagNode(DAG) structures, and theDagManagerthat canonicalizes expressions. -
symbolic::calculus: Provides functions for symbolic differentiation, integration, limits, and series expansions. -
symbolic::simplify_dag: Contains the iterative, bottom-up simplification engine that operates on the DAG. -
symbolic::polynomial: Implements polynomial-specific operations, including the computation of Gröbner bases.
This module provides a suite of algorithms for numerical computing, built to be generic and flexible using Rust's trait system.
-
numerical::ode: Solvers for Ordinary Differential Equations. -
numerical::integration: Algorithms for numerical integration (quadrature). -
numerical::optimization: Tools for finding minima or maxima of functions. -
numerical::linalg: Wrappers and utilities for linear algebra operations, often relying on backends likenalgebraorfaer.
A high-level module for building scientific simulations. It provides frameworks and utilities for common simulation patterns.
- Examples include templates or helpers for Finite Element Method (FEM), Finite Difference Method (FDM), and Finite Volume Method (FVM) solvers.
- The architecture is data-oriented and designed with future parallelism in mind.
This module acts as a high-level computation engine, orchestrating the symbolic and numerical components to perform complex calculations.
These modules work together to create the Foreign Function Interface (FFI), allowing rssn to be used from other languages.
-
ffi_apis: Exposes the C-compatible functions that form the public-facing API for external languages. -
ffi_blindings: Implements the handle-based "blinding" system, which safely manages references to Rust objects by handing out opaque integer handles instead of raw pointers.
The Just-In-Time (JIT) compilation module. It can compile symbolic expressions into native machine code at runtime for a significant performance boost, often using a backend like cranelift.
Responsible for rendering Expr objects into different formats. It is decoupled from the core engine and supports:
- Pretty-printing to the console.
- LaTeX for inclusion in scientific documents.
- Typst as a modern alternative to LaTeX.
This module handles parsing of expressions from string formats into the internal Expr representation.
A system designed for extensibility, allowing third-party libraries to register new functions, simplification rules, or even new types with the rssn core.
This module re-exports the most commonly used types, traits, and functions, making it easier for users to get started with the library.