60 int main(
int argc,
char *argv[]) {
62 typedef std::vector<RealT> vector;
67 typedef typename vector::size_type uint;
73 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
75 int iprint = argc - 1;
76 RCP<std::ostream> outStream;
77 Teuchos::oblackholestream bhs;
79 outStream = rcp(&std::cout,
false);
81 outStream = rcp(&bhs,
false);
96 RCP<vector> xo_rcp = rcp(
new vector(xo_dim,0.0) );
97 RCP<vector> xs_rcp = rcp(
new vector(ci_dim,0.0) );
98 RCP<vector> xe_rcp = rcp(
new vector(ce_dim,0.0) );
99 RCP<vector> xi_rcp = rcp(
new vector(ci_dim,0.0) );
101 RCP<V> xo = rcp(
new SV(xo_rcp) );
102 RCP<V> xs = rcp(
new SV(xs_rcp) );
103 RCP<V> xe = rcp(
new SV(xe_rcp) );
104 RCP<V> xi = rcp(
new SV(xi_rcp) );
116 RCP<vector> vo_rcp = rcp(
new vector(xo_dim,0.0) );
117 RCP<vector> vs_rcp = rcp(
new vector(ci_dim,0.0) );
118 RCP<vector> ve_rcp = rcp(
new vector(ce_dim,0.0) );
119 RCP<vector> vi_rcp = rcp(
new vector(ci_dim,0.0) );
121 RCP<V> vo = rcp(
new SV(vo_rcp) );
122 RCP<V> vs = rcp(
new SV(vs_rcp) );
123 RCP<V> ve = rcp(
new SV(ve_rcp) );
124 RCP<V> vi = rcp(
new SV(vi_rcp) );
136 RCP<vector> ro_rcp = rcp(
new vector(xo_dim,0.0) );
137 RCP<vector> rs_rcp = rcp(
new vector(ci_dim,0.0) );
138 RCP<vector> re_rcp = rcp(
new vector(ce_dim,0.0) );
139 RCP<vector> ri_rcp = rcp(
new vector(ci_dim,0.0) );
141 RCP<V> ro = rcp(
new SV(vo_rcp) );
142 RCP<V> rs = rcp(
new SV(vs_rcp) );
143 RCP<V> re = rcp(
new SV(ve_rcp) );
144 RCP<V> ri = rcp(
new SV(vi_rcp) );
155 RCP<ROL::Objective<RealT> > obj_hs32 =
158 RCP<ROL::EqualityConstraint<RealT> > eqcon_hs32 =
161 RCP<ROL::EqualityConstraint<RealT> > incon_hs32 =
165 *outStream <<
"Performing finite difference check on Primal-Dual KKT system" 170 PrimalDualResidual<RealT> con(obj_hs32,eqcon_hs32,incon_hs32, *x);
172 con.checkApplyJacobian(*x,*v,*r,
true,*outStream);
176 catch (std::logic_error err) {
177 *outStream << err.what() <<
"\n";
182 std::cout <<
"End Result: TEST FAILED\n";
184 std::cout <<
"End Result: TEST PASSED\n";
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].
Teuchos::RCP< Vector< Real > > CreatePartitionedVector(const Teuchos::RCP< Vector< Real > > &a)
Defines the linear algebra or vector space interface.
Express the Primal-Dual Interior Point gradient as an equality constraint.
Provides the std::vector implementation of the ROL::Vector interface.
int main(int argc, char *argv[])
Contains definitions for W. Hock and K. Schittkowski 32nd test problem which contains both inequality...