help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] gsl_vector memory management help


From: Peter Johansson
Subject: [Help-gsl] gsl_vector memory management help
Date: Thu, 29 Jul 2010 08:31:28 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1

 Hi Noel,

I think the problem is that you don't implement a copy constructor for your class. Instead the code uses the compiler generated copy constructor, which copies all members naively, while you'd need something like

v = gsl_vector_allocate(DIM);
gsl_vector_memcpy(v, other.v);

Hope that helps.

Peter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]