ROL
ROL_ZeroProxObjective.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_ZEROPROXOBJECTIVE_HPP
11#define ROL_ZEROPROXOBJECTIVE_HPP
12
13#include "ROL_ProxObjective.hpp"
14
15namespace ROL {
16
17template<typename Real>
18class ZeroProxObjective : public ProxObjective<Real> {
19public:
20
21 Real value(const Vector<Real> x, Real &tol) override {
22 return static_cast<Real>(0);
23 }
24
25 void gradient(Vector<Real> &g, const Vector<Real> &x, Real &tol) override {
26 g.zero();
27 }
28
29 void prox(Vector<Real> &x, Real gamma) override {}
30
31};
32
33}
34
35#endif
Defines the linear algebra or vector space interface.
virtual void zero()
Set to zero vector.
void prox(Vector< Real > &x, Real gamma) override
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Compute gradient.
Real value(const Vector< Real > x, Real &tol) override