View unanswered posts | View active topics
Forum rules
1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.
|
Page 1 of 1
|
[ 4 posts ] |
|
Author |
Message |
Nicholas
|
Post subject: alglib C++ standard vector Posted: Wed Mar 02, 2011 4:41 am |
|
Joined: Wed Mar 02, 2011 4:20 am Posts: 2
|
Is there any interoperability between alglib and the standard libraries?
For example, alglib::1d_real_array is basically the same as std::vector<double>. Is there an easy way to convert one to the other that doesn't involve copying the data?
|
|
Top |
|
|
Sergey.Bochkanov
|
Post subject: Re: alglib C++ standard vector Posted: Wed Mar 02, 2011 6:39 am |
|
|
Site Admin |
Joined: Fri May 07, 2010 7:06 am Posts: 927
|
No, it is not possible. ALGLIB uses its own data structures because std::vector doesn't provide properly aligned storage - which is essential for linear algebra performance.
|
|
Top |
|
|
Nicholas
|
Post subject: Re: alglib C++ standard vector Posted: Wed Mar 02, 2011 9:24 pm |
|
Joined: Wed Mar 02, 2011 4:20 am Posts: 2
|
Ah. Yes, I see want you mean.
I did a search to see whether the standard libraries in combination with an aligned allocator might work, but it appears a little more involved than that with some compilers.
|
|
Top |
|
|
Sergey.Bochkanov
|
Post subject: Re: alglib C++ standard vector Posted: Thu Mar 03, 2011 6:51 am |
|
|
Site Admin |
Joined: Fri May 07, 2010 7:06 am Posts: 927
|
The problem is that allocator can be aligned, but std::vector does not guarantee that it will start to use memory in aligned mode. Theoretically, it can allocate block and then begin to store elements starting from unaligned offset.
|
|
Top |
|
|
|
Page 1 of 1
|
[ 4 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 45 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|