forum.alglib.net http://forum.alglib.net/ |
|
memory usage of real_1d_array or real_2d_array http://forum.alglib.net/viewtopic.php?f=2&t=1019 |
Page 1 of 1 |
Author: | diavo [ Tue Oct 08, 2013 1:34 pm ] |
Post subject: | memory usage of real_1d_array or real_2d_array |
Hi, is there any way to avoid copying data in to that containers and use only pointers instead. The docu says that in this case data is copied: double _r1[] = {2, 3}; r1.setcontent(2,_r1); But often the overhead of copies arises the computatio time. Is there any other way? Regards Steffen |
Author: | Sergey.Bochkanov [ Wed Oct 09, 2013 10:13 am ] |
Post subject: | Re: memory usage of real_1d_array or real_2d_array |
It is not possible in the current version. These classes allocate arrays in the aligned manner which is essential for high performance on x86 systems. Furthermore, with 2D arrays it is even theoretically impossible to completely avoid dynamic allocation of memory - we need at least 8*number_of_rows bytes to store pointers to rows of the matrix. |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |