Re: [eigen] Eigen with Boost::smart_ptr

[ Thread Index | Date Index | More Archives ]


On 08.11.2011 13:07, Sathishkumar Duraisamy wrote:
Hi all,

I am in some kind of signal processing application. To manage and
manipulate data, I have been using Eigen Matrix.

Can you please give me some recommendation for using pointers for
dynamically allocated eigen matrix?

I guess you need to be a bit more specific for that ...
Maybe you don't need to dynamically allocate your matrices at all, since Eigen::MatrixXd already dynamically allocate their memory.

Side note: That might actually be a nice feature, having kind-of a shared matrix, i.e. multiple instances of the same matrix share the same memory until the matrix is modified, in which case it allocates new memory (unless of course it is the last instance using that memory).

Is it possible to use  boost::smart_ptr and boost::pointer_container
with Eigen Matrix. In case, which is good smart_ptr, shared_ptr or
week ptr?

I can't see a reason why it is not possible.

smart_ptr is just the name of the library, isn't it?
W.r.t shared_ptr vs weak_ptr: you can construct weak_ptr only from shared_ptr, so you need at least one shared_ptr per matrix anyways. What's better afterwards depends on what you are planning to do.


Dipl.-Inf. Christoph Hertzberg
Cartesium 0.051
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: (+49) 421-218-64252

Mail converted by MHonArc 2.6.19+