ROL
ROL_NullOperator.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_NULLOPERATOR_H
11#define ROL_NULLOPERATOR_H
12
14
15
21namespace ROL {
22
23template<class Real>
24class NullOperator : public LinearOperator<Real> {
25
26 void apply( Vector<Real> &Hv, const Vector<Real> &v, Real &tol ) const {
27 Hv.zero();
28 }
29
30 void applyInverse( Vector<Real> &Hv, const Vector<Real> &v, Real &tol ) const {
31 ROL_TEST_FOR_EXCEPTION( true, std::logic_error,
32 ">>> ERROR (ROL_NullOperator, applyInverse): "
33 "Null Operator has no inverse.");
34 }
35
36};
37
38} // namespace ROL
39
40
41
42
43#endif // ROL_NULLOPERATOR_H
44
Provides the interface to apply a linear operator.
Multiplication by zero.
void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply inverse of linear operator.
void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
Defines the linear algebra or vector space interface.
virtual void zero()
Set to zero vector.