ROL
ROL_DyadicOperator.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Rapid Optimization Library (ROL) Package
4 //
5 // Copyright 2014 NTESS and the ROL contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef ROL_DYADICOPERATOR_H
11 #define ROL_DYADICOPERATOR_H
12 
13 #include "ROL_LinearOperator.hpp"
14 
15 
21 namespace ROL {
22 
23 // Implementation of a Dyadic operator x*y'
24 template<class Real>
25 class DyadicOperator : public ROL::LinearOperator<Real> {
26 
28 
29 private:
30 
31  const ROL::Ptr<const V> x_;
32  const ROL::Ptr<const V> y_;
33 
34 public:
35 
36  DyadicOperator( const ROL::Ptr<const V> &x,
37  const ROL::Ptr<const V> &y ) : x_(x), y_(y) {}
38 
39  void apply( V &Hv, const V &v, Real &tol ) const {
40  Hv.set(*x_);
41  Hv.scale(v.dot(*y_));
42  }
43 
44  void applyInverse( V &Hv, const V &v, Real &tol ) const {
45 
46  ROL_TEST_FOR_EXCEPTION( true , std::logic_error,
47  ">>> ERROR (ROL_DyadicOperator, applyInverse): "
48  "Not implemented.");
49 
50  }
51 }; // class DyadicOperator
52 
53 } // namespace ROL
54 
55 
56 
57 
58 #endif // ROL_NULLOPERATOR_H
59 
virtual void scale(const Real alpha)=0
Compute where .
const ROL::Ptr< const V > y_
void apply(V &Hv, const V &v, Real &tol) const
Apply linear operator.
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
virtual Real dot(const Vector &x) const =0
Compute where .
const ROL::Ptr< const V > x_
void applyInverse(V &Hv, const V &v, Real &tol) const
Apply inverse of linear operator.
Interface to apply a dyadic operator to a vector.
Provides the interface to apply a linear operator.
virtual void set(const Vector &x)
Set where .
Definition: ROL_Vector.hpp:175
DyadicOperator(const ROL::Ptr< const V > &x, const ROL::Ptr< const V > &y)
ROL::Vector< Real > V