11#ifndef ROL_RIESZVECTOR_H
12#define ROL_RIESZVECTOR_H
36class RieszPrimalVector;
52 mutable ROL::Ptr<DualVector>
dual_;
53 const ROL::Ptr<OP>
op_;
68 const ROL::Ptr<OP> &op,
69 Real tol=std::sqrt(ROL_EPSILON<Real>()) ) :
75 virtual Real
dot(
const V &x )
const {
84 virtual ROL::Ptr<V>
clone()
const {
85 return ROL::makePtr<RieszPrimalVector>(
v_->clone(),
op_,
tol_ );
88 virtual const V &
dual()
const {
95 void applyUnary(
const Elementwise::UnaryFunction<Real> &f ) {
99 void applyBinary(
const Elementwise::BinaryFunction<Real> &f,
const V &x ) {
104 Real
reduce(
const Elementwise::ReductionOp<Real> &r )
const {
105 return v_->reduce(r);
137 const ROL::Ptr<V>
v_;
154 const ROL::Ptr<OP> &op,
155 Real tol=std::sqrt(ROL_EPSILON<Real>()) ) :
161 virtual Real
dot(
const V &x )
const {
171 return ROL::makePtr<RieszDualVector>(
v_->clone(),
op_,
tol_ );
181 void applyUnary(
const Elementwise::UnaryFunction<Real> &f ) {
185 void applyBinary(
const Elementwise::BinaryFunction<Real> &f,
const V &x ) {
190 Real
reduce(
const Elementwise::ReductionOp<Real> &r )
const {
191 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.