45#ifndef ROL_RIESZVECTOR_H
46#define ROL_RIESZVECTOR_H
70class RieszPrimalVector;
86 mutable ROL::Ptr<DualVector>
dual_;
87 const ROL::Ptr<OP>
op_;
102 const ROL::Ptr<OP> &op,
103 Real tol=std::sqrt(ROL_EPSILON<Real>()) ) :
109 virtual Real
dot(
const V &x )
const {
119 return ROL::makePtr<RieszPrimalVector>(
v_->clone(),
op_,
tol_ );
129 void applyUnary(
const Elementwise::UnaryFunction<Real> &f ) {
133 void applyBinary(
const Elementwise::BinaryFunction<Real> &f,
const V &x ) {
138 Real
reduce(
const Elementwise::ReductionOp<Real> &r )
const {
139 return v_->reduce(r);
171 const ROL::Ptr<V>
v_;
188 const ROL::Ptr<OP> &op,
189 Real tol=std::sqrt(ROL_EPSILON<Real>()) ) :
195 virtual Real
dot(
const V &x )
const {
205 return ROL::makePtr<RieszDualVector>(
v_->clone(),
op_,
tol_ );
215 void applyUnary(
const Elementwise::UnaryFunction<Real> &f ) {
219 void applyBinary(
const Elementwise::BinaryFunction<Real> &f,
const V &x ) {
224 Real
reduce(
const Elementwise::ReductionOp<Real> &r )
const {
225 return v_->reduce(r);
Intermediate abstract class which does not require users implements plus, set, scale,...
Provides the interface to apply a linear operator.
ROL::Ptr< PrimalVector > primal_
void applyBinary(const Elementwise::BinaryFunction< Real > &f, const V &x)
ROL::Ptr< V > getVector(void)
Real reduce(const Elementwise::ReductionOp< Real > &r) const
RieszDualVector(const ROL::Ptr< V > &v, const ROL::Ptr< OP > &op, Real tol=std::sqrt(ROL_EPSILON< Real >()))
void initialize_primal(void) const
virtual ROL::Ptr< V > clone() const
Clone to make a new (uninitialized) vector.
void setScalar(const Real C)
Set where .
void applyUnary(const Elementwise::UnaryFunction< Real > &f)
void randomize(const Real l=0.0, const Real u=1.0)
Set vector to be uniform random between [l,u].
virtual const V & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis,...
virtual Real dot(const V &x) const
Compute where .
virtual ~RieszDualVector()
ROL::Ptr< const V > getVector(void) const
bool isPrimalInitialized_
ROL::Ptr< DualVector > dual_
Real reduce(const Elementwise::ReductionOp< Real > &r) const
virtual ROL::Ptr< V > clone() const
Clone to make a new (uninitialized) vector.
void applyBinary(const Elementwise::BinaryFunction< Real > &f, const V &x)
ROL::Ptr< V > getVector(void)
void initialize_dual(void) const
ROL::Ptr< const V > getVector(void) const
virtual Real dot(const V &x) const
Compute where .
void randomize(const Real l=0.0, const Real u=1.0)
Set vector to be uniform random between [l,u].
virtual ~RieszPrimalVector()
void setScalar(const Real C)
Set where .
virtual const V & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis,...
void applyUnary(const Elementwise::UnaryFunction< Real > &f)
RieszPrimalVector(const ROL::Ptr< V > &v, const ROL::Ptr< OP > &op, Real tol=std::sqrt(ROL_EPSILON< Real >()))
Defines the linear algebra or vector space interface.