0

I have a 2d covariance float array of size 10000 by 10000 and i would like to get the eigenvalues by using the eigen libary.For that,i need to store the 2d covariance float array into an eigen matrix A of float type and then use eigensolver to get the eigenvalues however i am having some issues with casting the covariance array,

I attempted to cast it as shown below but there is an error,

float *Covariance[10000][10000];
MatrixXf A = Map<MatrixXf>(Covariance[10000][10000], 10000, 10000);

cout << "Here is the Covariance Matrix, A:" << A << endl;

I would like to know how else can the mapping be done?

MOUSE
  • 1
  • 1

1 Answers1

0

if you want a deep copy:

MatrixXf A = Map<MatrixXf>(Covariance, 10000, 10000);

or just an read-write view:

Map<MatrixXf> A(Covariance, 10000, 10000);
ggael
  • 28,425
  • 2
  • 65
  • 71