Hi Rhys and Vicent,
On 4/2/10 5:22 PM, Rhys Ulerich wrote:
In my C/C++ code I must use a kind of array of elements and I probably
will have to perform the typical operations on them: searching,
reordering, and so on.
My question for the GSL list is a little bit off-topic, because I
would like to know if any of you is familiar with those containers and
if you think it is a good option ...
It should, I think, be possible to use STL algorithms against
gsl_vectors if you are careful. From the documentation [1], a
gsl_vector has size, stride, and data members. If you create a
RandomAccessIterator [2] implementation that honors this information
and appropriate first and last iterator instances, you should be able
to use STL algorithms like std::sort [3]. I cannot speak to the
performance, but it should be reasonable.
The first (minor?) hurdle seems to be creating or finding a strided
iterator. I'd love to hear what you find.
I co-maintain a C++ library called yat that contains a Vector class,
which is wrapper arond gsl_vector. The class is very STLish in the sense
that it has a class Vector::iterator that can be created with functions
'begin() and end()'. The iterator is implemented as StrideIterator and
has the features as described above, so you can either use the
StrideIterator directly or use the Vector class. You can find more
information on the yat library here http://dev.thep.lu.se/yat/.
Thanks,
Peter
_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl