you cannot know how much time you will save us. Especially during testing !<br><br><div class="gmail_quote">On Mon, Mar 22, 2010 at 23:18, Gunter Winkler <span dir="ltr"><<a href="mailto:guwi17@gmx.de">guwi17@gmx.de</a>></span> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello Nasos,<br> <br> this is a feature that was missing long time. So I definitely vote for<br> it. What do others think?<br> <br> Am Sunday 21 March 2010 schrieb Nasos Iliopoulos:<br> <div class="im">> Insipired by the fucntionality of boost.assignment, i decided to<br> > implement something similar in ublas. Unfortunately due to the<br> > special way ublas is handling its containers I did not find it that<br> > convenient to use boost.assignment.<br> <br> </div>I opened a new ticket to track progress.<br> <a href="https://svn.boost.org/trac/boost/ticket/4034" target="_blank">https://svn.boost.org/trac/boost/ticket/4034</a><br> <div class="im"><br> > - Where do you think this should be added? As a separate header file,<br> > or included in vector_ and matrix_ expression headers?<br> <br> </div>it should be a separate header, maybe it is then included from<br> matrix/vector.hpp<br> I don't know if "assigner.hpp" is a good name, but I could not find a<br> better one, yet.<br> <div class="im"><br> > - I found it incovenient to implement this functionallity using<br> > iterators<br> <br> </div>For dense, triangular and banded matrices it is efficient to access the<br> matrix elements by index. However for most sparse types you will get a<br> very bad performance because calling the mutable operator(i,j) results<br> in the following steps:<br> * look up element (i,j) - this takes O(nnz) operations in worst case<br> * if element (i,j) exists return a reference to the value<br> * otherwise insert the element (i,j) into the sparse data structure and<br> return a reference to this element - this is another O(nnz) operation<br> in worst case<br> (if BOOST_UBLAS_NO_ELEMENT_PROXIES is not defined then a proxy is<br> returned instead of the real element and the insert is performed during<br> the destruction of the proxy - obviously this makes things only worse)<br> <br> For the several sparse types we would need more intelligent assignments.<br> Personally I don't see any use here (except for toy examples).<br> <br> Do you think it is possible to use triples (i,j,value) to fill a sparse<br> matrix, e.g. like<br> <br> cm << sparse_element(0,0,1.0), sparse_element(1,3,2.0) ;<br> <br> <br> mfg<br> Gunter<br> <br> (But I am still not convinced that this makes any benefit)<br> <br>_______________________________________________<br> ublas mailing list<br> <a href="mailto:ublas@lists.boost.org">ublas@lists.boost.org</a><br> <a href="http://lists.boost.org/mailman/listinfo.cgi/ublas" target="_blank">http://lists.boost.org/mailman/listinfo.cgi/ublas</a><br> Sent to: <a href="mailto:david.bellot@gmail.com">david.bellot@gmail.com</a><br></blockquote></div><br><br clear="all"><br>-- <br>David Bellot, PhD<br><a href="mailto:david.bellot@gmail.com">david.bellot@gmail.com</a><br> <a href="http://david.bellot.free.fr">http://david.bellot.free.fr</a><br><br>