Jump to content

SuanShu numerical library

From Alfawiki
Adapted from the English Wikipedia article SuanShu numerical library, available under CC BY-SA 4.0Updated 9 August 2025
SuanShu
Company typeOpen-source software
IndustrySoftware development
Area served
Worldwide
ProductsJava mathematics library for numerical computation, statistical evaluation, and optimization

SuanShu is an open-source Java mathematics library licensed under the Apache License 2.0 and hosted on GitHub. It provides a broad suite of Java classes designed for tasks in numerical computation, statistical evaluation, and optimization processes. Among its capabilities, SuanShu incorporates a parallelized version of the adaptive Strassen algorithm to accelerate matrix multiplication, thereby improving performance. This library has been referenced and applied in numerous scholarly and scientific studies, highlighting its dependability and practical use.

Features

  • Linear algebra operations
  • Solving equations for roots
  • Curve fitting alongside interpolation methods
  • Optimization with both constrained and unconstrained variables
  • Statistical computations
  • Linear regression analysis
  • Probability distribution modeling and random number generation
  • Solvers for ordinary and partial differential equations

License terms

SuanShu is released under the Apache License 2.0.

Examples of usage

Unlike many traditional numerical libraries written in FORTRAN or C that follow procedural paradigms, this library uses an object-oriented approach. For instance, performing minimization can be done as shown below:

<syntaxhighlight lang="java" line="1"> LogGamma logGamma = new LogGamma(); // instantiate log-gamma function BracketSearchMinimizer solver = new BrentMinimizer(1e-8, 10); // set precision and iteration limit UnivariateMinimizer.Solution soln = solver.solve(logGamma); // execute optimization double x_min = soln.search(0, 5); // define search interval [0, 5] System.out.println(String.format("f(%f) = %f", x_min, logGamma.evaluate(x_min))); </syntaxhighlight>

See also

References