~ubuntu-branches/ubuntu/precise/insighttoolkit/precise

« back to all changes in this revision

Viewing changes to Code/Numerics/itkFRPROptimizer.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2008-05-31 12:07:29 UTC
  • mfrom: (3.1.3 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080531120729-7g7layn480le43ko
Tags: 3.6.0-3
* debian/patches/gccxml-workaround.patch: New.  Work around gccxml issue
  with #include_next; c.f. http://www.gccxml.org/Bug/view.php?id=7134.  
* debian/patches/gcc43.patch: include <cstring> in itkNeighbourhood.h.
  This only showed up in the tcl wrapping step.

* Above two entries fix FTBFS for GCC 4.3-based systems.
  Closes: #478500.

* debian/patches/sharedforward.patch: New.  Ensure that linux/sparc
  systems are not also configured as a SUN sparc system, which requires
  SUN header sys/isa_defs.h.  Closes: #478940, #483312.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
  Program:   Insight Segmentation & Registration Toolkit
4
4
  Module:    $RCSfile: itkFRPROptimizer.h,v $
5
5
  Language:  C++
6
 
  Date:      $Date: 2006/05/25 13:41:42 $
7
 
  Version:   $Revision: 1.2 $
 
6
  Date:      $Date: 2008-02-04 22:58:54 $
 
7
  Version:   $Revision: 1.5 $
8
8
 
9
9
  Copyright (c) Insight Software Consortium. All rights reserved.
10
10
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
26
26
 
27
27
/** \class FRPROptimizer
28
28
 * \brief Implements Fletch-Reeves & Polak-Ribiere optimization using dBrent
29
 
 * line search - adapted from Numerical Recipes in C (first edition).
 
29
 * line search.
30
30
 *
31
31
 * This optimizer needs a cost function.
32
32
 * This optimizer needs to be able to compute partial derivatives of the 
33
33
 *    cost function with respect to each parameter.
34
34
 *
35
 
 * The SetStepLength determines the initial distance to step in a line direction
36
 
 * when bounding the minimum (using bracketing triple spaced using a 
37
 
 * derivative-based search strategy).
 
35
 * The SetStepLength determines the initial distance to step in a line
 
36
 * direction when bounding the minimum (using bracketing triple spaced
 
37
 * using a derivative-based search strategy).
38
38
 *
39
39
 * The StepTolerance terminates optimization when the parameter values are
40
40
 * known to be within this (scaled) distance of the local extreme.
52
52
{
53
53
public:
54
54
  /** Standard "Self" typedef. */
55
 
  typedef FRPROptimizer                       Self ;
56
 
  typedef PowellOptimizer                     Superclass;
57
 
  typedef SmartPointer<Self>                  Pointer;
58
 
  typedef SmartPointer<const Self>            ConstPointer;
 
55
  typedef FRPROptimizer            Self;
 
56
  typedef PowellOptimizer          Superclass;
 
57
  typedef SmartPointer<Self>       Pointer;
 
58
  typedef SmartPointer<const Self> ConstPointer;
59
59
 
60
 
  typedef SingleValuedNonLinearOptimizer::ParametersType
61
 
                                              ParametersType;
 
60
  typedef SingleValuedNonLinearOptimizer::ParametersType ParametersType;
62
61
  
63
62
  /** Method for creation through the object factory. */
64
63
  itkNewMacro(Self);
70
69
  typedef  SingleValuedCostFunction         CostFunctionType;
71
70
  typedef  CostFunctionType::Pointer        CostFunctionPointer;
72
71
 
 
72
  /** Convert gradient to a unit length vector */
 
73
  itkSetMacro( UseUnitLengthGradient, bool );
 
74
  itkGetConstMacro( UseUnitLengthGradient, bool );
 
75
 
73
76
  /** Start optimization. */
74
77
  void StartOptimization();
75
78
 
80
83
  void SetToPolakRibiere();
81
84
  
82
85
protected:
83
 
  FRPROptimizer() ;
 
86
  FRPROptimizer();
84
87
  virtual ~FRPROptimizer(); 
85
88
 
86
89
  void PrintSelf(std::ostream& os, Indent indent) const;
96
99
 
97
100
 
98
101
private:
99
 
  FRPROptimizer(const FRPROptimizer&) ; // not implemented
 
102
  FRPROptimizer(const FRPROptimizer&); // not implemented
100
103
 
101
104
  typedef enum 
102
105
    {
106
109
 
107
110
  OptimizationType  m_OptimizationType;
108
111
 
109
 
} ; // end of class
 
112
  bool              m_UseUnitLengthGradient;
 
113
 
 
114
}; // end of class
110
115
 
111
116
} // end of namespace itk
112
117