49 #include "Teuchos_GlobalMPISession.hpp"
52 #include "ROL_InteriorPointPrimalDualResidual.hpp"
62 int main(
int argc,
char *argv[]) {
64 typedef std::vector<RealT> vector;
75 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
77 int iprint = argc - 1;
78 ROL::Ptr<std::ostream> outStream;
81 outStream = ROL::makePtrFromRef(std::cout);
83 outStream = ROL::makePtrFromRef(bhs);
98 ROL::Ptr<vector> xo_ptr = ROL::makePtr<vector>(xo_dim,0.0);
99 ROL::Ptr<vector> xs_ptr = ROL::makePtr<vector>(ci_dim,0.0);
100 ROL::Ptr<vector> xe_ptr = ROL::makePtr<vector>(ce_dim,0.0);
101 ROL::Ptr<vector> xi_ptr = ROL::makePtr<vector>(ci_dim,0.0);
103 ROL::Ptr<V> xo = ROL::makePtr<SV>(xo_ptr);
104 ROL::Ptr<V> xs = ROL::makePtr<SV>(xs_ptr);
105 ROL::Ptr<V> xe = ROL::makePtr<SV>(xe_ptr);
106 ROL::Ptr<V> xi = ROL::makePtr<SV>(xi_ptr);
118 ROL::Ptr<vector> vo_ptr = ROL::makePtr<vector>(xo_dim,0.0);
119 ROL::Ptr<vector> vs_ptr = ROL::makePtr<vector>(ci_dim,0.0);
120 ROL::Ptr<vector> ve_ptr = ROL::makePtr<vector>(ce_dim,0.0);
121 ROL::Ptr<vector> vi_ptr = ROL::makePtr<vector>(ci_dim,0.0);
123 ROL::Ptr<V> vo = ROL::makePtr<SV>(vo_ptr);
124 ROL::Ptr<V> vs = ROL::makePtr<SV>(vs_ptr);
125 ROL::Ptr<V> ve = ROL::makePtr<SV>(ve_ptr);
126 ROL::Ptr<V> vi = ROL::makePtr<SV>(vi_ptr);
138 ROL::Ptr<vector> ro_ptr = ROL::makePtr<vector>(xo_dim,0.0);
139 ROL::Ptr<vector> rs_ptr = ROL::makePtr<vector>(ci_dim,0.0);
140 ROL::Ptr<vector> re_ptr = ROL::makePtr<vector>(ce_dim,0.0);
141 ROL::Ptr<vector> ri_ptr = ROL::makePtr<vector>(ci_dim,0.0);
143 ROL::Ptr<V> ro = ROL::makePtr<SV>(vo_ptr);
144 ROL::Ptr<V> rs = ROL::makePtr<SV>(vs_ptr);
145 ROL::Ptr<V> re = ROL::makePtr<SV>(ve_ptr);
146 ROL::Ptr<V> ri = ROL::makePtr<SV>(vi_ptr);
157 ROL::Ptr<ROL::Objective<RealT> > obj_hs32 =
158 ROL::makePtr<ROL::ZOO::Objective_HS32<RealT>>();
160 ROL::Ptr<ROL::EqualityConstraint<RealT> > eqcon_hs32 =
161 ROL::makePtr<ROL::ZOO::EqualityConstraint_HS32<RealT>>();
163 ROL::Ptr<ROL::EqualityConstraint<RealT> > incon_hs32 =
164 ROL::makePtr<ROL::ZOO::InequalityConstraint_HS32<RealT>>();
167 *outStream <<
"Performing finite difference check on Primal-Dual KKT system"
172 PrimalDualResidual<RealT> con(obj_hs32,eqcon_hs32,incon_hs32, *x);
174 con.checkApplyJacobian(*x,*v,*r,
true,*outStream);
178 catch (std::logic_error& err) {
179 *outStream << err.what() <<
"\n";
184 std::cout <<
"End Result: TEST FAILED\n";
186 std::cout <<
"End Result: TEST PASSED\n";
typename PV< Real >::size_type size_type
ROL::Ptr< Vector< Real > > CreatePartitionedVector(const ROL::Ptr< Vector< Real >> &a)
void RandomizeVector(Vector< Real > &x, const Real &lower=0.0, const Real &upper=1.0)
Fill a ROL::Vector with uniformly-distributed random numbers in the interval [lower,upper].
Defines the linear algebra or vector space interface.
Express the Primal-Dual Interior Point gradient as an equality constraint.
Provides the ROL::Vector interface for scalar values, to be used, for example, with scalar constraint...
Contains definitions for W. Hock and K. Schittkowski 32nd test problem which contains both inequality...
basic_nullstream< char, char_traits< char >> nullstream
int main(int argc, char *argv[])