Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Multifunc.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file core/optimization/Multifunc.hh
11 /// @brief Multifunction interface class
12 /// @author Phil Bradley
13 
14 
15 #ifndef INCLUDED_core_optimization_Multifunc_hh
16 #define INCLUDED_core_optimization_Multifunc_hh
17 
18 // Unit headers
20 
21 // Package headers
23 
24 // Utility headers
25 #include <utility/pointer/ReferenceCount.hh>
26 
27 #include <utility/vector1.hh>
28 
29 
30 namespace core {
31 namespace optimization {
32 
33 
34 /// @brief Multifunction interface class
36 {
37 public:
39 
40 protected: // Creation
41 
42 
43  /// @brief Default constructor
44  inline
46  {}
47 
48 
49  /// @brief Copy constructor
50  inline
51  Multifunc( Multifunc const & ) : parent()
52  {}
53 
54 
55 public: // Creation
56 
57 
58  /// @brief Destructor
59  virtual
61  {}
62 
63 
64 protected: // Assignment
65 
66 
67  /// @brief Copy assignment
68  inline
69  Multifunc const &
70  operator =( Multifunc const & )
71  {
72  return *this;
73  }
74 
75 
76 public:
77 
78 
79  virtual
80  Real
81  operator ()( Multivec const & phipsi ) const = 0;
82 
83 
84  virtual
85  void
86  dfunc( Multivec const & phipsi, Multivec & dE_dphipsi ) const = 0;
87 
88  /// @brief Christophe added the following to allow premature end of minimization
89  /// If you want to abort the minimizer under specific circonstances
90  /// overload this function and return true if you want to stop, false if you want to continue.
91  /// FOR THE MOMENT, ONLY IN DFPMIN!
92  virtual
93  bool
94  abort_min(Multivec const & ) const{
95  return false; //By default, we don't abort.
96  }
97  //End Christophe modifications
98 
99 
100  /// @brief Error state reached -- derivative does not match gradient
101  /// Derived classes have the oportunity to now output and or analyze the two
102  /// vars assignments vars, vars+delta where the derivatives are incorrect.
103  virtual
104  void
105  dump( Multivec const & /*vars*/, Multivec const & /*vars2*/ ) const
106  {}
107 
108 
109 }; // Multifunc
110 
111 
112 } // namespace optimization
113 } // namespace core
114 
115 
116 #endif // INCLUDED_core_optimization_Multifunc_HH