ROL
|
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>
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_ |
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 28 of file ROL_DiagonalOperator.hpp.
|
inline |
Definition at line 39 of file ROL_DiagonalOperator.hpp.
References ROL::DiagonalOperator< Real >::diag_.
|
inlinevirtual |
Update linear operator.
This function updates the linear operator at new iterations.
[in] | x | is the new iterate. |
[in] | flag | is true if the iterate has changed. |
[in] | iter | is the outer algorithm iterations count. |
Reimplemented from ROL::LinearOperator< Real >.
Definition at line 43 of file ROL_DiagonalOperator.hpp.
References ROL::DiagonalOperator< Real >::diag_.
|
inlinevirtual |
Apply linear operator.
This function applies the linear operator to a vector.
[out] | Hv | is the output vector. |
[in] | v | is the input vector. |
[in] | tol | is a tolerance for inexact linear operator application. |
Implements ROL::LinearOperator< Real >.
Definition at line 47 of file ROL_DiagonalOperator.hpp.
References ROL::Vector< Real >::applyBinary(), ROL::DiagonalOperator< Real >::diag_, ROL::DiagonalOperator< Real >::mult_, and ROL::Vector< Real >::set().
|
inlinevirtual |
Apply inverse of linear operator.
This function applies the inverse of linear operator to a vector.
[out] | Hv | is the output vector. |
[in] | v | is the input vector. |
[in] | tol | is a tolerance for inexact linear operator application. |
Reimplemented from ROL::LinearOperator< Real >.
Definition at line 52 of file ROL_DiagonalOperator.hpp.
References ROL::Vector< Real >::applyBinary(), ROL::DiagonalOperator< Real >::diag_, ROL::DiagonalOperator< Real >::div_, and ROL::Vector< Real >::set().
|
private |
Definition at line 32 of file ROL_DiagonalOperator.hpp.
Referenced by ROL::DiagonalOperator< Real >::apply(), ROL::DiagonalOperator< Real >::applyInverse(), ROL::DiagonalOperator< Real >::DiagonalOperator(), and ROL::DiagonalOperator< Real >::update().
|
private |
Definition at line 34 of file ROL_DiagonalOperator.hpp.
Referenced by ROL::DiagonalOperator< Real >::apply().
|
private |
Definition at line 35 of file ROL_DiagonalOperator.hpp.
Referenced by ROL::DiagonalOperator< Real >::applyInverse().