Index: src/LinearAlgebra/MatrixContent.cpp
===================================================================
--- src/LinearAlgebra/MatrixContent.cpp	(revision bbf1bd95420fd2556318900509aeb2a2b49865e8)
+++ src/LinearAlgebra/MatrixContent.cpp	(revision b4cf2b752620d3a300d2fa3fef55de302a2b7065)
@@ -30,5 +30,7 @@
 #include <gsl/gsl_vector.h>
 #include <cmath>
+#include <cassert>
 #include <iostream>
+#include <set>
 
 using namespace std;
@@ -201,5 +203,5 @@
 const MatrixContent MatrixContent::operator*(const MatrixContent &rhs) const
 {
-  gsl_matrix *res = gsl_matrix_alloc(rows, columns);
+  gsl_matrix *res = gsl_matrix_alloc(rows, rhs.columns);
   gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, 1.0, content, rhs.content, 0.0, res);
   // gsl_matrix is taken over by constructor, hence no free
@@ -345,19 +347,97 @@
 
 /** Transform the matrix to its eigenbasis ans 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
+ * TODO: encapsulate return value in boost::shared_ptr or in VectorContent.
  * \return gsl_vector pointer to vector of eigenvalues
  */
 gsl_vector* MatrixContent::transformToEigenbasis()
 {
-  ASSERT (rows == columns,
-      "MatrixContent::transformToEigenbasis() - only implemented for square matrices: "+toString(rows)+"!="+toString(columns)+"!");
-  gsl_eigen_symmv_workspace *T = gsl_eigen_symmv_alloc(rows);
-  gsl_vector *eval = gsl_vector_alloc(rows);
-  gsl_matrix *evec = gsl_matrix_alloc(rows, rows);
-  gsl_eigen_symmv(content, eval, evec, T);
-  gsl_eigen_symmv_free(T);
-  gsl_matrix_memcpy(content, evec);
-  gsl_matrix_free(evec);
-  return eval;
+  if (rows == columns) { // symmetric
+    gsl_eigen_symmv_workspace *T = gsl_eigen_symmv_alloc(rows);
+    gsl_vector *eval = gsl_vector_alloc(rows);
+    gsl_matrix *evec = gsl_matrix_alloc(rows, rows);
+    gsl_eigen_symmv(content, eval, evec, T);
+    gsl_eigen_symmv_free(T);
+    gsl_matrix_memcpy(content, evec);
+    gsl_matrix_free(evec);
+    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;
+    gsl_matrix *content_square = gsl_matrix_alloc(greaterDimension, greaterDimension);
+    for (size_t i=0; i<greaterDimension; i++) {
+      for (size_t j=0; j<greaterDimension; j++) {
+        const double value = ((i < rows) && (j < columns)) ? gsl_matrix_get(content,i,j) : 0.;
+        gsl_matrix_set(content_square, i,j, value);
+      }
+    }
+
+    // solve eigenvalue problem
+    gsl_eigen_nonsymmv_workspace *T = gsl_eigen_nonsymmv_alloc(rows);
+    gsl_vector_complex *eval = gsl_vector_complex_alloc(greaterDimension);
+    gsl_matrix_complex *evec = gsl_matrix_complex_alloc(greaterDimension, greaterDimension);
+    gsl_eigen_nonsymmv(content_square, eval, evec, T);
+    gsl_eigen_nonsymmv_free(T);
+
+    // copy eigenvectors real-parts into content_square and display
+    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;
+    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()) {
+        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_vector_complex_get(eval,I))) > MYEPSILON)
+          std::cerr << "MatrixContent::transformToEigenbasis() - WARNING: eigenvectors are complex-valued!" << std::endl;
+        gsl_vector_set(eval_real, I, GSL_REAL(gsl_vector_complex_get(eval, i)));
+        I++;
+      }
+    }
+    gsl_matrix_complex_free(evec);
+    gsl_vector_complex_free(eval);
+    return eval_real;
+  }
 }
 
@@ -479,2 +559,18 @@
   return result;
 }
+
+std::ostream & operator<<(std::ostream &ost, const MatrixContent &mat)
+{
+  ost << "[";
+  for (size_t i=0;i<mat.rows;i++) {
+    for (size_t j=0;j<mat.columns;j++) {
+      ost << mat.at(i,j);
+      if (j != mat.columns-1)
+        ost << " ";
+    }
+    if (i != mat.rows-1)
+      ost << "; ";
+  }
+  ost << "]";
+  return ost;
+}
Index: src/LinearAlgebra/MatrixContent.hpp
===================================================================
--- src/LinearAlgebra/MatrixContent.hpp	(revision bbf1bd95420fd2556318900509aeb2a2b49865e8)
+++ src/LinearAlgebra/MatrixContent.hpp	(revision b4cf2b752620d3a300d2fa3fef55de302a2b7065)
@@ -35,4 +35,6 @@
 #include <gsl/gsl_matrix.h>
 
+#include <iosfwd>
+
 class Vector;
 
@@ -40,4 +42,5 @@
 {
   friend Vector operator*(const MatrixContent &mat,const Vector &vec);
+  friend std::ostream & operator<<(std::ostream &ost, const MatrixContent &mat);
   friend class RealSpaceMatrix;
   friend class LinearSystemOfEquations;
@@ -104,4 +107,5 @@
 const MatrixContent operator*(const MatrixContent &mat,const double factor);
 Vector operator*(const MatrixContent &mat,const Vector &vec);
+std::ostream & operator<<(std::ostream &ost, const MatrixContent &mat);
 
 #endif /* MATRIXCONTENT_HPP_ */
