2010/7/29 Peter Johansson <[email protected]>:
> The problem is that you have not implemented any copy constructor, which
> means you're using the compiler generated version that just copies all
> members. You need to implement a copy constructor that creates a new
> gsl_vector. Something like this IIRC:
>
> myMember_t::myMember_t(const myMember_t other)
> {
>  v = gsl_vector_alloc(DIM);
>  gsl_vector_memcpy(v, other.v);
> }

Just a precision, in the copy constructor the argument should be
passed as a reference:

myMember_t::myMember_t(const myMember_t& other)
{
  v = gsl_vector_alloc(DIM);
  gsl_vector_memcpy(v, other.v);
}

Francesco

_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl

Reply via email to