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
1 answer

Problems using Jama in java for LSA

i am making using of the jama package for finding the lsa . I was told to reduce the dimensionality and hence i have reduced it to 3 in this case and i reconstruct the matrix . But the resultant matrix is very different from the one i had given to…
CTsiddharth
  • 907
  • 12
  • 21
1
vote
3 answers

How to multiply two 1D matrices using JAMA?

This may be a bit of a silly question and I might also have misunderstood the best way to approach this problem but what I essentially want to do is the following: I want to multiply the following matrices together to get the result -0.8. However I…
user843337
1
vote
0 answers

Java linear algebra libraries results are incorrect

I have an algorithm implemented in Python uses numpy library for linear algebra. I want to implement it in Java for Android app, I tried many libraries like Jama. The algorithm for check if a set of 3D points has the same pattern of another…
1
vote
0 answers

How to reset or flush the Jama Matrix in Android Studio?

I need to reset or flush the Jama Matrix before overwriting it to prevent the following error (suggested here). java.lang.IllegalArgumentException: Matrix inner dimensions must agree. I could not find any way to flush the Jama Matrix. If there any…
santobedi
  • 866
  • 3
  • 17
  • 39
1
vote
1 answer

Jama matrix and Logical error in if else statement in java

I try to implement some code block.I have four array. double[]timea={1.0,2.0,3.0,4.0,5.0,6.0}; double[]speed={11.0,12.0,8.0,13.0,9.0,6.0}; double[]timeb={1.5,2.5,4.0,5.5}; double[]speedb={12.3,8.5,6.9,7.8}; 1st array define some…
Saswati
  • 192
  • 8
1
vote
1 answer

JAMA setMatrix documentation need to set a submatrix in given matrix

Can anyone tell me about JAMA MATRIX Package how setMatrix work? Please don't suggest me to see the documentation. I search documentation several time but don't get any example how it work. I have code where I want to set a submatrix with desired…
Encipher
  • 1,370
  • 1
  • 14
  • 31
1
vote
1 answer

java.lang.IllegalArgumentException: Matrix inner dimensions must agree

Here is my code: package algorithms; import Jama.Matrix; import java.io.File; import java.util.Arrays; public class ThetaGetter { //First column is one, second is price and third is BHK private static double[][] variables = { …
Aadit Kolar
  • 75
  • 1
  • 9
1
vote
0 answers

simple neural_network program by java

import java.lang.Math; import Jama.Matrix; import java.util.Random; import java.io.File; import java.io.FileNotFoundException; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class Neural_Network { …
minwoo
  • 11
  • 2
1
vote
2 answers

Computing the complex eigenvectors of a sparse matrix in Java

I am trying to compute the eigenvalues and eigenvectors of a potentially large and sparse non-symmetrical NxN matrix (N > 10^6). I would not need all of them, but maybe the first of them. Ideally, I'd like to do so from Java but could move to C,…
1
vote
0 answers

JAMA : Matrix is rank deficient

I'm having trouble with a linear-algebra problem. I've got 2 Matrices K (1034*1037) and T (1034*2) and I want to compute the solution W (1037*2) of KW=T. But k.solve(t) returns the following error: Exception in thread "main"…
AdrienW
  • 3,092
  • 6
  • 29
  • 59
1
vote
0 answers

How to set String variable in an Matrix using JAMA?

I try to solve binomial equation (d= a0 + a1 * t + a2 * t*t) by least square adjustment (Xcap=(A^T A)^-1 A^T L). I use "JAMA" lib. to construct and calculate matrices (A: design matrix, Xcap: Unknown parameters matrix and L : measurment matrix). So,…
Arash m
  • 99
  • 2
  • 12
1
vote
1 answer

Java JAMA Incompatible Cannot be Converted Error

I'm trying to write a code that allows me to create a 2x2 matrix, then use the JAMA library (http://math.nist.gov/javanumerics/jama/) to calculate the eigenvalues and eigenvectors of the matrix I just created. Then, I'll compare eigenvalues with the…
1
vote
1 answer

Modular inverse of a matrix in Java

I'm trying to work out the modular inverse of a matrix, how could this be done in Java? So far I've found the package Jama package - http://math.nist.gov/javanumerics/jama/ Can be used for inverse and matrix multiplication, however I'm stumped…
Java Noob
  • 67
  • 1
  • 6
1
vote
0 answers

Two dimensional array with million rows and columns

I have a user-event data with user ratings for events user has attended.I am trying to use Jama library for similarity matrix which needs two dimensional array as input (users-event matrix with event ratings) the data i have as three columns : …
aman
  • 1,875
  • 4
  • 18
  • 27
1
vote
1 answer

JAMA is not calculating the right eigen vectors

I have the following matrix, which is symmetric and real (It is a hamilton-operator): (Matlab friendly) [63.000000, -1.732051, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000; -1.732051, 61.000000, -2.000000, 0.000000,…
gedemagt
  • 657
  • 1
  • 9
  • 22