Jblas: Linear Algebra for Java

Last updated
Jblas: Linear Algebra for Java
Original author(s) Mikio L. Braun
Stable release
1.2.4 / May 12, 2015 (2015-05-12)
Operating system Cross-platform
Type Library
License BSD Revised
Website jblas.org

jblas is a linear algebra library, created by Mikio Braun, for the Java programming language built upon BLAS and LAPACK. Unlike most other Java linear algebra libraries, jblas is designed to be used with native code through the Java Native Interface (JNI) and comes with precompiled binaries. When used on one of the targeted architectures, it will automatically select the correct binary to use and load it. This allows it to be used out of the box and avoid a potentially tedious compilation process. jblas provides an easier to use high level API on top of the archaic API provided by BLAS and LAPACK, removing much of the tediousness.

Contents

Since its initial release, jblas has been gaining popularity in scientific computing. With applications in a range of applications, such as text classification, [1] network analysis, [2] and stationary subspace analysis. [3] It is part of software packages, such as JLabGroovy, [4] and Universal Java Matrix Library (UJMP). [5] In a performance study of Java matrix libraries, [6] jblas was the highest performing library, when libraries with native code are considered.

Capabilities

The following is an overview of jblas's capabilities, as listed on the project's website:

Usage example

Example of Eigenvalue Decomposition:

DoubleMatrix[]evd=Eigen.symmetricEigenvectors(matA);DoubleMatrixV=evd[0];DoubleMatrixD=evd[1];

Example of matrix multiplication:

DoubleMatrixresult=matA.mmul(matB);

See also

Related Research Articles

In computer science, array programming refers to solutions that allow the application of operations to an entire set of values at once. Such solutions are commonly used in scientific and engineering settings.

<span class="mw-page-title-main">LAPACK</span> Software library for numerical linear algebra

LAPACK is a standard software library for numerical linear algebra. It provides routines for solving systems of linear equations and linear least squares, eigenvalue problems, and singular value decomposition. It also includes routines to implement the associated matrix factorizations such as LU, QR, Cholesky and Schur decomposition. LAPACK was originally written in FORTRAN 77, but moved to Fortran 90 in version 3.2 (2008). The routines handle both real and complex matrices in both single and double precision. LAPACK relies on an underlying BLAS implementation to provide efficient and portable computational building blocks for its routines.

Basic Linear Algebra Subprograms (BLAS) is a specification that prescribes a set of low-level routines for performing common linear algebra operations such as vector addition, scalar multiplication, dot products, linear combinations, and matrix multiplication. They are the de facto standard low-level routines for linear algebra libraries; the routines have bindings for both C and Fortran. Although the BLAS specification is general, BLAS implementations are often optimized for speed on a particular machine, so using them can bring substantial performance benefits. BLAS implementations will take advantage of special floating point hardware such as vector registers or SIMD instructions.

dnAnalytics is an open-source numerical library for .NET written in C# and F#. It features functionality similar to BLAS and LAPACK.

The ScaLAPACK library includes a subset of LAPACK routines redesigned for distributed memory MIMD parallel computers. It is currently written in a Single-Program-Multiple-Data style using explicit message passing for interprocessor communication. It assumes matrices are laid out in a two-dimensional block cyclic decomposition.

<span class="mw-page-title-main">Template Numerical Toolkit</span>

The Template Numerical Toolkit is a software library for manipulating vectors and matrices in C++ created by the U.S. National Institute of Standards and Technology. TNT provides the fundamental linear algebra operations. TNT is analogous to the BLAS library used by LAPACK. Higher level algorithms, such as LU decomposition and singular value decomposition, are provided by JAMA, also developed at NIST, which uses TNT.

JAMA is a software library for performing numerical linear algebra tasks created at National Institute of Standards and Technology in 1998 similar in functionality to LAPACK.

Numerical linear algebra, sometimes called applied linear algebra, is the study of how matrix operations can be used to create computer algorithms which efficiently and accurately provide approximate answers to questions in continuous mathematics. It is a subfield of numerical analysis, and a type of linear algebra. Computers use floating-point arithmetic and cannot exactly represent irrational data, so when a computer algorithm is applied to a matrix of data, it can sometimes increase the difference between a number stored in the computer and the true number that it is an approximation of. Numerical linear algebra uses properties of vectors and matrices to develop computer algorithms that minimize the error introduced by the computer, and is also concerned with ensuring that the algorithm is as efficient as possible.

Armadillo is a linear algebra software library for the C++ programming language. It aims to provide efficient and streamlined base calculations, while at the same time having a straightforward and easy-to-use interface. Its intended target users are scientists and engineers.

Intel oneAPI Math Kernel Library is a library of optimized math routines for science, engineering, and financial applications. Core math functions include BLAS, LAPACK, ScaLAPACK, sparse solvers, fast Fourier transforms, and vector math. That is besides the math.h standard C library, that is also more accurate compared to glibc.

The following tables provide a comparison of linear algebra software libraries, either specialized or general purpose libraries with significant linear algebra coverage.

Colt is a set of open-source Libraries for High Performance Scientific and Technical Computing written in Java and developed at CERN. Colt was developed with a focus on High Energy Physics, but is applicable to many other problems. Colt was last updated in 2004 and its code base has been incorporated into the Parallel Colt code base, which has received more recent development.

<span class="mw-page-title-main">Eigen (C++ library)</span>

Eigen is a high-level C++ library of template headers for linear algebra, matrix and vector operations, geometrical transformations, numerical solvers and related algorithms. Eigen is open-source software licensed under the Mozilla Public License 2.0 since version 3.1.1. Earlier versions were licensed under the GNU Lesser General Public License. Version 1.0 was released in Dec 2006.

IT++ is a C++ library of classes and functions for linear algebra, numerical optimization, signal processing, communications, and statistics. It is being developed by researchers in these areas and is widely used by researchers, both in the communications industry and universities. The IT++ library originates from the former Department of Information Theory at the Chalmers University of Technology, Gothenburg, Sweden.

Matrix Toolkit Java (MTJ) is an open-source Java software library for performing numerical linear algebra. The library contains a full set of standard linear algebra operations for dense matrices based on BLAS and LAPACK code. Partial set of sparse operations is provided through the Templates project. The library can be configured to run as a pure Java library or use BLAS machine-optimized code through the Java Native Interface.

Parallel Colt is a set of multithreaded version of Colt. It is a collection of open-source libraries for High Performance Scientific and Technical Computing written in Java. It contains all the original capabilities of Colt and adds several new ones, with a focus on multi-threaded algorithms.

oj! Algorithms or ojAlgo, is an open source Java library for mathematics, linear algebra and optimisation. It was first released in 2003 and is 100% pure Java source code and free from external dependencies. Its feature set make it particularly suitable for use within the financial domain.

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.

References

  1. C. Dharmadhikar, Shweta; Maya Ingle; Parag Kulkarn (July 2012). "A Novel Multi label Text Classification Model using Semi supervised learning". International Journal of Data Mining & Knowledge Ma Nagement Process (IJDKP). 2 (4).
  2. Davis, Nicholas; Ahwan Pandey; B. A. McKinney (2011). "Real-world comparison of CPU and GPU implementations of SNPrank: a network analysis tool for GWAS". Bioinformatics. 27 (2): 284–285. doi:10.1093/bioinformatics/btq638. PMC   3018810 . PMID   21115438.
  3. Muller, Jan Saputra; Paul von Bunau; Frank C. Meinecke; Franz J. Kiraly; Klaus-Robert Muller (2011). SSA Toolbox 1.3 Manual (PDF). Retrieved September 25, 2013.
  4. Papadimitriou, Stergios. "JLabGroovy" . Retrieved September 23, 2013.
  5. Arndt, Holger. "Universal Java Matrix Package" . Retrieved September 25, 2013.
  6. Abeles, Peter. "Java Matrix Benchmark" . Retrieved September 23, 2013.