toon-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Toon-members] TooN regressions/eigen-sqrt.cc test/eigen-sqrt.cc


From: Edward Rosten
Subject: [Toon-members] TooN regressions/eigen-sqrt.cc test/eigen-sqrt.cc
Date: Tue, 29 Sep 2009 15:38:05 +0000

CVSROOT:        /cvsroot/toon
Module name:    TooN
Changes by:     Edward Rosten <edrosten>        09/09/29 15:38:05

Modified files:
        regressions    : eigen-sqrt.cc 
Removed files:
        test           : eigen-sqrt.cc 

Log message:
        Minor cleanup.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/test/eigen-sqrt.cc?cvsroot=toon&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/TooN/regressions/eigen-sqrt.cc?cvsroot=toon&r1=1.1&r2=1.2

Patches:
Index: regressions/eigen-sqrt.cc
===================================================================
RCS file: /cvsroot/toon/TooN/regressions/eigen-sqrt.cc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- regressions/eigen-sqrt.cc   29 Sep 2009 15:32:32 -0000      1.1
+++ regressions/eigen-sqrt.cc   29 Sep 2009 15:38:05 -0000      1.2
@@ -7,11 +7,9 @@
 
 int main() {
   // construct M
-  double d1[][3] = {{1,2,3},{2,5,6},{3,6,7}};
-  Matrix<3> M(3,3);
-  M[0]=makeVector(4,0,2);
-  M[1]=makeVector(0,5,3);
-  M[2]=makeVector(2,3,6);
+  Matrix<3> M = Data(4,0,2,
+                     0,5,3,
+                     2,3,6);
  
   Vector<3> dg(makeVector(2,4,9));
   // create the eigen decomposition of M

Index: test/eigen-sqrt.cc
===================================================================
RCS file: test/eigen-sqrt.cc
diff -N test/eigen-sqrt.cc
--- test/eigen-sqrt.cc  28 Aug 2009 01:14:23 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,39 +0,0 @@
-#include <iostream>
-#include <TooN/TooN.h>
-#include <TooN/SymEigen.h>
-
-using namespace std;
-using namespace TooN;
-
-int main() {
-  // construct M
-  double d1[][3] = {{1,2,3},{2,5,6},{3,6,7}};
- Matrix<3> M(3,3);
- M[0]=makeVector(4,0,2);
- M[1]=makeVector(0,5,3);
- M[2]=makeVector(2,3,6);
- 
- Vector<3> dg(makeVector(2,4,9));
- // create the eigen decomposition of M
- SymEigen<3> eigM(M);
- cout << "A=" << M << endl;
- cout << "(E,v)=eig(A)" << endl;
- // print the smallest eigenvalue
- cout << "v[0]=" << eigM.get_evalues()[0] << endl;
- // print the associated eigenvector
- cout << "E[0]=" << eigM.get_evectors()[0] << endl;
- // print the square root of the matrix.
- cout << "R=sqrtm(A)=" << eigM.get_sqrtm() << endl;
- // print the square root of the matrix squared.
- cout << "(should equal A), R^T*R="
-      << eigM.get_sqrtm().T() * eigM.get_sqrtm() << endl;
- // print the inverse of the matrix.
- cout << "A^-1=" << eigM.get_pinv() << endl;
- // print the inverse square root of the matrix.
- cout << "C=isqrtm(A)=" << eigM.get_isqrtm() << endl;
- // print the inverse square root of the matrix squared.
- cout << "(should equal A^-1), C^T*C="
-      << eigM.get_isqrtm().T() * eigM.get_isqrtm() << endl;
-
-  return 0;
-}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]