Jump to content

Jblas: Linear Algebra for Java

From Alfawiki
Adapted from the English Wikipedia article Jblas: Linear Algebra for Java, available under CC BY-SA 4.0Updated 9 August 2025
jblas
Company typeOpen-source software
IndustryScientific computing, Software development
FounderMikio Braun
ProductsJava linear algebra toolkit

jblas is a Java-based linear algebra toolkit created by Mikio Braun, constructed atop BLAS and LAPACK. Distinct from many Java libraries, jblas leverages native code through the Java Native Interface (JNI) and comes with prebuilt binaries. It detects and loads the correct binary for the operating system automatically, allowing users to start immediately without needing complicated compilation steps. The library provides a user-friendly API that abstracts the intricate details of BLAS and LAPACK.

Since its introduction, jblas has become popular within scientific computing fields, supporting tasks such as text classification, network analysis, and stationary subspace analysis. It is utilized in projects like JLabGroovy and the Universal Java Matrix Library (UJMP). Benchmark tests consistently rank jblas as the leading Java matrix library that employs native code for performance.

Capabilities

The main functionalities offered by jblas include:

  • Eigen – computation of eigendecomposition
  • Solve – resolution of linear systems
  • Singular – singular value decomposition
  • Decompose – LU and Cholesky factorizations
  • Geometry – operations such as centering and normalization

Usage example

Example of performing eigenvalue decomposition: <syntaxhighlight lang="java"> DoubleMatrix[] evd = Eigen.symmetricEigenvectors(matA); DoubleMatrix V = evd[0]; DoubleMatrix D = evd[1]; </syntaxhighlight>

Example of matrix multiplication: <syntaxhighlight lang="java"> DoubleMatrix result = matA.mmul(matB); </syntaxhighlight>

See also