Efficient Java Matrix Library

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 78.35.255.152 (talk) at 12:21, 12 January 2017 (Updated latest stable release information, removed wrong author link). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Efficient Java Matrix Library
Original author(s)Peter Abeles
Stable release
0.30 / November 9, 2016; 7 years ago (2016-11-09)
Repository
Operating systemCross-platform
TypeLibrary
LicenseApache_License
Websiteejml.org

Efficient Java Matrix Library (EJML) is a Java linear algebra library for manipulating dense 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. EJML is free, written in 100% Java and has been released under the Apache v2.0 license.

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

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 Example (Equations)

Computing the Kalman gain:

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

Usage Example (SimpleMatrix)

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);

Usage Example (DenseMatrix64F)

Example of Singular Value Decomposition (SVD):

SingularValueDecomposition<DenseMatrix64F> svd = 
    DecompositionFactory.svd(matA.numRows,matA.numCols,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.mult(matA,matB,result);

See also

References

  1. ^ "EJML Project Page". EJML. Peter Abeles. Retrieved April 1, 2014.

External links