59 DEFAULT_rtol_ (1e-2*std::sqrt(
ROL_EPSILON<Real>())),
60 DEFAULT_maxit_ (10000),
61 DEFAULT_verbosity_ (0),
62 DEFAULT_alpha1_ (0.5),
63 DEFAULT_gamma_ (10.0),
65 atol_ (DEFAULT_atol_),
66 rtol_ (DEFAULT_rtol_),
67 maxit_ (DEFAULT_maxit_),
68 verbosity_ (DEFAULT_verbosity_),
69 alpha1_ (DEFAULT_alpha1_),
70 alpha2_ (1.0-alpha1_),
71 gamma_ (DEFAULT_gamma_),
80 Real tol(std::sqrt(ROL_EPSILON<Real>()));
85 mul_->setScalar(
static_cast<Real
>(1));
86 con_->applyAdjointJacobian(*
z_,*
mul_,xprim,tol);
159 const Real one(1), two(2), xnorm(x.
norm()), ctol(std::min(atol_,rtol_*xnorm));
161 p_->zero(); q_->zero(); y_->set(x);
162 std::ios_base::fmtflags streamFlags(stream.flags());
163 if (verbosity_ > 2) {
164 stream << std::scientific << std::setprecision(6);
166 stream <<
" Polyhedral Projection using Douglas Rachford Splitting" << std::endl;
168 stream << std::setw(6) << std::left <<
"iter";
169 stream << std::setw(15) << std::left <<
"error";
170 stream << std::setw(15) << std::left <<
"tol";
173 for (
int cnt=0; cnt < maxit_; ++cnt) {
176 tmp_->axpy(alpha1_*gamma_,x);
177 tmp_->scale(one/(alpha1_*gamma_+one));
178 project_con(*p_,*tmp_);
182 tmp_->axpy(-one,*y_);
183 tmp_->axpy(alpha2_*gamma_,x);
184 tmp_->scale(one/(alpha2_*gamma_+one));
185 project_bnd(*q_,*tmp_);
188 tmp_->axpy(-one,*p_);
189 rnorm = tmp_->norm();
190 if (verbosity_ > 2) {
192 stream << std::setw(6) << std::left << cnt;
193 stream << std::setw(15) << std::left << rnorm;
194 stream << std::setw(15) << std::left << ctol;
197 if (rnorm <= ctol)
break;
200 if (verbosity_ > 2) stream << std::endl;
204 stream <<
">>> ROL::PolyhedralProjection::project : Projection may be inaccurate! rnorm = ";
205 stream << rnorm <<
" rtol = " << ctol << std::endl;
207 stream.flags(streamFlags);