45 #ifndef ROL_RIESZVECTOR_H 46 #define ROL_RIESZVECTOR_H 79 template<
typename T>
using RCP = Teuchos::RCP<T>;
97 op_->apply(*(dual_->getVector()),*v_,tol_);
98 isDualInitialized_ =
true;
105 Real tol=std::sqrt(ROL_EPSILON<Real>()) ) :
106 v_(v), op_(op), tol_(tol), isDualInitialized_(false) {
111 virtual Real
dot(
const V &x )
const {
112 if( !isDualInitialized_ ) {
125 if( !isDualInitialized_ ) {
131 void applyUnary(
const Elementwise::UnaryFunction<Real> &f ) {
135 void applyBinary(
const Elementwise::BinaryFunction<Real> &f,
const V &x ) {
140 Real
reduce(
const Elementwise::ReductionOp<Real> &r )
const {
141 return v_->reduce(r);
160 template<
typename T>
using RCP = Teuchos::RCP<T>;
178 op_->applyInverse(*(primal_->getVector()),*v_,tol_);
179 isPrimalInitialized_ =
true;
186 Real tol=std::sqrt(ROL_EPSILON<Real>()) ) :
187 v_(v), op_(op), tol_(tol), isPrimalInitialized_(false) {
192 virtual Real
dot(
const V &x )
const {
193 if( !isPrimalInitialized_ ) {
206 if( !isPrimalInitialized_ ) {
212 void applyUnary(
const Elementwise::UnaryFunction<Real> &f ) {
216 void applyBinary(
const Elementwise::BinaryFunction<Real> &f,
const V &x ) {
221 Real
reduce(
const Elementwise::ReductionOp<Real> &r )
const {
222 return v_->reduce(r);
243 #endif // ROL_RIESZVECTOR_H
void initialize_primal(void) const
void applyUnary(const Elementwise::UnaryFunction< Real > &f)
RCP< const V > getVector(void) const
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.
Real reduce(const Elementwise::ReductionOp< Real > &r) const
RieszDualVector(const RCP< V > &v, const RCP< OP > &op, Real tol=std::sqrt(ROL_EPSILON< Real >()))
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...
RCP< const V > getVector(void) const
virtual RCP< V > clone() const
Clone to make a new (uninitialized) vector.
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)
RCP< PrimalVector > primal_
Real reduce(const Elementwise::ReductionOp< Real > &r) const
void initialize_dual(void) const
virtual Real dot(const V &x) const
Compute where .
RieszPrimalVector(const RCP< V > &v, const RCP< OP > &op, Real tol=std::sqrt(ROL_EPSILON< Real >()))
bool isPrimalInitialized_
virtual Real dot(const V &x) const
Compute where .
void applyBinary(const Elementwise::BinaryFunction< Real > &f, const V &x)
RieszDualVector< Real > DualVector
virtual const V & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
virtual RCP< V > clone() const
Clone to make a new (uninitialized) vector.