16 #include "ROL_Ptr.hpp"
39 ROL::Ptr<Vector<Real> >
tG_;
40 ROL::Ptr<Vector<Real> >
eG_;
41 ROL::Ptr<Vector<Real> >
yG_;
42 ROL::Ptr<Vector<Real> >
gx_;
43 ROL::Ptr<Vector<Real> >
ge_;
54 void remove(
const std::vector<unsigned> &ind) {
56 for (
unsigned j = ind.back()+1; j <
size_; ++j) {
66 for (
unsigned i = ind.size()-1; i > 0; --i) {
67 for (
unsigned j = ind[i-1]+1; j <
size_; ++j) {
70 distanceMeasures_[j-1] = distanceMeasures_[j];
71 dualVariables_[j-1] = dualVariables_[j];
93 const Real coeff = 0.0,
94 const Real omega = 2.0,
95 const unsigned remSize = 2)
114 Real
zero(0), one(1);
115 for (
unsigned i = 0; i <
maxSize_; ++i) {
132 virtual unsigned solveDual(
const Real t,
const unsigned maxit = 1000,
const Real tol = 1.e-8) = 0;
161 if (
coeff_ > ROL_EPSILON<Real>() ) {
167 const Real
alpha(
const unsigned i)
const {
176 Real
zero(0), one(1);
178 Real eLE(0), eDM(0), yLE(0), yDM(0), tLE(0), tDM(0);
179 for (
unsigned i = 0; i <
size_; ++i) {
189 tLE = aggLinErr + yLE;
190 eLE = (tLE - aggLinErr) - yLE;
195 tDM = aggDistMeas + yDM;
196 eDM = (tDM - aggDistMeas) - yDM;
204 unsigned loc =
size_, cnt = 0;
205 std::vector<unsigned> ind(
remSize_,0);
206 for (
unsigned i =
size_; i > 0; --i) {
212 for (
unsigned i = 0; i <
size_; ++i) {
228 void update(
const bool flag,
const Real linErr,
const Real distMeas,
233 for (
unsigned i = 0; i <
size_; ++i) {
254 const Real
GiGj(
const unsigned i,
const unsigned j)
const {
267 Real one(1), half(0.5);
269 for (
unsigned i = 0; i < Bundle<Real>::size(); ++i) {
277 Real Hx(0), val(0), err(0), tmp(0), y(0);
278 for (
unsigned i = 0; i <
size(); ++i) {
283 y = x[i]*(half*Hx +
alpha(i)/t) - err;
285 err = (tmp - val) - y;
288 g[i] = Hx +
alpha(i)/t;
293 unsigned solveDual_dim1(
const Real t,
const unsigned maxit = 1000,
const Real tol = 1.e-8) {
299 unsigned solveDual_dim2(
const Real t,
const unsigned maxit = 1000,
const Real tol = 1.e-8) {
300 Real diffg =
gx_->dot(*
gx_),
zero(0), one(1), half(0.5);
302 if ( std::abs(diffg) > ROL_EPSILON<Real>() ) {
309 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.