24 DEFAULT_rtol_ (1e-2*std::sqrt(
ROL_EPSILON<Real>())),
25 DEFAULT_maxit_ (10000),
26 DEFAULT_verbosity_ (0),
27 DEFAULT_alpha1_ (0.5),
28 DEFAULT_gamma_ (10.0),
30 atol_ (DEFAULT_atol_),
31 rtol_ (DEFAULT_rtol_),
32 maxit_ (DEFAULT_maxit_),
33 verbosity_ (DEFAULT_verbosity_),
34 alpha1_ (DEFAULT_alpha1_),
35 alpha2_ (1.0-alpha1_),
36 gamma_ (DEFAULT_gamma_),
45 Real tol(std::sqrt(ROL_EPSILON<Real>()));
50 mul_->setScalar(
static_cast<Real
>(1));
51 con_->applyAdjointJacobian(*
z_,*
mul_,xprim,tol);
124 const Real one(1), two(2), xnorm(x.
norm()), ctol(std::min(atol_,rtol_*xnorm));
126 p_->zero(); q_->zero(); y_->set(x);
127 std::ios_base::fmtflags streamFlags(stream.flags());
128 if (verbosity_ > 2) {
129 stream << std::scientific << std::setprecision(6);
131 stream <<
" Polyhedral Projection using Douglas Rachford Splitting" << std::endl;
133 stream << std::setw(6) << std::left <<
"iter";
134 stream << std::setw(15) << std::left <<
"error";
135 stream << std::setw(15) << std::left <<
"tol";
138 for (
int cnt=0; cnt < maxit_; ++cnt) {
141 tmp_->axpy(alpha1_*gamma_,x);
142 tmp_->scale(one/(alpha1_*gamma_+one));
143 project_con(*p_,*tmp_);
147 tmp_->axpy(-one,*y_);
148 tmp_->axpy(alpha2_*gamma_,x);
149 tmp_->scale(one/(alpha2_*gamma_+one));
150 project_bnd(*q_,*tmp_);
153 tmp_->axpy(-one,*p_);
154 rnorm = tmp_->norm();
155 if (verbosity_ > 2) {
157 stream << std::setw(6) << std::left << cnt;
158 stream << std::setw(15) << std::left << rnorm;
159 stream << std::setw(15) << std::left << ctol;
162 if (rnorm <= ctol)
break;
165 if (verbosity_ > 2) stream << std::endl;
169 stream <<
">>> ROL::PolyhedralProjection::project : Projection may be inaccurate! rnorm = ";
170 stream << rnorm <<
" rtol = " << ctol << std::endl;
172 stream.flags(streamFlags);