Location : Home >> Wikipedia >> Efficient Java Matrix Library

Search Wikipedia

Efficient Java Matrix Library

From Wikipedia, licensed under CC BY-SA 4.0. View the original article on Wikipedia.

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
The topic of this article may not meet Wikipedia's notability guidelines for products and services. Please help demonstrate the notability of the topic by citing reliable secondary sources that are independent of the topic and provide significant coverage of it beyond a mere trivial mention. If notability cannot be shown, the article is likely to be merged, redirected, or deleted.
Find sources: "Efficient Java Matrix Library" – news · newspapers · books · scholar · JSTOR
(January 2023) (Learn how and when to remove this message)
A major contributor to this article appears to have a close connection with its subject. It may require cleanup to comply with Wikipedia's content policies, particularly neutral point of view. Please discuss further on the talk page.
See our advice if the article is about you and read our scam warning in case someone asks for money to edit this article.
(January 2023) (Learn how and when to remove this message)
(Learn how and when to remove this message)
Efficient Java Matrix Library
Original authorPeter Abeles
Stable release
0.46.1 / July 31, 2026; 3 months ago (2026-07-31)[1]
Operating systemCross-platform
TypeLibrary
LicenseApache License
Websiteejml.org
Repository

Efficient Java Matrix Library (EJML) is a linear algebra library for manipulating real/complex/dense/sparse matrices. Its design goals are; 1) to be as computationally and memory efficient as possible for both small and large matrices, and 2) to be accessible to both novices and experts. These goals are accomplished by dynamically selecting the best algorithms to use at runtime, clean API, and multiple interfaces. EJML is free, written in 100% Java and has been released under an Apache v2.0 license.

EJML has three distinct ways to interact with it: 1) Procedural, 2) SimpleMatrix, and 3) Equations. The procedural style provides all capabilities of EJML and almost complete control over matrix creation, speed, and specific algorithms. The SimpleMatrix style provides a simplified subset of the core capabilities in an easy-to-use flow-styled object-oriented API, inspired by JAMA. The Equations style provides a symbolic interface, similar in spirit to Matlab and other CAS, that provides a compact way of writing equations.[2]

Capabilities

EJML provides the following capabilities for dense matrices.

  • Basic Operators (addition, multiplication, ... )
  • Matrix Manipulation (extract, insert, combine, ... )
  • Linear Solvers (linear, least squares, incremental, ... )
  • Decompositions (LU, QR, Cholesky, SVD, Eigenvalue, ...)
  • Matrix Features (rank, symmetric, definitiveness, ... )
  • Random Matrices (covariance, orthogonal, symmetric, ... )
  • Different Internal Formats (row-major, block)
  • Unit Testing

Usage examples

Equation style

Computing the Kalman gain:

eq.process("K = P*H'*inv( H*P*H' + R )");

Procedural style

Computing Kalman gain:

mult(H, P, c);
multTransB(c, H, S);
addEquals(S, R);
if (!invert(S, S_inv))
    throw new RuntimeException("Invert failed");
multTransA(H, S_inv, d);
mult(P, d, K);

SimpleMatrix style

Example of singular value decomposition (SVD):

SimpleSVD s = matA.svd();
SimpleMatrix U = s.getU();
SimpleMatrix W = s.getW();
SimpleMatrix V = s.getV();

Example of matrix multiplication:

SimpleMatrix result = matA.mult(matB);

DecompositionFactory

Use of a DecompositionFactory to compute a Singular Value Decomposition with a Dense Double Row Major matrix (DDRM):[3]

SingularValueDecomposition_F64<DenseMatrix64F> svd = 
    DecompositionFactory_DDRM.svd(true, true, true);

if (!DecompositionFactory.decomposeSafe(svd, matA))
    throw new DetectedException("Decomposition failed.");

DenseMatrix64F U = svd.getU(null, false);
DenseMatrix64F S = svd.getW(null);
DenseMatrix64F V = svd.getV(null, false);

Example of matrix multiplication:

CommonOps_DDRM.mult(matA, matB, result);

See also

References

  1. ^ "Central Repository: org/ejml/ejml-core". Maven Central. Retrieved 15 November 2026.
  2. ^ "EJML Project Page". EJML. Peter Abeles. Retrieved Jan 21, 2019.
  3. ^ "Matrix Decompositions - Efficient Java Matrix Library". ejml.org. Retrieved 2021-04-24.

External links

Text is from Wikipedia, licensed under CC BY-SA 4.0. A link to the original article is included on every page. Original article. Search Wikipedia on nomadlouie.com.