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, Vector<Real> &x0, Vector<Real> &x,
82  const ETestObjectives test ) {
83  switch (test) {
84  case TESTOBJECTIVES_ROSENBROCK: ZOO::getRosenbrock<Real,StdVector<Real>,StdVector<Real> > (obj,x0,x); break;
86  case TESTOBJECTIVES_BEALE: ZOO::getBeale(obj,x0,x); break;
87  case TESTOBJECTIVES_POWELL: ZOO::getPowell(obj,x0,x); break;
89  case TESTOBJECTIVES_LEASTSQUARES: ZOO::getLeastSquares(obj,x0,x); break;
92  case TESTOBJECTIVES_ZAKHAROV: ZOO::getZakharov(obj,x0,x); break;
93  case TESTOBJECTIVES_LAST: break;
94  }
95  }
96 
97 
98 
99  template<class Real>
100  void getTestObjectives( Teuchos::RCP<Objective<Real> > &obj, Teuchos::RCP<BoundConstraint<Real> > &con,
101  Vector<Real> &x0, Vector<Real> &x,
102  const ETestOptProblem test ) {
103  switch (test) {
104  case TESTOPTPROBLEM_HS1: ZOO::getHS1(obj,con,x0,x); break;
105  case TESTOPTPROBLEM_HS2: ZOO::getHS2(obj,con,x0,x); break;
106  case TESTOPTPROBLEM_HS3: ZOO::getHS3(obj,con,x0,x); break;
107  case TESTOPTPROBLEM_HS4: ZOO::getHS4(obj,con,x0,x); break;
108  case TESTOPTPROBLEM_HS5: ZOO::getHS5(obj,con,x0,x); break;
109  case TESTOPTPROBLEM_HS25: ZOO::getHS25(obj,con,x0,x); break;
110  case TESTOPTPROBLEM_HS38: ZOO::getHS38(obj,con,x0,x); break;
111  case TESTOPTPROBLEM_HS45: ZOO::getHS45(obj,con,x0,x); break;
112  case TESTOPTPROBLEM_BVP: ZOO::getBVP(obj,con,x0,x); break;
113  case TESTOPTPROBLEM_LAST: break;
114  }
115  }
116 } // namespace ROL
117 
118 #endif
ETestOptProblem
Enumeration of test optimization problems.
Definition: ROL_Types.hpp:848
Contains definitions for W. Hock and K. Schittkowski 38th test function.
Provides the interface to evaluate objective functions.
void getPowell(Teuchos::RCP< Objective< Real > > &obj, Vector< Real > &x0, Vector< Real > &x)
Definition: ROL_Powell.hpp:168
void getPoissonInversion(Teuchos::RCP< Objective< Real > > &obj, Vector< Real > &x0, Vector< Real > &x)
void getHS25(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Vector< Real > &x0, Vector< Real > &x)
Definition: ROL_HS25.hpp:134
void getPoissonControl(Teuchos::RCP< Objective< Real > > &obj, Vector< Real > &x0, Vector< Real > &x)
void getSumOfSquares(Teuchos::RCP< Objective< Real > > &obj, Vector< Real > &x0, Vector< Real > &x)
void getZakharov(Teuchos::RCP< Objective< Real > > &obj, Vector< Real > &x0, Vector< Real > &x)
Contains definitions of custom data types in ROL.
Contains definitions for Poisson optimal control.
Contains definitions for W. Hock and K. Schittkowski 25th test function.
void getHS1(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Vector< Real > &x0, Vector< Real > &x)
Definition: ROL_HS1.hpp:122
Contains definitions for Beale's function.
Contains definitions for Rosenbrock's function.
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:72
void getHS3(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Vector< Real > &x0, Vector< Real > &x)
Definition: ROL_HS3.hpp:122
Contains definitions for W. Hock and K. Schittkowski 4th test function.
Contains definitions for Poisson material inversion.
void getHS38(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Vector< Real > &x0, Vector< Real > &x)
Definition: ROL_HS38.hpp:127
Contains definitions for Freudenstein and Roth's function.
void getTestObjectives(Teuchos::RCP< Objective< Real > > &obj, Vector< Real > &x0, Vector< Real > &x, const ETestObjectives test)
Provides the std::vector implementation of the ROL::Vector interface.
void getHS4(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Vector< Real > &x0, Vector< Real > &x)
Definition: ROL_HS4.hpp:102
void getBVP(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Vector< Real > &x0, Vector< Real > &x)
Definition: ROL_BVP.hpp:149
void getHS2(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Vector< Real > &x0, Vector< Real > &x)
Definition: ROL_HS2.hpp:124
Contains definitions for least squares function.
void getHS45(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Vector< Real > &x0, Vector< Real > &x)
Definition: ROL_HS45.hpp:134
void getLeastSquares(Teuchos::RCP< Objective< Real > > &obj, Vector< Real > &x0, Vector< Real > &x)
Contains definitions for Powell's badly scaled function.
Contains definitions for the Zakharov function as evaluated using only the ROL::Vector interface...
void getBeale(Teuchos::RCP< Objective< Real > > &obj, Vector< Real > &x0, Vector< Real > &x)
Definition: ROL_Beale.hpp:186
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.
ETestObjectives
Enumeration of test objective functions.
Definition: ROL_Types.hpp:761
Contains definitions for W. Hock and K. Schittkowski 3rd test function.
Contains definitions for W. Hock and K. Schittkowski 5th test function.
Contains definitions for W. Hock and K. Schittkowski 45th test function.
void getFreudensteinRoth(Teuchos::RCP< Objective< Real > > &obj, Vector< Real > &x0, Vector< Real > &x)
Contains definitions for W. Hock and K. Schittkowski 2nd test function.
Contains definitions for sum of squares function.
void getHS5(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Vector< Real > &x0, Vector< Real > &x)
Definition: ROL_HS5.hpp:122