Login  Register

Array vs std::vector + free operators

Posted by DU VIGNAUD DE VILLEFORT FRANCOIS GASAPRD PHI on Apr 19, 2007; 2:47pm
URL: http://quantlib.414.s1.nabble.com/Array-vs-std-vector-free-operators-tp9392.html

Hi all,

 

 

I have tried to removing the dependency on Array class from the optimization framework. One change leading to another it turns out that Arrray dependencies could be removed in the whole QL ! The only change I had to do was to provide missing operators an independent header file and all worked fine. As a result I’m wondering if using plain std::vector instead of Arrray wouldn’t be more efficient in terms of compilation efficiency and flexibility of use. (if one want to use linear algebra he has just to include a file defining new operators…). I haven’t done serious tests but I don’t think that it would cause any performance loss since std::vector is a sequential container and is “swapable” in constant time. On the other hand it would make the array implementation more transparent to the user thus much more difficult to replace if one want to provide another implementation (but is it likely to happen ?)

Any thought ?

François


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev