This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: GSL Error Handling


E. Robert Tisdale writes:
 >         int
 >         gsl_vector_memcpy(gsl_vector* dest, const gsl_vector* src) {
 > Why shouldn't the GSL library developer copy
 > the source vector into the first part of the destination vector
 > if src->size < dest->size or copy the first part
 > of the source vector into the destination vector
 > if dest->size < src->size?

The appropriate procedure for copying subvectors in GSL is to create a
corresponding subvector view then copy from that to the destination.
This shows explicitly that only part of the vector should be copied.
It is analogous to using an explicit cast in an assignment.

The behavior of GSL's vectors is based on the C++ valarray model
where copying valarrays of different lengths by assignment gives
undefined results (i.e. an error).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]