ROL
Public Member Functions | Private Attributes | List of all members
ROL::DiagonalOperator< Real > Class Template Reference

Provides the interface to apply a diagonal operator which acts like elementwise multiplication when apply() is used and elementwise division when applyInverse() is used. More...

#include <ROL_DiagonalOperator.hpp>

+ Inheritance diagram for ROL::DiagonalOperator< Real >:

Public Member Functions

 DiagonalOperator (const Vector< Real > &diag)
 
void update (const Vector< Real > &x, bool flag=true, int iter=-1)
 Update linear operator. More...
 
void apply (Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
 Apply linear operator. More...
 
void applyInverse (Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
 Apply inverse of linear operator. More...
 
- Public Member Functions inherited from ROL::LinearOperator< Real >
virtual ~LinearOperator ()
 
virtual void applyAdjoint (Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
 Apply adjoint of linear operator. More...
 
virtual void applyAdjointInverse (Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
 Apply adjoint of the inverse linear operator. More...
 

Private Attributes

ROL::Ptr< Vector< Real > > diag_
 
const Elementwise::Multiply< Real > mult_
 
const Elementwise::Divide< Real > div_
 

Detailed Description

template<class Real>
class ROL::DiagonalOperator< Real >

Provides the interface to apply a diagonal operator which acts like elementwise multiplication when apply() is used and elementwise division when applyInverse() is used.

Definition at line 62 of file ROL_DiagonalOperator.hpp.

Constructor & Destructor Documentation

template<class Real >
ROL::DiagonalOperator< Real >::DiagonalOperator ( const Vector< Real > &  diag)
inline

Definition at line 73 of file ROL_DiagonalOperator.hpp.

References ROL::DiagonalOperator< Real >::diag_.

Member Function Documentation

template<class Real >
void ROL::DiagonalOperator< Real >::update ( const Vector< Real > &  x,
bool  flag = true,
int  iter = -1 
)
inlinevirtual

Update linear operator.

This function updates the linear operator at new iterations.

Parameters
[in]xis the new iterate.
[in]flagis true if the iterate has changed.
[in]iteris the outer algorithm iterations count.

Reimplemented from ROL::LinearOperator< Real >.

Definition at line 77 of file ROL_DiagonalOperator.hpp.

References ROL::DiagonalOperator< Real >::diag_.

template<class Real >
void ROL::DiagonalOperator< Real >::apply ( Vector< Real > &  Hv,
const Vector< Real > &  v,
Real &  tol 
) const
inlinevirtual

Apply linear operator.

This function applies the linear operator to a vector.

Parameters
[out]Hvis the output vector.
[in]vis the input vector.
[in]tolis a tolerance for inexact linear operator application.

Implements ROL::LinearOperator< Real >.

Definition at line 81 of file ROL_DiagonalOperator.hpp.

References ROL::Vector< Real >::applyBinary(), ROL::DiagonalOperator< Real >::diag_, ROL::DiagonalOperator< Real >::mult_, and ROL::Vector< Real >::set().

template<class Real >
void ROL::DiagonalOperator< Real >::applyInverse ( Vector< Real > &  Hv,
const Vector< Real > &  v,
Real &  tol 
) const
inlinevirtual

Apply inverse of linear operator.

This function applies the inverse of linear operator to a vector.

Parameters
[out]Hvis the output vector.
[in]vis the input vector.
[in]tolis a tolerance for inexact linear operator application.

Reimplemented from ROL::LinearOperator< Real >.

Definition at line 86 of file ROL_DiagonalOperator.hpp.

References ROL::Vector< Real >::applyBinary(), ROL::DiagonalOperator< Real >::diag_, ROL::DiagonalOperator< Real >::div_, and ROL::Vector< Real >::set().

Member Data Documentation

template<class Real >
ROL::Ptr<Vector<Real> > ROL::DiagonalOperator< Real >::diag_
private
template<class Real >
const Elementwise::Multiply<Real> ROL::DiagonalOperator< Real >::mult_
private

Definition at line 68 of file ROL_DiagonalOperator.hpp.

Referenced by ROL::DiagonalOperator< Real >::apply().

template<class Real >
const Elementwise::Divide<Real> ROL::DiagonalOperator< Real >::div_
private

The documentation for this class was generated from the following file: