45 #ifndef ROL_RIESZVECTOR_H
46 #define ROL_RIESZVECTOR_H
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);
163 class RieszDualVector :
public ElementwiseVector<Real> {
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 {
201 return primal_->getVector()->dot(*(ex.getVector()));
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 ) {
221 v_->applyBinary(f,*(ex.getVector()));
224 Real
reduce(
const Elementwise::ReductionOp<Real> &r )
const {
225 return v_->reduce(r);
250 #endif // ROL_RIESZVECTOR_H
virtual ROL::Ptr< V > clone() const
Clone to make a new (uninitialized) vector.
RieszPrimalVector(const ROL::Ptr< V > &v, const ROL::Ptr< OP > &op, Real tol=std::sqrt(ROL_EPSILON< Real >()))
void applyUnary(const Elementwise::UnaryFunction< Real > &f)
ROL::Ptr< PrimalVector > primal_
Intermediate abstract class which does not require users implements plus, set, scale, axpy, norm, dot, or zero if they implement the three elementwise functions: applyUnary, applyBinary, and reduce.
ROL::Ptr< DualVector > dual_
ROL::Ptr< const V > getVector(void) const
ROL::Ptr< V > getVector(void)
virtual ~RieszPrimalVector()
Defines the linear algebra or vector space interface.
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 .
void randomize(const Real l=0.0, const Real u=1.0)
Set vector to be uniform random between [l,u].
void setScalar(const Real C)
Set where .
virtual Real dot(const V &x) const
Compute where .
ROL::Ptr< V > getVector(void)
ROL::Ptr< const V > getVector(void) const
void initialize_dual(void) const
Real reduce(const Elementwise::ReductionOp< Real > &r) const
void randomize(const Real l=0.0, const Real u=1.0)
Set vector to be uniform random between [l,u].
virtual ~RieszDualVector()
void applyUnary(const Elementwise::UnaryFunction< Real > &f)
Provides the interface to apply a linear operator.
void applyBinary(const Elementwise::BinaryFunction< Real > &f, const V &x)
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
void setScalar(const Real C)
Set where .
bool isPrimalInitialized_
virtual ROL::Ptr< V > clone() const
Clone to make a new (uninitialized) vector.
virtual const V & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
void applyBinary(const Elementwise::BinaryFunction< Real > &f, const V &x)