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
1
vote
4 answers

java jama array problem

I asked a question before but duffymo said it is not clear so i am going to post it again here. I am using Jama api for SVD calculation. I know very well about jama and SVD. Jama does not work if your column are more than rows. I have this…
user238384
  • 2,396
  • 10
  • 35
  • 36
1
vote
2 answers

Matrix concatenation jama

I need to concatenate two matrixes in JAMA. double[][] m1 = {{1,1,1}, {1,1,1}}; double[][] m2 = {{2,2,2}, {2,2,2}, {2,2,2}}; Matrix mm1 = new Matrix(m1); Matrix mm2 = new Matrix(m2); I want to do the following, Matrix mm3 = [ mm1; mm2; ] //…
Sait
  • 19,045
  • 18
  • 72
  • 99
1
vote
3 answers

How do I fix this ArrayIndexOutOfBounds error in Jama?

I am using jama libarary for matrix. I used following matrix but when i tried to get S, it gave me error. 1.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 11.0 1.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 12.0 …
user238384
  • 2,396
  • 10
  • 35
  • 36
1
vote
0 answers

Dot product and Cross Product of Matrices in Jama

I am using Jama in android. Given two matrices how would you perform the dot product and cross product in Jama? I came across this but uncertain how to implement it.
nette
  • 575
  • 2
  • 8
  • 25
1
vote
1 answer

adding a directory to the Java library path in Eclipse on Ubuntu

I'm transitioning a Java project from Eclipse on Windows to Eclipse on Ubuntu. I have installed the Jama library and found that Ubuntu placed it in /usr/share/java . Now I am trying to make Eclipse find it there. I have read various posts on this…
Jorocco
  • 83
  • 2
  • 9
1
vote
1 answer

JAMA Matrix performance

First of all, sorry for my bad English, but I need your help. I have developed a simulation program with java swing where I have used lots of matrix calculations. My program is just finished but I need to speed up my performance. So I have used the…
blueArrow
  • 11
  • 1
1
vote
1 answer

get eigenvalue pca with java

I try use PCA to reduce dimention, and i use jama for help me using matrix. but, i got problem when get eigenvalue with jama. for example i hava 2 image dimention 100x100, then i create single matrix 2 image x (100x100). there is 20.000 pixel. and…
Paijo S Kom
  • 61
  • 1
  • 6
1
vote
1 answer

List> to double[][] for JAMA or other libs

i cannot get my List> to double[][] to work on linear algebra package like JAMA. Basically i have some sort of List with coordinates like this : [[2.63, 11.087, -12.054], [2.357, 13.026, -15.29], [1.365, 16.691, -15.389], [0.262, 18.241,…
Mantas Marcinkus
  • 603
  • 2
  • 6
  • 11
1
vote
1 answer

Java - using JAMA to create a 3by3 matrix with random values

this is what I have got so far... public static void main(String[] args) { Random random= new Random(); Matrix mR = new Matrix(3,3,random.nextDouble()) ; System.out.println("Here is a 3x3 matrix with random values "…
Poensvah
  • 15
  • 3
1
vote
3 answers

Eigenvalue and the corresponding EigenVector in Java

Given a Matrix, I'm interested in the Eigenvalues and the corresponding Eigenvector. Using Jama, I can get the Eigenvalues and the Eigenvectors, yet the correlation between the two is not defined: I want to map each Eigenvector to the corresponding…
Maoritzio
  • 1,142
  • 2
  • 13
  • 31
1
vote
0 answers

Jama and Commons Math don't give desired result for relatively big matrix

I am using Jama and Apache Commons Math to solve linear algebra equations. They both work fine when the matrix is small (4x4). But not when it is relatively big (25x25). Below are my implemenations: Jama: public double[][] solve(double[][]…
Balkrishna Rawool
  • 1,865
  • 3
  • 21
  • 35
0
votes
1 answer

Multiplying two matrices with Java

I try to multiplying 2 matrices. I tried with R software: check this thread: Multiplying two matrices in R Now i try to do the same thing in Java. I use Jama library for matrix. my power function public Matrix power(Matrix M, double p) { …
robert trudel
  • 5,283
  • 17
  • 72
  • 124
0
votes
1 answer

how to speed up this code? calculus iterating through rows and cols of a matrix

I have a piece of code which performs calculations on a matrix by iterating through its rows and columns. The piece of calculus performed is a cosine distance measure, with a code I found on Internet (could not retrieve the link right now). There…
seinecle
  • 10,118
  • 14
  • 61
  • 120
0
votes
1 answer

Problems with svd in java

I have gone through jama and colt(I code in java) . Both of them expect me to use arrays such that the number of rows are more than the number of coloumns . But in case of the Latent semantic analysis (LSA) i have 5 books and there are a total of…
CTsiddharth
  • 907
  • 12
  • 21
0
votes
1 answer

Calculate the inverse of a matrix using JAMA library

This is my method to calculate the inverse of a matrix (key). I used the JAMA lib for the calculation. public static double[][] inverseKey(int[][] key) { int n = key.length; double[][] keyAsDoubleArray = new double[n][n]; for (int i =…
KayraOz
  • 31
  • 5