50 #include "ROL_Ptr.hpp"
73 ROL::Ptr<Vector<Real> >
tG_;
74 ROL::Ptr<Vector<Real> >
eG_;
75 ROL::Ptr<Vector<Real> >
yG_;
76 ROL::Ptr<Vector<Real> >
gx_;
77 ROL::Ptr<Vector<Real> >
ge_;
88 void remove(
const std::vector<unsigned> &ind) {
90 for (
unsigned j = ind.back()+1; j <
size_; ++j) {
100 for (
unsigned i = ind.size()-1; i > 0; --i) {
101 for (
unsigned j = ind[i-1]+1; j <
size_; ++j) {
104 distanceMeasures_[j-1] = distanceMeasures_[j];
105 dualVariables_[j-1] = dualVariables_[j];
127 const Real coeff = 0.0,
128 const Real omega = 2.0,
129 const unsigned remSize = 2)
148 Real
zero(0), one(1);
149 for (
unsigned i = 0; i <
maxSize_; ++i) {
166 virtual unsigned solveDual(
const Real t,
const unsigned maxit = 1000,
const Real tol = 1.e-8) = 0;
195 if (
coeff_ > ROL_EPSILON<Real>() ) {
201 const Real
alpha(
const unsigned i)
const {
210 Real
zero(0), one(1);
212 Real eLE(0), eDM(0), yLE(0), yDM(0), tLE(0), tDM(0);
213 for (
unsigned i = 0; i <
size_; ++i) {
223 tLE = aggLinErr + yLE;
224 eLE = (tLE - aggLinErr) - yLE;
229 tDM = aggDistMeas + yDM;
230 eDM = (tDM - aggDistMeas) - yDM;
238 unsigned loc =
size_, cnt = 0;
239 std::vector<unsigned> ind(
remSize_,0);
240 for (
unsigned i =
size_; i > 0; --i) {
246 for (
unsigned i = 0; i <
size_; ++i) {
262 void update(
const bool flag,
const Real linErr,
const Real distMeas,
267 for (
unsigned i = 0; i <
size_; ++i) {
288 const Real
GiGj(
const unsigned i,
const unsigned j)
const {
301 Real one(1), half(0.5);
303 for (
unsigned i = 0; i < Bundle<Real>::size(); ++i) {
311 Real Hx(0), val(0), err(0), tmp(0), y(0);
312 for (
unsigned i = 0; i <
size(); ++i) {
317 y = x[i]*(half*Hx +
alpha(i)/t) - err;
319 err = (tmp - val) - y;
322 g[i] = Hx +
alpha(i)/t;
327 unsigned solveDual_dim1(
const Real t,
const unsigned maxit = 1000,
const Real tol = 1.e-8) {
333 unsigned solveDual_dim2(
const Real t,
const unsigned maxit = 1000,
const Real tol = 1.e-8) {
334 Real diffg =
gx_->dot(*
gx_),
zero(0), one(1), half(0.5);
336 if ( std::abs(diffg) > ROL_EPSILON<Real>() ) {
343 if ( std::abs(
alpha(0)-
alpha(1)) > ROL_EPSILON<Real>() ) {
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
const Real dotGi(const unsigned i, const Vector< Real > &x) const
void resetDualVariables(void)
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
void update(const bool flag, const Real linErr, const Real distMeas, const Vector< Real > &g, const Vector< Real > &s)
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
const Real linearizationError(const unsigned i) const
void setDualVariable(const unsigned i, const Real val)
Contains definitions of custom data types in ROL.
void reset(const Vector< Real > &g, const Real le, const Real dm)
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
const Vector< Real > & subgradient(const unsigned i) const
virtual Real dot(const Vector &x) const =0
Compute where .
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
const Real computeAlpha(const Real dm, const Real le) const
std::vector< Real > dualVariables_
const Real alpha(const unsigned i) const
ROL::Ptr< Vector< Real > > yG_
Bundle(const unsigned maxSize=10, const Real coeff=0.0, const Real omega=2.0, const unsigned remSize=2)
std::vector< Real > distanceMeasures_
Real evaluateObjective(std::vector< Real > &g, const std::vector< Real > &x, const Real t) const
const Real getDualVariable(const unsigned i) const
ROL::Ptr< Vector< Real > > eG_
virtual void initialize(const Vector< Real > &g)
void aggregate(Vector< Real > &aggSubGrad, Real &aggLinErr, Real &aggDistMeas) const
void addGi(const unsigned i, const Real a, Vector< Real > &x) const
ROL::Ptr< Vector< Real > > gx_
virtual unsigned solveDual(const Real t, const unsigned maxit=1000, const Real tol=1.e-8)=0
unsigned solveDual_dim1(const Real t, const unsigned maxit=1000, const Real tol=1.e-8)
unsigned size(void) const
const Real distanceMeasure(const unsigned i) const
ROL::Ptr< Vector< Real > > tG_
virtual void set(const Vector &x)
Set where .
const Real GiGj(const unsigned i, const unsigned j) const
ROL::Ptr< Vector< Real > > ge_
std::vector< Real > linearizationErrors_
unsigned solveDual_dim2(const Real t, const unsigned maxit=1000, const Real tol=1.e-8)
void add(const Vector< Real > &g, const Real le, const Real dm)
std::vector< ROL::Ptr< Vector< Real > > > subgradients_
Provides the interface for and implements a bundle.