Registered Member
|
First of all, thanks for all the great efforts to bring forth such a great library.
I am working on a C++ project that involves intensive computation related to computer vision and machine learning, and considering leverage the performance and convenience provided by Eigen. In this project, there are several different libraries. To cooperate with them, I may rely on Eigen's Map class. I am wondering what is the underlying behavior of the mapping. Does it copy all data into an internal representation? or does it just serve as a light wrapper that simply referring to that memory address? or does it do some "smart" things that automatically determine when(or whether) to copy? Another question: Is is allowed to construct a Matrix object with an Map object? (I assumed yes ..) If so, does the construction performs a deep copy? Thank you. |
Moderator
|
A Map only stores references to external memory. On the other hand a Matrix<> object always has its own memory.
double *data = ..; Map<MatrixXd> m(data,rows,cols); m = 2*m; // this uses and modifies data MatrixXd A = m; // deep copy |
Registered Member
|
Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]