forum.alglib.net http://forum.alglib.net/ |
|
alglib C++ standard vector http://forum.alglib.net/viewtopic.php?f=2&t=311 |
Page 1 of 1 |
Author: | Nicholas [ Wed Mar 02, 2011 4:41 am ] |
Post subject: | alglib C++ standard vector |
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? |
Author: | Sergey.Bochkanov [ Wed Mar 02, 2011 6:39 am ] |
Post subject: | Re: alglib C++ standard vector |
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. |
Author: | Nicholas [ Wed Mar 02, 2011 9:24 pm ] |
Post subject: | Re: alglib C++ standard vector |
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. |
Author: | Sergey.Bochkanov [ Thu Mar 03, 2011 6:51 am ] |
Post subject: | Re: alglib C++ standard vector |
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. |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |