Questions tagged [ejml]

Efficient Java Matrix Library is a linear algebra library for manipulating dense matrices

Efficient Java Matrix Library is a linear algebra library for manipulating dense matrices. Its design goals are:

  1. To be as computationally and memory efficient as possible for both small and large matrices
  2. to be accessible to both novices and experts.

These goals are accomplished by dynamically selecting the best algorithms to use at runtime and by designing a clean API. EJML is free, written in Java and has been released under an LGPL license.

https://code.google.com/p/efficient-java-matrix-library/

37 questions
9
votes
1 answer

DMatrixRMaj: get data in matrix form

When I'm initializing a new DMatrixRMaj in ejml (standard format for real matrix), it can store internally a double[][] matrix. Example double[][] a = new double[][]; //init a DMatrixRMaj d = new DMatrixRMaj(a); //math operations on d now, after…
Lore
  • 1,286
  • 1
  • 22
  • 57
6
votes
1 answer

Matrix indexes with ejml (or other Java libraries)

I'm using ejml library for writing mathematical algorithms in java. I think it is pretty useful, but I need to know if there is a fast mode (like print()) to print a matrix with indexes. Example: 1 2 1 0.00 0.01 2 0.03 0.54 3 3.45 7.88 4 …
Lore
  • 1,286
  • 1
  • 22
  • 57
4
votes
1 answer

Covariance using EJML

I have two double arrays as below double[] x = { 2.5, 0.5, 2.2, 1.9, 3.1, 2.3, 2.0, 1.0, 1.5, 1.1 }; double[] y = { 2.4, 0.7, 2.9, 2.2, 3.0, 2.7, 1.6, 1.1, 1.6, 0.9 }; How do you find the covariance between them using efficient-java-matrix-library…
markjason72
  • 1,653
  • 8
  • 27
  • 47
4
votes
2 answers

Convert matrix back to array in EJML

I have started using the EJML library for representing matrices. I will use the SimpleMatrix. I did not find two important things which I need. Perhaps somebody can help me identify if the following operations are possible and if yes, how this can…
machinery
  • 5,972
  • 12
  • 67
  • 118
3
votes
1 answer

Error when assigning value for matrix element with Equation

I have several simple lines of code in Java using ejml Equation as follows: eq.process("T = zeros(2,3)"); eq.process("T(1,1)=10"); eq.process("T(1,0)=1"); eq.process("T(1,2)=8"); The last line doesn't work, throwing error "Submatrix out of bounds.…
lenhhoxung
  • 2,530
  • 2
  • 30
  • 61
3
votes
1 answer

Matrix multiplication using EJML

double[][] data_array SimpleMatrix dataMatrix = new SimpleMatrix(data_array); SimpleMatrix omegaMatrix = new SimpleMatrix(omega); SimpleMatrix cMatrix = dataMatrix.mult(omegaMatrix); System.out.println("Multiplied"); cMatrix.print(); I am using…
USB
  • 6,019
  • 15
  • 62
  • 93
2
votes
1 answer

Subtract 1 x M matrix from N x M matrix in ejml

Assuming a 1 x M (A) and N x M (B) SimpleMatrix objects in ejml, is there a simple way to subtract A from B? I was looking for a way to repeat the rows of A to be the size of B, but didn't find the method to do this easily. SimpleMatrix A = new…
grovduck
  • 406
  • 5
  • 13
2
votes
1 answer

Exception in thread "main" java.lang.NoClassDefFoundError: org/ejml/simple/SimpleBase

It seems it's missing the Java library Efficient Java Matrix Library(ejml), so I have downloaded from the sources here. I'm creating Maven Jar executable file and running on Openstack EDP Spark environment. I'm having trouble figuring out how to…
2
votes
2 answers

Tansition from ejml to library with sparse matrices

How can i easily make a transition from ejml to another library that supports sparse matrices?
salvador
  • 1,079
  • 3
  • 14
  • 28
2
votes
1 answer

Android - Could not find class ... referenced from

I'm writing my 4th year project and I am trying to add an external library but for some reason I can't seem to get this running. I have been Googling for days and I still can't seem to fix this problem. I have tried the following: 1) I have added…
Makar Emelyanov
  • 167
  • 5
  • 16
1
vote
0 answers

How can I calculate an estimated x'y'z' using input arrays containing nominal and measured data points of the physical coordinate system?

My requirement is to provide a function in Java that uses linear algebra to find a 'calibrated' xyz location within a three-dimensional coordinate frame. The following is the interface I am trying to implement. The arguments can be changed to fit a…
Eric Hansen
  • 187
  • 1
  • 1
  • 10
1
vote
1 answer

Is EJML reshape function efficient in case of sparse matrices?

I would like to change a sparse matrix dimensions dynamically. However, I'm concerned with efficiency. Does this operation copy all the content of the first matrix into a bigger one ? In that case, would it be a better idea to increase matrix…
1
vote
0 answers

SingularMatrixException when solving Linear EquationSystem

I use EJML to solve a linear equation system. EJML uses doubles. My inputs (and expected outputs) are integers. I will omit the .000 from the toString(). My Matrix A looks like this (though it is ~1000x1000): 1 0 0 0 0 1 -1 1 0 0 0 1 -1 1…
JFBM
  • 944
  • 1
  • 11
  • 24
1
vote
2 answers

Initialize a vector in ejml with Matlab-like style

In Mablab/Octave, I can create a new vector with range-style, for example: v = [1:10]; However, when I put it into ejml equation (Java), it doesn't work: eq.process("v = [1:10]"); It only works for explicit initialization like: eq.process("v = [1…
lenhhoxung
  • 2,530
  • 2
  • 30
  • 61
1
vote
1 answer

EJML obtain matrix eigenvectors' real value

I am trying to make a conversion from a non positive definite matrix into a positive definite one in order to be able to make a cholesky decomposition. Working with EJML, which I think is a good library, I have come into a trouble when trying to…
Mikel Urkia
  • 2,087
  • 1
  • 23
  • 40
1
2 3