Index: src/LinearAlgebra/MatrixContent.cpp
===================================================================
--- src/LinearAlgebra/MatrixContent.cpp	(revision 13d1504cb6c549a18c96fb24463172b5f411e4c2)
+++ src/LinearAlgebra/MatrixContent.cpp	(revision 17fa816510f6b950b8a5edbeacf4f3cd95693f08)
@@ -215,4 +215,7 @@
 const MatrixContent MatrixContent::operator*(const MatrixContent &rhs) const
 {
+  ASSERT (columns == rhs.rows,
+      "MatrixContent::operator*() - dimensions not match for matrix product (a,b)*(b,c) = (a,c):"
+      "("+toString(rows)+","+toString(columns)+")*("+toString(rhs.rows)+","+toString(rhs.columns)+")");
   gsl_matrix *res = gsl_matrix_alloc(rows, rhs.columns);
   gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, 1.0, content, rhs.content, 0.0, res);
@@ -358,5 +361,5 @@
 }
 
-/** Transform the matrix to its eigenbasis ans return resulting eigenvalues.
+/** Transform the matrix to its eigenbasis and return resulting eigenvalues.
  * Note that we only return real-space part in case of non-symmetric matrix.
  * \warn return vector has to be freed'd
@@ -376,6 +379,4 @@
     return eval;
   } else { // non-symmetric
-    //ASSERT(false, "MatrixContent::transformToEigenbasis() - only implemented for square matrices: "+toString(rows)+"!="+toString(columns)+"!");
-
     // blow up gsl_matrix in content to square matrix, fill other components with zero
     const size_t greaterDimension = rows > columns ? rows : columns;
@@ -388,8 +389,7 @@
     }
 
-    // show squared matrix
-    MatrixContent *ContentSquare = new MatrixViewContent(gsl_matrix_submatrix(content,0,0,content->size1, content->size2));
+    // show squared matrix by putting it into a MatrixViewContent
+    MatrixContent *ContentSquare = new MatrixViewContent(gsl_matrix_submatrix(content_square,0,0,content_square->size1, content_square->size2));
     std::cout << "The squared matrix is " << *ContentSquare << std::endl;
-    delete ContentSquare;
 
     // solve eigenvalue problem
@@ -401,50 +401,33 @@
 
     // copy eigenvectors real-parts into content_square and ...
+    for (size_t i=0; i<greaterDimension; i++)
+      for (size_t j=0; j<greaterDimension; j++)
+        gsl_matrix_set(content_square, i,j, GSL_REAL(gsl_matrix_complex_get(evec,i,j)));
+
     // ... show complex-valued eigenvector matrix
-    std::cout << "Resulting eigenvector matrix is [";
-    for (size_t i=0; i<greaterDimension; i++) {
-      for (size_t j=0; j<greaterDimension; j++) {
-        std::cout << "(" << GSL_REAL(gsl_matrix_complex_get(evec,i,j))
-            << "," << GSL_IMAG(gsl_matrix_complex_get(evec,i,j)) << ")";
-        if (j < greaterDimension-1)
-          std::cout << " ";
-        gsl_matrix_set(content_square, i,j, GSL_REAL(gsl_matrix_complex_get(evec,i,j)));
-      }
-      if (i < greaterDimension-1)
-        std::cout << "; ";
-    }
-    std::cout << "]" << std::endl;
-
-    // scan for zero rows and columns to drop
-    std::set<size_t> RowDropList;
-    std::set<size_t> ColumnDropList;
+    std::cout << "The real-value eigenvector matrix is " << *ContentSquare << std::endl;
+//    std::cout << "Resulting eigenvector matrix is [";
+//    for (size_t i=0; i<greaterDimension; i++) {
+//      for (size_t j=0; j<greaterDimension; j++) {
+//        std::cout << "(" << GSL_REAL(gsl_matrix_complex_get(evec,i,j))
+//            << "," << GSL_IMAG(gsl_matrix_complex_get(evec,i,j)) << ")";
+//        if (j < greaterDimension-1)
+//          std::cout << " ";
+//      }
+//      if (i < greaterDimension-1)
+//        std::cout << "; ";
+//    }
+//    std::cout << "]" << std::endl;
+
+    // copy real-parts of complex eigenvalues and eigenvectors (column-wise orientation)
+    gsl_vector *eval_real = gsl_vector_alloc(columns);
+    size_t I=0;
     for (size_t i=0; i<greaterDimension; i++) { // only copy real space part
-      double Rsum = 0.;
-      double Csum = 0.;
-      for (size_t j=0; j<greaterDimension; j++) {
-        Rsum += fabs(GSL_REAL(gsl_matrix_complex_get(evec,i,j)));
-        Csum += fabs(GSL_REAL(gsl_matrix_complex_get(evec,j,i)));
-      }
-      Rsum /= (double)greaterDimension;
-      Csum /= (double)greaterDimension;
-      if (Rsum < MYEPSILON)
-        RowDropList.insert(i);
-      if (Csum < MYEPSILON)
-        ColumnDropList.insert(i);
-    }
-
-    // copy real-parts of complex eigenvalues and eigenvectors
-    gsl_vector *eval_real = gsl_vector_alloc(greaterDimension);
-    size_t I=0;
-    size_t J=0;
-    for (size_t i=0; i<greaterDimension; i++) { // only copy real space part
-      if (RowDropList.find(i) == RowDropList.end()) {
+      if (fabs(GSL_REAL(gsl_vector_complex_get(eval,i))) > MYEPSILON) { // only take eigenvectors with value > 0
+        std::cout << i << "th eigenvalue is (" << GSL_REAL(gsl_vector_complex_get(eval,i)) << "," << GSL_IMAG(gsl_vector_complex_get(eval,i)) << ")" << std::endl;
         for (size_t j=0; j<greaterDimension; j++) {
-          if (ColumnDropList.find(j) == ColumnDropList.end()) {
-            if (fabs(GSL_IMAG(gsl_matrix_complex_get(evec,i,j))) > MYEPSILON)
-              std::cerr << "MatrixContent::transformToEigenbasis() - WARNING: eigenvectors are complex-valued!" << std::endl;
-            gsl_matrix_set(content, I,J, GSL_REAL(gsl_matrix_complex_get(evec,i,j)));
-            J++;
-          }
+          if (fabs(GSL_IMAG(gsl_matrix_complex_get(evec,j,i))) > MYEPSILON)
+            std::cerr << "MatrixContent::transformToEigenbasis() - WARNING: eigenvectors are complex-valued!" << std::endl;
+          gsl_matrix_set(content, j,I, GSL_REAL(gsl_matrix_complex_get(evec,j,i)));
         }
         if (fabs(GSL_IMAG(gsl_vector_complex_get(eval,I))) > MYEPSILON)
@@ -456,4 +439,6 @@
     gsl_matrix_complex_free(evec);
     gsl_vector_complex_free(eval);
+    delete ContentSquare;
+
     return eval_real;
   }
