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
2
votes
2 answers

Issue with Jama's Eigenvalue decomposition function

I am getting a wrong eigen-vector (also checked by running multiple times to be sure) when i am using matrix.eig(). The matrix is: 1.2290 1.2168 2.8760 2.6370 2.2949 2.6402 1.2168 0.9476 2.5179 2.1737 1.9795 2.2828 2.8760 2.5179 8.8114 8.6530…
BHS
  • 991
  • 3
  • 12
  • 26
2
votes
0 answers

JAMA Library Singular Value Decomposition algorithm

Do you know where I can find SVD(Singular Value Decomposition) algorithm which the implementation is found in JAMA (Java Matrix Library)? I have found and downloaded JAMA, and I can see the source code there, but I have difficulty in understanding…
2
votes
1 answer

How to overwrite/update a Jama Matrix in Android Studio without any error?

Jama Matrices are defined in my code (Matrix computation class) as follows: private Matrix A; private Matrix B; private Matrix C; The matrix A is initialized as follows: A = new…
santobedi
  • 866
  • 3
  • 17
  • 39
2
votes
4 answers

Test for invertability using Jama.Matrix

I have a program that uses JAMA and need to test is a matrix can be inverted. I know that I can just try it and catch an exception but that seems like a bad idea (having a catch block as part of the "normal" code path seems to be bad form). A test…
BCS
  • 75,627
  • 68
  • 187
  • 294
2
votes
2 answers

Jama matrix dimensions must agree error even when dimensions are matching

I'm doing some matrix operations in image processing using JAMA. Here, I'm multiplying a matrix with its transpose. For sure it is possible. But I'm receiving the following error: Exception in thread "main" java.lang.IllegalArgumentException: Matrix…
Kush
  • 644
  • 1
  • 12
  • 30
2
votes
1 answer

JAMA: Matrix.times() vs Matrix.arrayTimes()

Whats the difference between JAMA: Matrix.times() vs Matrix.arrayTimes() in JAMA (a java library for matrix calculations) If I have a d dimension vector x and a k dimension vector z and I want to get the xz^T (x into z transpose) should I use…
user77005
  • 1,769
  • 4
  • 18
  • 26
2
votes
1 answer

Different eigenvectors from Wolfram, Octave, Jama

I have the following matrix M = 1 -3 3 3 -5 3 6 -6 4 WolframAlpha command eigenvalues {{1,-3, 3}, {3, -5, 3}, {6, -6, 4}} produces the following eigenvalues: lambda_1 = 4 lambda_2 = -2 lambda_3 = -2 And the following…
appFormation
  • 231
  • 3
  • 13
2
votes
0 answers

Singular Value Decomposition using Java and Jama library

I want to write some code which calculates matrices U, S and V of a matrix using Jama library, in Java. How can I calculate the SVD, but using threads, a thread for every matrix(U, S and V). I'm working with very large matrices,and I need threads…
Ra mi
  • 43
  • 6
2
votes
1 answer

svd error java java null pointer exception

I am writing a little code which is using threads to access the matrixes U, S and V from a matrix A using Jama and svd() method but I'm facing difficulties like Java Null pointer exception. My code is this: public class SVD implements Runnable …
Ra mi
  • 43
  • 6
2
votes
3 answers

Error loading OpenCV in Java for Image Processing

I am facing a problem in loading OpenCV in Java(Eclipse, Mac OSX). I am new to Java and my main target is Image Processing.I have checked several examples online but....I have few queries actually: 0) Can you actually instruct me how to use OpenCV…
2
votes
1 answer

How to calculate pseudoinverse of a matix using JAMA (A Java Matrix Package)?

I am trying to find inverse of a matrix. When it is singular I need to calculate pseudoinverse. I am not able to find anything like pseudoinverse in JAMA doc. How could I compute it ?
Saeed Sharman
  • 765
  • 5
  • 24
2
votes
1 answer

Sigmoid function using Jama math library no output in sigmoidfunction

I'm trying to code my sigmoid function using Jama library. I'm not sure if my code works so i call my sigmoidFunction in my test function: public matrix sigmoidFunction() { matrix theta = new matrix(x_theta,m); matrix X = new matrix(x); …
user3065339
  • 107
  • 8
2
votes
3 answers

how to declare matrix using jama

I am new to Java Programming.I was doing a scientific simulation within which a system of linear equations has to be solved. I work in Eclipse.I downloaded the jama jar file and added to JRE System Library.The problem is when I create a new Matrix…
2
votes
1 answer

Jama - Matrix must be square exception while finding determinant

I am new to using Jama for matrices. My problem is while I'm using det() method (which is related with LUDecomposition class) it gives "Matrix must be square". Ok my matrix is triangle but with LUDecomposition it should give me square matrix. My…
sinan selimoglu
  • 103
  • 1
  • 8
2
votes
1 answer

Singular Matrices and Jama

I am using Jama API for solving a problem with Linear Algebra. But it is giving me an error: java.lang.RuntimeException: Matrix is singular. I suppose when the matrix is singular there are multiple solutions possible. Is there a way in Jama API to…
Balkrishna Rawool
  • 1,865
  • 3
  • 21
  • 35