SimpleMatrix getMatrix().getData() issue

189 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 answers

0
Jkim045 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();