forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 9:02 am

All times are UTC


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.



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: alglib C++ standard vector
PostPosted: Wed Mar 02, 2011 4:41 am 
Offline

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
 Profile  
 
 Post subject: Re: alglib C++ standard vector
PostPosted: Wed Mar 02, 2011 6:39 am 
Offline
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
 Profile  
 
 Post subject: Re: alglib C++ standard vector
PostPosted: Wed Mar 02, 2011 9:24 pm 
Offline

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
 Profile  
 
 Post subject: Re: alglib C++ standard vector
PostPosted: Thu Mar 03, 2011 6:51 am 
Offline
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
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 60 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

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group