On this page
mathlib-fp
A collection of focused Free Pascal mathematics domains organised as a single source tree and distribution.
See the roadmap for the quality-first path toward a comprehensive native Free Pascal numerical package.
New to Free Pascal numerical code? Read the beginner guide, then choose a tested task from the beginner recipes. The recipes lead with the double-real, allocating path and link the advanced controls separately.
Releases
- mathlib-fp 1.9.2 release notes — beginner guide, task recipes, stable-domain learning routes, and checked problem-oriented search.
- 1.9.2 PR notes — beginner-learning-path review boundary and automated completion-gate evidence.
- 1.9.2 qualification report — automated preflight, API freeze, and clean-archive requirements.
- 1.9.2 automated beginner journeys — the deterministic evidence replacing external participant collection.
- mathlib-fp 1.9.1 release notes — feature-frozen correctness stabilisation, versioned web/offline documentation, output-aware execution checks, and first-use feedback.
- 1.9.1 PR notes — review boundary, compatibility evidence, and completion-gate mapping.
- 1.9.1 qualification report — normal, optimised, checked/heap, examples, documentation, package, and clean-archive evidence.
- Versioned web documentation and focused 1.9 feedback.
- mathlib-fp 1.9.0 release notes — typed structured/sparse storage, matrix-free Krylov solvers, reusable factors, partial eigensystems, and the candidate-2.0 runway.
- 1.9.0 PR notes — review scope, compatibility, completion-gate mapping, risks, and explicit exclusions.
- 1.9.0 qualification report — dense oracles, termination outcomes, bounded-storage measurements, and target gates.
- 1.9 API audit, generated declaration reference, candidate 2.0 contract, and migration preview.
- mathlib-fp 1.8.0 release notes — applied DSP, bounded streaming statistics, reproducible analysis, state-space filtering, numerical interchange, and portable performance.
- 1.8.0 PR notes — review scope, compatibility, release qualification, risks, and explicitly open roadmap work.
- 1.8.0 qualification report — numerical oracles, memory bounds, persistence rejection, benchmark comparison, and targets.
- mathlib-fp 1.7.0 release notes — interpolation, fitting, adaptive integration/ODEs, differentiation, and convex optimisation.
- 1.7.0 PR notes — review scope, compatibility, local verification, risks, and explicitly deferred work.
- 1.7.0 qualification report — modelling accuracy, diagnostics, reentrancy, examples, and target checks.
- mathlib-fp 1.6.0 release notes — typed dense QR/CPQR, SVD, eigensystems, and inspectable direct-solve diagnostics.
- 1.6.0 qualification report — algorithm-specific residual, reconstruction, target, example, and benchmark evidence.
- mathlib-fp 1.5.0 release notes — typed contiguous single/double real/complex matrices, kernels, and direct solve.
- 1.5.0 qualification report — target configurations, numerical evidence, benchmarks, dependencies, and gaps.
- mathlib-fp 1.4.0 release notes — GeometryLib vector arithmetic and scale-safe normalization.
- mathlib-fp 1.3.0 release notes — complex and vector foundation.
- mathlib-fp 1.2.3 release notes — numerical correctness, special-function accuracy, and robust probability tails.
- mathlib-fp 1.2.2 release notes — complete newcomer example coverage and cross-platform example builds.
- mathlib-fp 1.2.1 release notes — terminology and public API naming consistency.
- mathlib-fp 1.2.0 release notes — first public release.
Terminology
mathlib-fp uses the following terms consistently:
| Term | Meaning | Example |
|---|---|---|
| Project or distribution | The complete versioned source release | mathlib-fp 1.3.0 |
| Domain | A functional area within mathlib-fp | Finance, algebra, geometry |
| Unit family | The shared prefix of related Pascal units | FinanceLib, AlgebraLib |
| Unit | A Pascal compilation unit named in a uses clause |
FinanceLib.Interest |
| Kit class | A public calculation facade, usually exposing class-static methods | TFinanceKit |
| Focused alias unit | A narrow import path that aliases a Kit class or supporting types | FinanceLib.Bonds |
| Lazarus package | The optional IDE package containing the project units | mathlib_fp.lpk |
“Kit” describes an API class, not a domain or unit. Supporting units containing constants, types, low-level functions, or exception declarations do not need an artificial Kit class.
Domains
| Unit family | Domain | Depends on |
|---|---|---|
| MathBase | Shared types, constants, precision, trigonometry, local random state, bounded expressions, and numerical interchange | RTL / FCL streams |
| AlgebraLib | Compatibility matrices, typed dense storage/solvers, and structured/sparse/matrix-free linear algebra | MathBase |
| FinanceLib | Time value of money, bonds, NPV/IRR, options, ratios, risk metrics | MathBase |
| StatsLib | Descriptive/online statistics, paired distributions, inference, regression diagnostics, and bootstrap | MathBase / AlgebraLib |
| EngineeringLib | Fluid dynamics, thermodynamics, applied DSP, signal processing, unit conversion | MathBase / AlgebraLib |
| NumericsLib | Root finding and introductory numerical methods; advanced modelling | MathBase / AlgebraLib |
| ProbabilityLib | Continuous and discrete probability distributions | MathBase |
| CombinatoricsLib | Counting, sequences, number theory, permutations, combinations | MathBase |
| OptimizationLib | Diagnostic scalar/vector/constrained optimisation and two-phase LP; dense convex QP/SOCP | MathBase / AlgebraLib / NumericsLib AD |
| TimeSeriesLib | Smoothing, decomposition, ARIMA, anomaly detection, and scalar/multivariate state-space filtering | MathBase / AlgebraLib |
| MLLib | Preprocessing, regression, classifiers, clustering, forests, metrics, and typed reproducible analysis | MathBase / AlgebraLib |
| InterchangeLib | Versioned selected-model persistence adapters | MathBase / selected model domains |
| GeometryLib | 2-D and 3-D computational geometry | MathBase |
Public API naming inventory
| Domain | Primary units | Public Kit classes |
|---|---|---|
| Math foundation | MathBase.SharedTypes, MathBase.Complex, MathBase.MathConstants, MathBase.Precision, MathBase.Trigonometry, MathBase.Random, MathBase.Interchange, MathBase.Expressions |
TTrigKit, TLocalRandom, interchange procedures, TExpressionEvaluator |
| Algebra | AlgebraLib.Matrices, AlgebraLib.VectorKernels, AlgebraLib.Vectors, AlgebraLib.Determinants, AlgebraLib.DenseMatrices, AlgebraLib.DenseKernels, AlgebraLib.DenseSolvers, AlgebraLib.DenseDecompositions, AlgebraLib.SparseMatrices, AlgebraLib.LinearOperators, AlgebraLib.IterativeSolvers, AlgebraLib.StructuredSolvers, AlgebraLib.PartialEigensystems |
TMatrixKit, TVectorKit, typed dense/sparse/operator/solver facades |
| Finance | FinanceLib.Interest, FinanceLib.Bonds, FinanceLib.NPV |
TFinanceKit; aliases TBondKit, TNPVKit |
| Statistics | StatsLib.Stats, StatsLib.Streaming, StatsLib.Inference |
TStatsKit, TOnlineStatistics, TInferenceKit |
| Engineering | EngineeringLib.FluidDynamics, EngineeringLib.Thermodynamics, EngineeringLib.Signal, EngineeringLib.DSP, EngineeringLib.UnitConversion |
TFluidDynamicsKit, TThermodynamicsKit, TSignalKit, TDSPKit, block/streaming DSP records, TUnitConversionKit; aliases TVelocityKit, TPressureKit |
| Numerics | NumericsLib.Numerics, NumericsLib.Differentiation, NumericsLib.Interpolation, NumericsLib.Modelling |
TNumericsKit, TDifferentiationKit, TInterpolationKit, TModellingKit |
| Probability | ProbabilityLib.Distributions |
TProbabilityKit |
| Combinatorics | CombinatoricsLib.Combinatorics |
TCombinatoricsKit |
| Optimization | OptimizationLib.Optimization, OptimizationLib.Convex |
TOptimizationKit, TConvexOptimizationKit |
| Time series | TimeSeriesLib.TimeSeries, TimeSeriesLib.StateSpace |
TTimeSeriesKit, TScalarKalmanFilter, TMultivariateKalmanFilter |
| Machine learning | MLLib.MachineLearning, MLLib.Analysis |
TMLKit, TAnalysisKit, TKDTree, fitted analysis/forest records |
| Model interchange | InterchangeLib.Models |
selected model save/load and summary procedures |
| Geometry | GeometryLib.Geometry |
TGeometryKit |
Dependency Graph
MathBase
├── AlgebraLib
├── FinanceLib
├── StatsLib
├── EngineeringLib
├── NumericsLib
├── ProbabilityLib
├── CombinatoricsLib
├── OptimizationLib
├── TimeSeriesLib
├── MLLib
├── InterchangeLib (optional adapters over selected domains)
└── GeometryLib
Common Base Types
All domains share the types defined in MathBase.SharedTypes:
TIntegerArray = array of Integer;
TDoubleArray = array of Double;
TSingleArray = array of Single;
TExtendedArray = array of Extended;
TDoublePair = record Lower, Upper: Double; end;
TComplexArray = array of TComplex; // MathBase.Complex
TSingleComplexArray = array of TSingleComplex;
Design Principles
- Kit classes normally use static class methods for stateless calculations.
TMatrixKitalso implementsIMatrix; it is the established matrix factory and concrete implementation as well as the algebra Kit class.- The typed dense API is the contiguous single/double real/complex path. Its migration guide names copy and allocation costs.
- Collection APIs use
TDoubleArray,TIntegerArray, or documented matrix aliases. - Optional
ADecimalsparameters round scalar results where documented. - Invalid inputs raise typed exceptions such as
EFinanceError,EStatsError,EMatrixError,EProbabilityError, or the domain-specific equivalent.
Find an algorithm
The problem-oriented beginner recipes are the shortest route when you know the task but not its Pascal identifier.
| Problem | Recommended starting point |
|---|---|
| Solve a square dense system | Solve(A, B) |
| Repeated dense solves | FactorLU |
| Positive-definite dense solve | FactorCholesky |
| Typed matrix multiplication | Multiply / MultiplyInto |
| Deterministic blocked matrix multiplication | MultiplyBlockedInto / MultiplyAutoInto |
| Assemble or multiply a sparse matrix | Sparse storage and operation contracts |
| Solve a large positive-definite system | ConjugateGradient selection guide |
| Solve a general square or rectangular operator problem | GMRES, BiCGSTAB, and LSQR selection |
| Repeated tridiagonal, band, or explicit sparse direct solve | Reusable direct factors |
| Selected largest-magnitude eigenpairs | Restarted Lanczos/Arnoldi |
Compatibility IMatrix operations |
AlgebraLib compatibility reference |
| Interpolation, fitting, adaptive integration, vector roots, or ODEs | Numerical modelling selection guide |
| Dense convex QP or second-order cones | Convex optimisation selection guide |
| FFT/block convolution, inference, forests, or Kalman filtering | Applied numerics guide |
| Portable numerical/model persistence, metadata, or bounded expressions | Interchange guide |
| Supported and missing families | Capability inventory |
See the supported platform matrix for compiler, target, and precision qualifications.