title: How to use Eigen, the C++ template library for linear algebra?
body: <p>I have an image processing algorithm which makes of matrices, I have my own matrix operation codes (Multiplication, Inverse...) with me. But the processor I use is ARM Cortex-A8 processor, which has NEON co-processor for vectorization, as matrix operations are ideal cases for SIMD operations, I asked the compiler (-mfpu=neon -mfloat-abi=softfp) to generate NEON instructions  for my code, but the compiler fails to do so and then I also attempted to write my own NEON intrinsics code for the Matrix operations, but I found it very hard to do so.</p>
  
  <p>So, I thought of making use of <a href="http://eigen.tuxfamily.org/index.php?title=Main_Page" rel="noreferrer">Eigen</a> library which promises vectorization of matrix operations. So I promptly downloaded the Eigen C++ library and tried using it as given in their tutorials but, unfortunately I get <strong>compilation errors</strong> when I run their <a href="http://eigen.tuxfamily.org/dox/TutorialCore.html" rel="noreferrer">example programs</a>.</p>
  
  <p>Anyone out there who has experience using Eigen, any examples will be really helpful? Kindly help me how to go about it.</p>
  
  <p>Help!</p>
  
  <p>Thanks</p>
  
  <hr>
  
  <p>I have the Eigen folder at: <strong>/home/ubuntu/Documents/eigen</strong> I set this path in my Eclipse's  C++ project's additional directories. Then I run the following program (Example)-</p>
  
  <pre><code>#include &lt;Eigen/Core&gt;
  
  // import most common Eigen types
  USING_PART_OF_NAMESPACE_EIGEN
  
  int main(int, char *[])
  {
    Matrix3f m3;
    m3 &lt;&lt; 1, 2, 3, 4, 5, 6, 7, 8, 9;
    Matrix4f m4 = Matrix4f::Identity();
    Vector4i v4(1, 2, 3, 4);
  
    std::cout &lt;&lt; "m3\n" &lt;&lt; m3 &lt;&lt; "\nm4:\n"
      &lt;&lt; m4 &lt;&lt; "\nv4:\n" &lt;&lt; v4 &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>Errors I get -</p>
  
  <p>Build of configuration Debug for project Test_Eigen ****</p>
  
  <p>make all </p>
  
  <p>Building file: ../main.cpp</p>
  
  <p>Invoking: Sourcery G++ C++ Compiler</p>
  
  <p>arm-none-linux-gnueabi-g++ -I/home/ubuntu/Documents/eigen -O0 -g3 -Wall -c -fmessage-length=0 -fcommon -MMD -MP -MF"main.d" -MT"main.d" -mcpu=cortex-a8 -marm -o"main.o" </p>
  
  <p>"../main.cpp"</p>
  
  <p>../main.cpp:6: error: expected constructor, destructor, or type conversion before 'int'
  make: *** [main.o] Error 1</p>