11 #ifndef ROL_RIESZVECTOR_H
12 #define ROL_RIESZVECTOR_H
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);
129 class RieszDualVector :
public ElementwiseVector<Real> {
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 {
167 return primal_->getVector()->dot(*(ex.getVector()));
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 ) {
187 v_->applyBinary(f,*(ex.getVector()));
190 Real
reduce(
const Elementwise::ReductionOp<Real> &r )
const {
191 return v_->reduce(r);
216 #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)