![]() Registered Member ![]()
|
Hello,
in my project C++ i use some big Eigen-matrices (size: 8000x8000 ...) as global variable. Accordingly to data encapsulation principle in C++ i want to declare these matrices with private and use getter-methods for them. The methods should return reference or pointer to them. I dont have much experience with Eigen, so can anybody please tell me, how to do it efficiently ? Should i also use smart pointers to manage the matrices or are they destroyed automatically without memory leak after going out of their scope in program ? Thank you for any ideas for good design of C++ with Eigen library ! |
![]() Registered Member ![]()
|
|
![]() Registered Member ![]()
|
No, that is different thing.
I have this class, where the matrices are declared and initialized:
I want to build a getter function for my matrix R, the getter function returns the reference to the initialized matrix R. My question is, is the above implementation okay and the most optimal for Eigen Matrix, or is there any better method ? We can use the pointer to the matrix, but then we need also to know the size of data block? |
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]