toon-members
[Top][All Lists]
Advanced

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

[Toon-members] TooN/optimization golden_section.h


From: Edward Rosten
Subject: [Toon-members] TooN/optimization golden_section.h
Date: Tue, 14 Apr 2009 12:56:25 +0000

CVSROOT:        /cvsroot/toon
Module name:    TooN
Changes by:     Edward Rosten <edrosten>        09/04/14 12:56:25

Modified files:
        optimization   : golden_section.h 

Log message:
        Update docs.

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

Patches:
Index: golden_section.h
===================================================================
RCS file: /cvsroot/toon/TooN/optimization/golden_section.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- golden_section.h    7 Apr 2009 14:33:06 -0000       1.2
+++ golden_section.h    14 Apr 2009 12:56:25 -0000      1.3
@@ -15,22 +15,6 @@
        /// must be in order, so  that \f$ a < b < c \f$ and \f$ f(a) > f(b) < 
f(c) \f$.
        /// @param a The most negative point along the line.
        /// @param b The central point.
-       /// @param c The most positive point along the line.
-       /// @param func The functor to minimize
-       /// @param maxiterations  Maximum number of iterations
-       /// @param tolerance Tolerance at which the search should be stopped.
-       /// @return The minima position is returned as the first element of the 
vector,
-       ///         and the minimal value as the second element.
-       template<class Functor, class Precision> Vector<2, Precision> 
golden_section_search(Precision a, Precision b, Precision c, const Functor& 
func, int maxiterations, Precision tol = 
sqrt(numeric_limits<Precision>::epsilon()))
-       {
-               return golden_section_search(a, b, c, func(b), func, 
maxiterations, tol);
-       }
-
-       /// golden_section_search performs a golden section search line 
minimization
-       /// on the functor provided. The inputs a, b, c must bracket the 
minimum, and
-       /// must be in order, so  that \f$ a < b < c \f$ and \f$ f(a) > f(b) < 
f(c) \f$.
-       /// @param a The most negative point along the line.
-       /// @param b The central point.
        /// @param fb The value of the function at the central point (\f$b\f$).
        /// @param c The most positive point along the line.
        /// @param func The functor to minimize
@@ -105,5 +89,21 @@
                        return makeVector<Precision>(x2, fx2);
        }
 
+       /// golden_section_search performs a golden section search line 
minimization
+       /// on the functor provided. The inputs a, b, c must bracket the 
minimum, and
+       /// must be in order, so  that \f$ a < b < c \f$ and \f$ f(a) > f(b) < 
f(c) \f$.
+       /// @param a The most negative point along the line.
+       /// @param b The central point.
+       /// @param c The most positive point along the line.
+       /// @param func The functor to minimize
+       /// @param maxiterations  Maximum number of iterations
+       /// @param tolerance Tolerance at which the search should be stopped.
+       /// @return The minima position is returned as the first element of the 
vector,
+       ///         and the minimal value as the second element.
+       template<class Functor, class Precision> Vector<2, Precision> 
golden_section_search(Precision a, Precision b, Precision c, const Functor& 
func, int maxiterations, Precision tol = 
sqrt(numeric_limits<Precision>::epsilon()))
+       {
+               return golden_section_search(a, b, c, func(b), func, 
maxiterations, tol);
+       }
+
 }
 #endif




reply via email to

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