toon-members
[Top][All Lists]
Advanced

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

[Toon-members] TooN GR_SVD.h


From: Georg Klein
Subject: [Toon-members] TooN GR_SVD.h
Date: Tue, 25 Aug 2009 16:09:53 +0000

CVSROOT:        /sources/toon
Module name:    TooN
Changes by:     Georg Klein <georgklein>        09/08/25 16:09:53

Modified files:
        .              : GR_SVD.h 

Log message:
        Get smallest SV index

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/GR_SVD.h?cvsroot=toon&r1=1.1&r2=1.2

Patches:
Index: GR_SVD.h
===================================================================
RCS file: /sources/toon/TooN/GR_SVD.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- GR_SVD.h    24 Aug 2009 17:03:40 -0000      1.1
+++ GR_SVD.h    25 Aug 2009 16:09:53 -0000      1.2
@@ -69,6 +69,7 @@
     
     Precision get_largest_singular_value();
     Precision get_smallest_singular_value();
+    int get_smallest_singular_value_index();
     
     ///Return the pesudo-inverse diagonal. The reciprocal of the diagonal 
elements
     ///is returned if the elements are well scaled with respect to the largest 
element,
@@ -468,6 +469,20 @@
     return d;
   }
 
+  template<int M, int N, class Precision, bool WANT_U, bool WANT_V>
+  int GR_SVD<M,N,Precision,WANT_U,WANT_V>::get_smallest_singular_value_index()
+  {
+    using std::min;
+    int nMin=0;
+    Precision d = vDiagonal[0];
+    for(int i=1; i<N; ++i) 
+      if(vDiagonal[i] < d)
+       {
+         d = vDiagonal[i];
+         nMin = i;
+       }
+    return nMin;
+  }
 
 }
 #endif




reply via email to

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