Jkim045
Jkim045

Reputation: 55

SimpleMatrix getMatrix().getData() issue

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!

Upvotes: 0

Views: 213

Answers (1)

Jkim045
Jkim045

Reputation: 55

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

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

Upvotes: 2

Related Questions