Index: /trunk/src/lib/math/matrix.cc
===================================================================
--- /trunk/src/lib/math/matrix.cc	(revision 5664)
+++ /trunk/src/lib/math/matrix.cc	(revision 5665)
@@ -5,9 +5,7 @@
 
 
-void Matrix::eigVl(const Matrix& mat)
+Vector Matrix::eigenValues() const
 {
-
-  float eigValue[3];
-  float eigVc[9];
+  Vector eigVl;
 
   float a = 0;
@@ -50,8 +48,8 @@
     float p = sqrt((b/2.0)*(b/2.0) - Q);
 
-    eigValue[0] = c[2]/3.0 + 2 * pow(p, 1/3.0) * cos(psi/3.0);
-    eigValue[1] = c[2]/3.0 - pow(p, 1/3.0) * (cos(psi/3.0)
+    eigVl.x = c[2]/3.0 + 2 * pow(p, 1/3.0) * cos(psi/3.0);
+    eigVl.y = c[2]/3.0 - pow(p, 1/3.0) * (cos(psi/3.0)
         + sqrt(3.0) * sin(psi/3.0));
-    eigValue[2] = c[2]/3.0 - pow(p, 1/3.0) * (cos(psi/3.0)
+    eigVl.z = c[2]/3.0 - pow(p, 1/3.0) * (cos(psi/3.0)
         - sqrt(3.0) * sin(psi/3.0));
 
@@ -60,7 +58,7 @@
   else if (Q == 0)
   {
-    eigValue[0] = c[2]/3.0 + pow(b/2.0, 1.0/3.0);
-    eigValue[1] = c[2]/3.0 + pow(b/2.0, 1.0/3.0);
-    eigValue[2] = c[2]/3.0 + 2* pow(b/2.0, 1.0/3.0);
+    eigVl.x = c[2]/3.0 + pow(b/2.0, 1.0/3.0);
+    eigVl.y = c[2]/3.0 + pow(b/2.0, 1.0/3.0);
+    eigVl.z = c[2]/3.0 + 2* pow(b/2.0, 1.0/3.0);
   }
   // 1 Root (not calculating anything.)
@@ -68,13 +66,21 @@
   {
     printf("A is multiple of Identity matrix (lambda * I3))\n");
-    eigValue[0] = eigValue[1] = eigValue[2] = 1;
+    eigVl.x = eigVl.y = eigVl.z = 1;
   }
+  printf("%f %f %f\n", eigVl.x, eigVl.y, eigVl.z);
+  return eigVl;
 
+}
 
+void Matrix::eigenVectors(Vector& a, Vector& b, Vector& c) const
+{
+  Vector eigVl = this->eigenValues();
+
+  float eigVc[9];
   // EigenVectors
   for (int i = 0; i < 3; ++i)
   {
     printf (":: i = %d\n", i);
-    Matrix M = *this -  Matrix::identity() * eigValue[i];
+    Matrix M = *this -  Matrix::identity() * eigVl.x;
     Vector m1, m2, m3;
 
@@ -94,5 +100,5 @@
 //     u2 = M*u2;
 //     u3 = M*u3;
-//
+    //
 //     printf("%f, %f, %f\n", u1.x, u1.y, u1.z);
 //     printf("%f, %f, %f\n", u2.x, u2.y, u2.z);
@@ -102,7 +108,4 @@
 
   this->debug();
-
-  printf("%f %f %f\n", eigValue[0], eigValue[1], eigValue[2]);
-
 }
 
Index: /trunk/src/lib/math/matrix.h
===================================================================
--- /trunk/src/lib/math/matrix.h	(revision 5664)
+++ /trunk/src/lib/math/matrix.h	(revision 5665)
@@ -29,5 +29,5 @@
     };
 
-    Matrix operator+ (const Matrix& m) {
+    Matrix operator+ (const Matrix& m) const {
       return Matrix (this->m11 + m.m11, this->m12 + m.m12, this->m13 + m.m13,
                      this->m21 + m.m21, this->m22 + m.m22, this->m23 + m.m23,
@@ -35,5 +35,5 @@
     }
 
-    Matrix operator- (const Matrix& m) {
+    Matrix operator- (const Matrix& m) const {
       return Matrix (this->m11 - m.m11, this->m12 - m.m12, this->m13 - m.m13,
                      this->m21 - m.m21, this->m22 - m.m22, this->m23 - m.m23,
@@ -41,5 +41,5 @@
     }
 
-    Matrix operator* (float k) {
+    Matrix operator* (float k) const {
       return Matrix(this->m11 - k, this->m12 - k, this->m13 - k,
                     this->m21 - k, this->m22 - k, this->m23 - k,
@@ -47,5 +47,5 @@
     }
 
-    Vector operator* (const Vector& v) {
+    Vector operator* (const Vector& v) const {
       return Vector (this->m11*v.x + this->m12*v.y + this->m13*v.z,
                      this->m21*v.x + this->m22*v.y + this->m23*v.z,
@@ -55,5 +55,5 @@
 
 
-    Matrix getTransposed() {
+    Matrix getTransposed() const {
       return Matrix( this->m11, this->m21, this->m31,
                      this->m12, this->m22, this->m32,
@@ -61,5 +61,5 @@
     }
 
-    void toVectors(Vector& m1, Vector& m2, Vector& m3) {
+    void toVectors(Vector& m1, Vector& m2, Vector& m3) const {
       m1 = Vector(this->m11, this->m12, this->m13);
       m2 = Vector(this->m21, this->m22, this->m23);
@@ -67,9 +67,10 @@
     }
 
+    Vector eigenValues() const;
+    void eigenVectors(Vector& a, Vector& b, Vector& c) const;
 
     /// @todo optimize
     static Matrix identity() { return Matrix (1,0,0, 0,1,0, 0,0,1); }
 
-    void eigVl(const Matrix& matrix);
     void debug() const;
 
