<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Linear algebra in C++ is no fun</title>
	<atom:link href="http://www.mailund.dk/index.php/2009/04/28/linear-algebra-in-c-is-no-fun/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mailund.dk/index.php/2009/04/28/linear-algebra-in-c-is-no-fun/</link>
	<description>Computer science, bioinformatics, genetics, and everything in between</description>
	<lastBuildDate>Fri, 19 Aug 2011 16:35:39 +0200</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>By: Anton</title>
		<link>http://www.mailund.dk/index.php/2009/04/28/linear-algebra-in-c-is-no-fun/comment-page-1/#comment-3178</link>
		<dc:creator>Anton</dc:creator>
		<pubDate>Thu, 04 Jun 2009 08:32:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.mailund.dk/?p=1208#comment-3178</guid>
		<description>Cool!</description>
		<content:encoded><![CDATA[<p>Cool!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amix</title>
		<link>http://www.mailund.dk/index.php/2009/04/28/linear-algebra-in-c-is-no-fun/comment-page-1/#comment-3018</link>
		<dc:creator>amix</dc:creator>
		<pubDate>Wed, 29 Apr 2009 10:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.mailund.dk/?p=1208#comment-3018</guid>
		<description>The current languages have a really, really bad support for mathematical expressions. One of the new languages that challenges this is Fortress:
http://projectfortress.sun.com/Projects/Community

One of the designers of Fortress is Guy Steele (Lisp*, designer of Java). Apart from an unicode syntax that can be used for math expressions it also offers implicit parallelism and transactions.

Another thing is Mathematica - it&#039;s becoming a pretty powerful programming environment with Mathematica 7 - - and I could bet that if you do lots of math, then Mathematica is much faster and more correct than the average C++/Python library. For example, I found this post quite interesting:
* http://blog.wolfram.com/2007/09/25/arithmetic-is-hard-to-get-right/ (12 years spent on doing arithmetic right :))</description>
		<content:encoded><![CDATA[<p>The current languages have a really, really bad support for mathematical expressions. One of the new languages that challenges this is Fortress:<br />
<a href="http://projectfortress.sun.com/Projects/Community" rel="nofollow">http://projectfortress.sun.com/Projects/Community</a></p>
<p>One of the designers of Fortress is Guy Steele (Lisp*, designer of Java). Apart from an unicode syntax that can be used for math expressions it also offers implicit parallelism and transactions.</p>
<p>Another thing is Mathematica &#8211; it&#8217;s becoming a pretty powerful programming environment with Mathematica 7 &#8211; - and I could bet that if you do lots of math, then Mathematica is much faster and more correct than the average C++/Python library. For example, I found this post quite interesting:<br />
* <a href="http://blog.wolfram.com/2007/09/25/arithmetic-is-hard-to-get-right/" rel="nofollow">http://blog.wolfram.com/2007/09/25/arithmetic-is-hard-to-get-right/</a> (12 years spent on doing arithmetic right :))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Mailund</title>
		<link>http://www.mailund.dk/index.php/2009/04/28/linear-algebra-in-c-is-no-fun/comment-page-1/#comment-3017</link>
		<dc:creator>Thomas Mailund</dc:creator>
		<pubDate>Wed, 29 Apr 2009 05:19:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.mailund.dk/?p=1208#comment-3017</guid>
		<description>Thanks for the links, guys, I&#039;ll have a look!

I haven&#039;t used much linear algebra in C++ before (usually I have used R, Octave/Matlab or SciPy for that), but for this project I need it to get my MCMC fast enough.

Now, of course, I&#039;m getting punished for lack of experience and not knowing which libraries are available, so the links are much appreciated!</description>
		<content:encoded><![CDATA[<p>Thanks for the links, guys, I&#8217;ll have a look!</p>
<p>I haven&#8217;t used much linear algebra in C++ before (usually I have used R, Octave/Matlab or SciPy for that), but for this project I need it to get my MCMC fast enough.</p>
<p>Now, of course, I&#8217;m getting punished for lack of experience and not knowing which libraries are available, so the links are much appreciated!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TomD</title>
		<link>http://www.mailund.dk/index.php/2009/04/28/linear-algebra-in-c-is-no-fun/comment-page-1/#comment-3016</link>
		<dc:creator>TomD</dc:creator>
		<pubDate>Wed, 29 Apr 2009 05:13:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.mailund.dk/?p=1208#comment-3016</guid>
		<description>I encountered the same issues when coding against the Intel MKL BLAS from C++, so I wrote a convenience wrapper here: http://wiki.github.com/tdoris/cppmkl which you may find useful. It doesn&#039;t use operator overloading for performance reasons (cf. boost ublas noalias issues), but it takes most of the hard work out of calling blas functions and provides an aligned allocator for speed+precision. If you&#039;re already familiar with the cblas then it might be what you need.</description>
		<content:encoded><![CDATA[<p>I encountered the same issues when coding against the Intel MKL BLAS from C++, so I wrote a convenience wrapper here: <a href="http://wiki.github.com/tdoris/cppmkl" rel="nofollow">http://wiki.github.com/tdoris/cppmkl</a> which you may find useful. It doesn&#8217;t use operator overloading for performance reasons (cf. boost ublas noalias issues), but it takes most of the hard work out of calling blas functions and provides an aligned allocator for speed+precision. If you&#8217;re already familiar with the cblas then it might be what you need.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Me</title>
		<link>http://www.mailund.dk/index.php/2009/04/28/linear-algebra-in-c-is-no-fun/comment-page-1/#comment-3014</link>
		<dc:creator>Me</dc:creator>
		<pubDate>Wed, 29 Apr 2009 01:37:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.mailund.dk/?p=1208#comment-3014</guid>
		<description>You really should have a look at eigen2!
http://eigen.tuxfamily.org/index.php?title=Main_Page</description>
		<content:encoded><![CDATA[<p>You really should have a look at eigen2!<br />
<a href="http://eigen.tuxfamily.org/index.php?title=Main_Page" rel="nofollow">http://eigen.tuxfamily.org/index.php?title=Main_Page</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Mailund</title>
		<link>http://www.mailund.dk/index.php/2009/04/28/linear-algebra-in-c-is-no-fun/comment-page-1/#comment-3012</link>
		<dc:creator>Thomas Mailund</dc:creator>
		<pubDate>Tue, 28 Apr 2009 21:30:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.mailund.dk/?p=1208#comment-3012</guid>
		<description>mw: yes, you want overloading here!  It is just a bit tricky, &#039;cause evaluation order and such can matter a great deal, and obvious things like just changing your indices in loops instead of first transposing a matrix and then multiplying just doesn&#039;t work out of the box with simple classes and overloading.

You really want template expressions to combine convenient notation with computational efficiency.

uBLAS, that I just linked to, gets most of this right, I just don&#039;t like that * seems to be component wise and not matrix multiplication.  I don&#039;t want to write C = prod(A,B), I want to write C = A*B, damn it!  I am more likely to use matrix multiplication than component wise multiplication, so the former and not the latter should use the operator.

But I can probably get used to that, if the alternative means implementing my own library :)

I have to do something about quadratic forms, though.  I don&#039;t see any easy way of computing v&#039; A v using this library... that still looks like two multiplication operations, but it shouldn&#039;t really be.</description>
		<content:encoded><![CDATA[<p>mw: yes, you want overloading here!  It is just a bit tricky, &#8217;cause evaluation order and such can matter a great deal, and obvious things like just changing your indices in loops instead of first transposing a matrix and then multiplying just doesn&#8217;t work out of the box with simple classes and overloading.</p>
<p>You really want template expressions to combine convenient notation with computational efficiency.</p>
<p>uBLAS, that I just linked to, gets most of this right, I just don&#8217;t like that * seems to be component wise and not matrix multiplication.  I don&#8217;t want to write C = prod(A,B), I want to write C = A*B, damn it!  I am more likely to use matrix multiplication than component wise multiplication, so the former and not the latter should use the operator.</p>
<p>But I can probably get used to that, if the alternative means implementing my own library :)</p>
<p>I have to do something about quadratic forms, though.  I don&#8217;t see any easy way of computing v&#8217; A v using this library&#8230; that still looks like two multiplication operations, but it shouldn&#8217;t really be.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Mailund</title>
		<link>http://www.mailund.dk/index.php/2009/04/28/linear-algebra-in-c-is-no-fun/comment-page-1/#comment-3011</link>
		<dc:creator>Thomas Mailund</dc:creator>
		<pubDate>Tue, 28 Apr 2009 21:24:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.mailund.dk/?p=1208#comment-3011</guid>
		<description>Damn, I could also have checked Boost... http://www.boost.org/doc/libs/1_35_0/libs/numeric/ublas/doc/overview.htm

Damn it! &lt;em&gt;Always&lt;/em&gt; check Boost when coding C++!</description>
		<content:encoded><![CDATA[<p>Damn, I could also have checked Boost&#8230; <a href="http://www.boost.org/doc/libs/1_35_0/libs/numeric/ublas/doc/overview.htm" rel="nofollow">http://www.boost.org/doc/libs/1_35_0/libs/numeric/ublas/doc/overview.htm</a></p>
<p>Damn it! <em>Always</em> check Boost when coding C++!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mw</title>
		<link>http://www.mailund.dk/index.php/2009/04/28/linear-algebra-in-c-is-no-fun/comment-page-1/#comment-3010</link>
		<dc:creator>mw</dc:creator>
		<pubDate>Tue, 28 Apr 2009 21:24:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.mailund.dk/?p=1208#comment-3010</guid>
		<description>That&#039;s one of the places where operator overloading actually makes sense.  Never used a library that didn&#039;t use overloading for matrix (and vector) operations.</description>
		<content:encoded><![CDATA[<p>That&#8217;s one of the places where operator overloading actually makes sense.  Never used a library that didn&#8217;t use overloading for matrix (and vector) operations.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

