Java matrix operations, JAMA Package

Source: Internet
Author: User

JAMA is a basic linear algebra Java package. Includes a basic matrix class and 5 matrix decomposition classes.

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 sets methods 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:

1. Cholesky decomposition of symmetric positive definite matrices

2, the matrix of LU decomposition (Gaussian elimination element)

3. QR Decomposition of matrices

4. Characteristic vector value decomposition for symmetric and asymmetric matrices

5. Singular value decomposition of matrices

JAMA function Summary such as


Use an example (first to introduce Jama.1.0.3.jar):

Import Jama.matrix;public class Matrix_test {public static void main (string[] args) {double[][] a = {{1,1,0},{0,1,0},{0,0, 1}};//creating matrices using two-dimensional arrays matrix matrix = new Matrix (a);//print matrix, the first parameter is the width of each column, the second parameter is the number of decimal places reserved Matrix.print (3, 2);// The inverse matrix.inverse of the matrix (). print (3,2);//to transpose The Matrix Matrix.transpose (). print (3,2);//Matrix multiplication matrix.transpose (). times (Matrix). Print (3,2);}}


Reference documents:

JAMA Jar Package: http://math.nist.gov/javanumerics/jama/

Official Document Address: http://math.nist.gov/javanumerics/jama/doc/

Jama:java Fabric Bundle: http://article.yeeyan.org/view/49656/40905

Java matrix operations, JAMA Package

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.