Java matrix package

Source: Internet
Author: User

Jama: Java matrix package

Background

Jama is a basic linear algebra Java package that provides real-number non-sparse matrix classes that can be constructed and manipulated by programmers. For coders who often use matrix operations, even if they are not proficient in linear algebra, it does not matter because the functions provided by the Jama package are sufficient, convenient to call, natural to use, and easy to understand. The JAMA package is intended to be called the standard matrix package of Java, which will be submitted to the Java Grande forum and handed over to sun. The potential competitors of the Java matrix class include the matrix class implemented by Mathworks and the National Standardization Administration Commission (NIST). We released this version for wide discussion. In the future, the new version of Jama may not be compatible with the current version.

NIST and the University of Maryland once developed a similar matrix package: jampack, which emerged out of the different implementation requirements of the matrix. Based on a single matrix class, JAMA is a strict object-oriented framework. The jampack solution is more open and easy to expand. For general users, the two packages only differ in the syntax of matrix operations. We hope that you will benefit a lot from learning about these two matrix packages at the same time.

Function:

Jama consists of the following six classes: matrix, choleskydecomposition, ludecomposition, qrdecomposition, singularvaluedecomposition and eigenvaluedecomposition

The matrix class provides basic linear algebra numeric operations. different constructors can construct two-dimensional arrays with double and floating-point precision, while different gets and
The sets method returns the child matrix and matrix elements. Basic arithmetic operations include matrix addition, matrix multiplication, matrix paradigm, and matrix element-based arithmetic operations. The print matrix function is also included.

The five major decomposition of a matrix involves one or three tuples, and arrange vector matrices. They correspond to the five matrix decomposition classes of Jama. These decomposition classes can be accessed by the matrix class. They can solve linear equations, solve the matrix determinant, and obtain inverse and other matrix operations. These decomposition classes are as follows:

  • Cholesky Decomposition of symmetric positive definite matrix
  • Lu decomposition of the matrix (Gaussian elimination element)
  • Matrix QR decomposition
  • Feature vector decomposition of symmetric and asymmetric phalanx
  • Singular Value Decomposition of a Matrix

Currently, JAMA only supports real number matrices. The support for the complex matrix may be added in the future. At present, the complex matrix is not implemented, mainly because there are not many requirements in this regard, so we will not risk the re-design.

Jama's design is actually a compromise between object-oriented ease of use and high-performance computing requirements.

 

Jama function Summary

Object operations
Constructor
Set Method
Get Method
Copy Method
Clone Method
Matrix Element-level operations Matrix Addition
Matrix Subtraction
Matrix Multiplication
Zoom in and out
Element Multiplication
Element division
Reverse Lookup
Invert
Paradigm
Matrix decomposition

Cholesky
Lu
Qr
SVD
Feature value of symmetric matrix
Feature value of asymmetric matrix

Linear equation solving

Non-singular system
Least Squares

Matrix-related mathematical quantity

Condition count
Determinant
Matrix Rank
Inverse
Pseudo-Inverse

 

The following example is used to solve a linear equation Ax = B with a matrix scale of 3x3. Finally, the residual paradigm 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 ();

See Implementation.

The JAMA implementation downloaded from this website can only be used as a reference. It is essentially a teaching software package. The algorithms are used in Wilkinson and Reinsch manuals, such as the algorithms used in eispack, linpack, and Matlab. The internal data storage of the matrices class is the basic array type of Java (for example, double [] []). The Code is highly readable and easy to understand. Although our programs are fast enough for small and medium-sized data, we still hope that software vendors and Java virtual machines can optimize the feature environment.

Uncovered content

Jama is not a complete linear algebra library. For example, we have not provided a matrix class for feature structures (such as band matrix and sparse matrix ), there are no more specific matrix decomposition classes (such as Shur and extensive feature value decomposition ). The plural matrix is not in the matrix. Ignoring these implementations is not our intention. We hope that some functions (such as the plural matrix) will be available in the future ). The purpose of our design is not to block the future expansion of other functions.

Last, JAMA is not a general array class. On the contrary, it mainly focuses on mathematical operations related to matrix numerical calculation. Therefore, there are no operations on arrays, such as sine, exp, log, or deformation matrix for each element of the matrix. These operations are useful in many applications, and they are best provided in a separate array class.

Matrix package 1.0.2
  • Document
  • Example
  • Source code [ZIP Archive, 105kb] [gzipped tar file, 77kb]
  • JAR file [Jama-1.0.2.jar]
  • Update log
Early warranty
  • 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 into a java standard library. This standardization will add a numerical computing module to Java to improve portability and performance. We are happy to hear any feedback from you. Of course, we also know that Jama does not apply to all users, but for daily matrix computing, we believe it will meet the needs of most programmers.

Discussion GroupUsers can comment. Comments and suggestions in established discussion groups can be sent to the jama@nist.gov, which will automatically forward to the authors of JAMA and other mail subscribers. If you want to subscribe to the mail, please send an email to the listproc@nist.gov, containing the textSubscribe Jama Your-Name. Subscribe to the Mail list here: archive of the discussion.

The rest will not be turned over.

[Note: NIST will not use the email addresses provided for any purpose other than the maintenance of this discussion list. particle may remove themselves at any time by sending an email message to listproc@nist.gov containing the textUnsubscribe JamaIn the message body. See the NIST privacy policy.]

 

 

Authors

 

Jama's initial design, as well as this reference implementation, was developed

 

 

Joe hicklin
Cleve Moler
Peter Webb

...From the Mathworks 
Ronald F. boisvert
Bruce Miller
Roldan Pozo
Karin Remington

...From NIST

Copyright Notice This software is a cooperative product of the Mathworks and the National Institute of Standards and Technology (NIST) which has been released to the public domain. neither the Mathworks nor NIST assumes any responsibility whatsoever for its use by other Parties, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic.

  • Java for Computational Science and Engineering
  • Java numerics Working Group
  • NIST mathematical and computational Sciences Division

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.