ROL
ROL_TestObjectives.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ************************************************************************
3 //
4 // Rapid Optimization Library (ROL) Package
5 // Copyright (2014) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact lead developers:
38 // Drew Kouri (dpkouri@sandia.gov) and
39 // Denis Ridzal (dridzal@sandia.gov)
40 //
41 // ************************************************************************
42 // @HEADER
43 
49 #ifndef ROL_TESTOBJECTIVES_HPP
50 #define ROL_TESTOBJECTIVES_HPP
51 
52 
53 #include "ROL_Rosenbrock.hpp"
54 #include "ROL_FreudensteinRoth.hpp"
55 #include "ROL_Beale.hpp"
56 #include "ROL_Powell.hpp"
57 #include "ROL_SumOfSquares.hpp"
58 #include "ROL_LeastSquares.hpp"
59 #include "ROL_PoissonControl.hpp"
60 #include "ROL_PoissonInversion.hpp"
61 #include "ROL_Zakharov.hpp"
62 
63 #include "ROL_HS1.hpp"
64 #include "ROL_HS2.hpp"
65 #include "ROL_HS3.hpp"
66 #include "ROL_HS4.hpp"
67 #include "ROL_HS5.hpp"
68 #include "ROL_HS25.hpp"
69 #include "ROL_HS38.hpp"
70 #include "ROL_HS45.hpp"
71 #include "ROL_BVP.hpp"
72 
73 #include "ROL_Types.hpp"
74 #include "ROL_StdVector.hpp"
75 #include "ROL_Objective.hpp"
76 #include "ROL_BoundConstraint.hpp"
77 
78 namespace ROL {
79 
80  template<class Real>
81  void getTestObjectives( Teuchos::RCP<Objective<Real> > &obj,
82  Teuchos::RCP<Vector<Real> > &x0,
83  Teuchos::RCP<Vector<Real> > &x,
84  const ETestObjectives test ) {
85  switch (test) {
86  case TESTOBJECTIVES_ROSENBROCK: ZOO::getRosenbrock<Real,StdVector<Real>,StdVector<Real> > (obj,x0,x); break;
88  case TESTOBJECTIVES_BEALE: ZOO::getBeale(obj,x0,x); break;
89  case TESTOBJECTIVES_POWELL: ZOO::getPowell(obj,x0,x); break;
91  case TESTOBJECTIVES_LEASTSQUARES: ZOO::getLeastSquares(obj,x0,x); break;
94  case TESTOBJECTIVES_ZAKHAROV: ZOO::getZakharov(obj,x0,x); break;
95  case TESTOBJECTIVES_LAST: break;
96  }
97  }
98 
99 
100 
101  template<class Real>
102  void getTestObjectives( Teuchos::RCP<Objective<Real> > &obj,
103  Teuchos::RCP<BoundConstraint<Real> > &con,
104  Teuchos::RCP<Vector<Real> > &x0,
105  Teuchos::RCP<Vector<Real> > &x,
106  const ETestOptProblem test ) {
107  switch (test) {
108  case TESTOPTPROBLEM_HS1: ZOO::getHS1(obj,con,x0,x); break;
109  case TESTOPTPROBLEM_HS2: ZOO::getHS2(obj,con,x0,x); break;
110  case TESTOPTPROBLEM_HS3: ZOO::getHS3(obj,con,x0,x); break;
111  case TESTOPTPROBLEM_HS4: ZOO::getHS4(obj,con,x0,x); break;
112  case TESTOPTPROBLEM_HS5: ZOO::getHS5(obj,con,x0,x); break;
113  case TESTOPTPROBLEM_HS25: ZOO::getHS25(obj,con,x0,x); break;
114  case TESTOPTPROBLEM_HS38: ZOO::getHS38(obj,con,x0,x); break;
115  case TESTOPTPROBLEM_HS45: ZOO::getHS45(obj,con,x0,x); break;
116  case TESTOPTPROBLEM_BVP: ZOO::getBVP(obj,con,x0,x); break;
117  case TESTOPTPROBLEM_LAST: break;
118  }
119  }
120 } // namespace ROL
121 
122 #endif
ETestOptProblem
Enumeration of test optimization problems.
Definition: ROL_Types.hpp:948
Contains definitions for W. Hock and K. Schittkowski 38th test function.
Provides the interface to evaluate objective functions.
Contains definitions of custom data types in ROL.
void getHS3(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
Definition: ROL_HS3.hpp:137
Contains definitions for Poisson optimal control.
void getPowell(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
Definition: ROL_Powell.hpp:168
Contains definitions for W. Hock and K. Schittkowski 25th test function.
Contains definitions for Beale&#39;s function.
Contains definitions for Rosenbrock&#39;s function.
void getPoissonControl(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:74
void getFreudensteinRoth(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
void getHS1(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
Definition: ROL_HS1.hpp:123
void getTestObjectives(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x, const ETestObjectives test)
Contains definitions for W. Hock and K. Schittkowski 4th test function.
Contains definitions for Poisson material inversion.
Contains definitions for Freudenstein and Roth&#39;s function.
void getSumOfSquares(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
void getPoissonInversion(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
void getHS2(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
Definition: ROL_HS2.hpp:140
Contains definitions for least squares function.
Contains definitions for Powell&#39;s badly scaled function.
void getHS5(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
Definition: ROL_HS5.hpp:139
Contains definitions for the Zakharov function as evaluated using only the ROL::Vector interface...
Contains definitions for the discrete boundary value problem (More, Garbow, Hillstrom, 1981).
Contains definitions for W. Hock and K. Schittkowski 1st test function.
Provides the interface to apply upper and lower bound constraints.
void getHS4(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
Definition: ROL_HS4.hpp:118
ETestObjectives
Enumeration of test objective functions.
Definition: ROL_Types.hpp:859
Contains definitions for W. Hock and K. Schittkowski 3rd test function.
void getHS45(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
Definition: ROL_HS45.hpp:151
void getZakharov(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
void getBVP(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
Definition: ROL_BVP.hpp:156
void getBeale(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
Definition: ROL_Beale.hpp:186
void getLeastSquares(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
Contains definitions for W. Hock and K. Schittkowski 5th test function.
Contains definitions for W. Hock and K. Schittkowski 45th test function.
Contains definitions for W. Hock and K. Schittkowski 2nd test function.
Contains definitions for sum of squares function.
void getHS38(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
Definition: ROL_HS38.hpp:145
void getHS25(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Teuchos::RCP< Vector< Real > > &x0, Teuchos::RCP< Vector< Real > > &x)
Definition: ROL_HS25.hpp:178