SimpleMatrix getMatrix().getData() issue

223 Views Asked by At

I am using EJML SimpleMatrix and I get the error The method getData() is undefined for the type Matrix when I try to return a double[] using the following code:

double[] test = result.getMatrix().getData();

Any help is appreciated!

1

There are 1 best solutions below

0
On BEST ANSWER

I needed to import DMatrixRMaj and cast the .getMatrix() to a DMatrixRMaj then use .getData(). See code below

double[] ret = ((DMatrixRMaj)result.getMatrix()).getData();