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
14
15
21namespace ROL {
22
23// Implementation of a Dyadic operator x*y'
24template<class Real>
25class DyadicOperator : public ROL::LinearOperator<Real> {
26
28
29private:
30
31 const ROL::Ptr<const V> x_;
32 const ROL::Ptr<const V> y_;
33
34public:
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
Interface to apply a dyadic operator to a vector.
void applyInverse(V &Hv, const V &v, Real &tol) const
Apply inverse of linear operator.
const ROL::Ptr< const V > x_
void apply(V &Hv, const V &v, Real &tol) const
Apply linear operator.
const ROL::Ptr< const V > y_
ROL::Vector< Real > V
DyadicOperator(const ROL::Ptr< const V > &x, const ROL::Ptr< const V > &y)
Provides the interface to apply a linear operator.
Defines the linear algebra or vector space interface.
virtual void set(const Vector &x)
Set where .
virtual void scale(const Real alpha)=0
Compute where .
virtual Real dot(const Vector &x) const =0
Compute where .