[Trilinos-Users] Different type RCPs on same data

Holger Brandsmeier holger.brandsmeier at sam.math.ethz.ch
Mon Aug 27 02:15:27 MDT 2012


Dear list,

I have a list of values stored as `linearList`, an ArrayRCP<double>.
Now I have a function that returns the same list of values as
`tensorList`, an RCP of boost::multi_array_ref<double, dim>. For dim=2
that would be interpreted as a matrix, otherwise a tensor.

How do I have to setup the RCP of multi_array_ref so that no matter if
`linearList` or `tensorList` is destroyed first, I don't get memory
leaks nor memory corruptions.

Best regards,
Holger

-- 
Holger Brandsmeier, SAM, ETH Zürich
http://www.sam.math.ethz.ch/people/bholger




More information about the Trilinos-Users mailing list