Jama:java Matrix Package

Source: Internet
Author: User

SOURCE Link: Jama:java Matrix package API Documentation Link: linear algebra Java PackageJAMA

JAMA is a very useful linear algebra package for Java. Provides an elegant and simple solution for the various matrix operation problems that can be encountered in everyday programming.

Jama:java Matrix Package

Background

JAMA is a basic linear algebra Java package that provides real-number non-sparse matrix classes that programmers can construct to manipulate. For code farmers who often use matrix operations, even if they are not proficient in linear algebra, it is not a matter of fact, because the JAMA package provides sufficient functionality, easy invocation, natural use, and easy to understand. JAMA package is intended to be called Java's Standard matrix package, this standard plan will be submitted to the Java Grande Forum, to the Sun company. Potential competitors of the Java matrix class include the matrix classes implemented by the MathWorks Company and the National Standardization Management Committee (NIST), which we publish to collect comments. Future versions of JAMA are not necessarily compatible with the current version.

NIST and the University of Maryland have developed a similar matrix package: Jampack, the two packages appear, out of the user's need for different implementations of the matrix. JAMA is based on a single matrix class and is a strict object-oriented framework, while the Jampack scheme is more open and user-friendly. For the average user, the two packages differ only at the syntactic level of the matrix operation. We hope you have time to learn about both of these matrix packages, you will certainly benefit.

Function:

JAMA consists of the following 6 classes: Matrix,choleskydecomposition, Ludecomposition, Qrdecomposition, Singularvaluedecomposition and Eigenvaluedecomposition

The Matrix class provides the basic function of linear algebraic numerical operations, and different constructors can construct two-dimensional arrays of double and floating-point precision, while different gets and
The sets method can return sub-matrices and matrix elements. Basic arithmetic operations include matrix addition, matrix multiplication, matrix normalization, and arithmetic operations based on matrix elements. Functions for printing matrices are also included.

The five major decomposition of matrices involves a pair or ternary group, a permutation vector matrix, etc., corresponding to the 5 matrix decomposition classes of JAMA. These decomposition classes can be accessed by the Matrix class, which can solve the linear equations, solve the determinant of square matrices, inverse and other matrix operations. These decomposition classes are as follows:

    • Cholesky decomposition of symmetric positive definite matrices
    • Lu decomposition of matrices (Gaussian elimination)
    • QR Decomposition of matrices
    • Characteristic vector value decomposition of symmetric and asymmetric matrices
    • Singular value decomposition of matrices

Currently JAMA only supports real matrices. Support for complex matrices may be added in the future. Now the complex matrix is not implemented, mainly because there is not much demand for this aspect, so we should not take the complicated risk of redesign.

JAMA's design is a compromise between pure object-oriented ease of use and high-performance computing needs.

JAMA feature summary

Object Actions

Constructors   
set  method   
Get method  
Copy Method
Clone method
operations at the matrix element level matrix addition
Matrix subtraction
Matrix multiplication
Zoom out
element multiplication   
Element Division
Negation
Invert   
Normal form
matrix decomposition

Cholesky&nbs p; 
lu  
qr  
svd  
The eigenvalues of the symmetric matrix
The eigenvalues of an asymmetric matrix

linear equation solution

Non-singular system
least squares

Matrix-related math

Condition number   
determinant
Matrix rank  & nbsp
Inverse
Pseudo-inverse

Use the example below to solve a linear equation ax = b, The matrix size is 3 * 3, and finally the pattern of residual error is calculated.

Double[][] Array = {{1.,2.,3},{4.,5.,6.},{7.,8.,10.}};
Matrix A = new Matrix (array);
Matrix B = matrix.random (3,1);
Matrix x = a.solve (b);
Matrix residual = a.times (x). minus (b);
Double rnorm = Residual.norminf ();

Reference implementation.

The JAMA implementation downloaded from this website can only be implemented as a reference. It is essentially a software package that is instructional in nature. The algorithms in the Wilkinson and Reinsch manuals, such as those used in eispack,linpack and MATLAB, are included in the algorithm. The internal data of the matrices class is stored as the basic array type of Java (for example, double[][]), and the code is readable and easy to understand. While our programs are fast enough for small-to medium-sized data sizes, we very much hope that software vendors and Java virtual machines can do some optimizations for the feature environment.

What's not covered

JAMA is not a complete linear algebra database, for example, we do not provide the characteristic structure of the Matrix class (such as banded matrix, sparse matrix, etc.), also does not implement more specific matrix decomposition classes (such as Shur, pan eigenvalue decomposition, etc.). The complex matrix is also absent. Ignoring these implementations is not our intention. We hope that some of these features (such as complex matrices) will be available in the future version. The purpose of our design is not to seal the future of the road for other extended functions.

Finally, JAMA is not a generic array class, instead it focuses on mathematical operations related to matrix numerical computations. So there is no manipulation of the array, such as sine,exp,log for each element of the matrix, or a transformation matrix. These operations are useful in many applications and are clearly best provided in a separate array class.

Matrix Package Version 1.0.2
    • Document
    • Example
    • source [Zip archive, 105Kb] [gzipped tar file, 77Kb]
    • Jar file [Jama-1.0.2.jar]
    • Update log
Early Capital Preservation
    • Jama-1.0.1 source:jama-1.0.1.tar.gz, Jama-1.0.1.zip
    • Jama-1.0.0 source:jama-1.0.0.tar.gz, Jama-1.0.0.zip

We plan to make JAMA a standard Java library, a standardization that will add numerical computing modules to Java, bringing better portability and performance, and we are happy to hear any feedback from you. Of course, we also know that JAMA is not applicable to all users, but for everyday matrix computing, we believe it will still cater to the needs of most programmers.

discussion Groups . Users can comment on established discussion groups. Comments and suggestions can be sent to [email protected], which are automatically forwarded to JAMA authors, as well as other mail subscribers. If you want to subscribe to mail, please email to [email protected] , including text subscribe JAMA your-name . Subscribe to the mailing list here: Archive of the Discussion.

Jama:java Matrix Package

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.