forum.alglib.net

ALGLIB forum
It is currently Mon Dec 23, 2024 5:45 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  [ 2 posts ] 
Author Message
 Post subject: Using ae_vector with std algorithms
PostPosted: Tue Oct 23, 2012 5:40 am 
Offline

Joined: Tue Oct 23, 2012 5:37 am
Posts: 1
Hi

Can ae_vector be used together with std algorithms? How is the correct way to do it:

alglib::real_1d_vector a;
a.setlength(100);
std::fill((double*)a.c_ptr(),(double*)a.c_ptr() + a.length(),0.0);

Thanks,
thorsan


Top
 Profile  
 
 Post subject: Re: Using ae_vector with std algorithms
PostPosted: Tue Oct 23, 2012 10:18 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
With ae_vector you can just take pointer to the first element of the array - elements are stored contiguously, such order is 100% compatible with STL. With ae_matrix, however, you should be very careful - elements are stored row-by-row, with additional padding between rows, which should be taken into account (this padding is used to align data in memory).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

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