Questions tagged [jama]

JAMA is a basic linear algebra package for Java. It provides user-level classes for constructing and manipulating real, dense matrices.

JAMA is a basic linear algebra package for Java, providing user-level classes for constructing and manipulating real, dense matrices. It is meant to provide sufficient functionality for routine problems, packaged in a way that is natural and understandable to non-experts. It is intended to serve as the standard matrix class for Java, and will be proposed as such to the Java Grande Forum and then to Sun.

Capabilities

JAMA is comprised of six Java classes: Matrix, CholeskyDecomposition, LUDecomposition, QRDecomposition, SingularValueDecomposition and EigenvalueDecomposition.

The Matrix class provides the fundamental operations of numerical linear algebra. Various constructors create matrices from two dimensional arrays of double precision floating point numbers. Various gets and sets provide access to submatrices and matrix elements. The basic arithmetic operations include matrix addition and multiplication, matrix norms and selected element-by-element array operations. A convenient matrix print method is also included.

Five fundamental matrix decompositions, which consist of pairs or triples of matrices, permutation vectors, and the like, produce results in five decomposition classes. These decompositions are accessed by the Matrix class to compute solutions of simultaneous linear equations, determinants, inverses and other matrix functions. The five decompositions are:

  • Cholesky Decomposition of symmetric, positive definite matrices
  • LU Decomposition (Gaussian elimination) of rectangular matrices
  • QR Decomposition of rectangular matrices
  • Eigenvalue Decomposition of both symmetric and nonsymmetric square matrices
  • Singular Value Decomposition of rectangular matrices
100 questions
5
votes
1 answer

Colored Pixels Appearing When Trying to Compress Image (pics included)

I'm trying to compress a given image using Singular Value Decomposition. I thought I had it, until I noticed that I keep getting garbage colored pixels appearing throughout the process. The number shown at the top right shows the number of…
Justian Meyer
  • 3,623
  • 9
  • 35
  • 53
5
votes
3 answers

How can I multiply a matrix by a vector using JAMA?

I'm trying to create a vector from an array of doubles. I then want to multiply this vector by a matrix. Does anyone know how I can achieve this? Below is a really simple example that I would like to get working. // Create the matrix (using…
user843337
5
votes
1 answer

Why does the Jama matrix inner dimension agree in the first iteration, but later it does not?

Following Jama Matrices are defined in my code: P: 3*3 Matrix I: 3*3 identity Matrix K: 3*2 Matrix H: 2*3 Matrix Q: 3*3 Matrix Following is my code snippet: private Matrix getP() { P= (I.minus(K.times(H))).times(Q); Log.d("csv", "P…
santobedi
  • 866
  • 3
  • 17
  • 39
4
votes
3 answers

How do i print the columns of a JAMA matrix?

I use the JAMA.matrix package..how do i print the columns of a matrix
user64480
  • 43
  • 1
  • 4
4
votes
4 answers

java jama matrix problem

I am using jama to calculate SVD. It work very good. If i pass square matrix. For example 2x2 or 3x3 etc. matrix. But when I pass some thing like this 2x3 or 4x8 it give error . I used all of their example. They have different constructor to…
user238384
  • 2,396
  • 10
  • 35
  • 36
3
votes
2 answers

Java SVD with JAMA or else

I have a cloud of Points and I need the best fitting Line. I'm using JAMA but I don't know why, something is not working. Probably it's me who doesn't get how it works. I have a Nx3 Matrix (this is what JAMA svd supports) and I get the right Matrix…
G4bri3l
  • 4,996
  • 4
  • 31
  • 53
3
votes
3 answers

Exception in thread "main" java.lang.RuntimeException: Matrix is singular

I'm just trying to create an inverse matrix of a 3x3 matrix following JAMA documentation. But every time it's giving me the following error - Exception in thread "main" java.lang.RuntimeException: Matrix is singular Can anyone help me in this…
Pow
  • 1,377
  • 10
  • 32
  • 56
3
votes
1 answer

BigDecimal data type Vs Double

There is a class written by Jama Matrix in Java. The class is like that public Matrix (int m, int n, double s) { this.m = m; this.n = n; A = new double[m][n]; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { A[i][j] =…
Saswati
  • 192
  • 8
3
votes
4 answers

Java Jama matrix

I am working with Jama Matrix. I used it for LSI. It works all fine. However, when I pass a big matrix like, 8000x8000 it kills my whole system. I am simply calling SVD then reducing matrix size and adding up. Nothing else ! Any idea? How can I…
Tweet
  • 678
  • 2
  • 10
  • 26
3
votes
1 answer

How do you import JAMA in java?

How do you import JAMA in java? I keep getting errors when I try to import it.
Kat42912
  • 41
  • 1
  • 6
3
votes
1 answer

Jama and Matlab LMNN and eigenvalues

I changed LMNN (Largest Margin Nearest Neighbor) metric learning algorithm matlab code to java, and use Jama library. I got different result, The difference occurred, I think because of the eigenValue decomposition (eigenvalue and eigenvector) in…
saha
  • 93
  • 1
  • 5
  • 11
3
votes
2 answers

Singular Value Decomposition: Different results with Jama, PColt and NumPy

I want to perform Singular Value Decomposition on a large (sparse) matrix. In order to choose the best(most accurate) library, I tried replicating the SVD example provided here using different Java and Python libraries. Strangely I am getting…
user2588219
  • 31
  • 1
  • 2
3
votes
0 answers

Android: Libraries to work with Matrix

I need to work with matrix in Android and I'm not sure about what library would be better. I have seen some examples using JAMA, but I read this other question on here: Performance of Java matrix math libraries? And I could see JAMA is quite old…
Ignacio Alorre
  • 7,307
  • 8
  • 57
  • 94
3
votes
1 answer

java matrix exp(A) calculating the exponential with a matrix

I'm trying to calculate the function e^AT, of which A is a matrix and T is a double value. I have tried using both jama and colt/cern, however a have not found their respective functions. Could any one help me with that?
Fred
  • 417
  • 6
  • 14
2
votes
2 answers

Matrix multiplication using Jama library

I want to multiply 2 matrix using Jama library but it returns: A col: 4 row: 4 B col: 1 row: 4 Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Matrix dimensions must agree. My code: double[][] arrA = { {1,0,0,0}, {0,…
Tomasz Gutkowski
  • 1,388
  • 4
  • 20
  • 28
1
2 3 4 5 6 7