title: C++ Eigen Library - Quadratic Programming, Fixed vs Dynamic, Performance
body: <p>I am looking into doing some quadratic programming, and have seen different libraries. I have seen various Eigen variants of QuadProg++ (<a href="http://forum.kde.org/viewtopic.php?f=74&amp;t=92393" rel="nofollow noreferrer">KDE Forums</a>, <a href="http://www.cs.cmu.edu/~bstephe1/" rel="nofollow noreferrer">Benjamin Stephens</a>, <a href="https://stackoverflow.com/questions/8025700/is-there-a-quadratic-programming-library-in-c">StackOverflow posts</a>). Just as a test, I forked <a href="https://github.com/wingsit/QP" rel="nofollow noreferrer">wingsit's Eigen variant</a>, available on <a href="https://github.com/eacousineau/QP" rel="nofollow noreferrer">GitHub</a>, to implement compile-time-sized problems to measure performance via templates.</p>
  
  <p>I'm finding that I have worse performance in the templating case than the dynamically sized (MatrixXD / VectorXD) case from wingsit's code. I know this is not a simple question, but can anyone see a reason why this might be?</p>
  
  <p>Note: I do need to increase the problem size / iteration count, will post that once I can.</p>
  
  <p>EDIT: I am using GCC 4.6.3 on Ubuntu 12.04. These are the flags that I am using (modified from wingsit's code):</p>
  
  <pre><code>CFLAGS  = -O4 -Wall -msse2 -fopenmp      # option for obj
  LFLAGS  = -O4 -Wall -msse2 -fopenmp      # option for exe (-lefence ...)
  </code></pre>