toon-members
[Top][All Lists]
Advanced

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

[Toon-members] TooN sl.h


From: Gerhard Reitmayr
Subject: [Toon-members] TooN sl.h
Date: Wed, 16 Dec 2009 20:57:19 +0000

CVSROOT:        /cvsroot/toon
Module name:    TooN
Changes by:     Gerhard Reitmayr <gerhard>      09/12/16 20:57:19

Modified files:
        .              : sl.h 

Log message:
        replaced use of LU for inverse and det with TooN implementations

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/sl.h?cvsroot=toon&r1=1.6&r2=1.7

Patches:
Index: sl.h
===================================================================
RCS file: /cvsroot/toon/TooN/sl.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- sl.h        19 May 2009 09:46:34 -0000      1.6
+++ sl.h        16 Dec 2009 20:57:19 -0000      1.7
@@ -33,8 +33,9 @@
 
 #include <TooN/TooN.h>
 #include <TooN/helpers.h>
-#include <TooN/LU.h>
+#include <TooN/gaussian_elimination.h>
 #include <cassert>
+
 namespace TooN {
 
 template <int N, typename P> class SL;
@@ -93,12 +94,15 @@
 
 private:
        struct Invert {};
-       SL( const SL & from, struct Invert ) : 
my_matrix(LU<N>(from.get_matrix()).get_inverse()) {}
+       SL( const SL & from, struct Invert ) {
+               Matrix<N> id = Identity;
+               my_matrix = gaussian_elimination(from.my_matrix, id);
+       }
        SL( const SL & a, const SL & b) : my_matrix(a.get_matrix() * 
b.get_matrix()) {}
 
        void coerce(){
                using std::abs;
-               Precision det = LU<N>(my_matrix).determinant();
+               Precision det = determinant(my_matrix);
                assert(abs(det) > 0);
         using std::pow;
                my_matrix /= pow(det, 1.0/N);




reply via email to

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