ROL
ROL_AffineTransformObjective.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_AFFINE_TRANSFORM_OBJECTIVE_H
11#define ROL_AFFINE_TRANSFORM_OBJECTIVE_H
12
13#include "ROL_Objective.hpp"
16
25namespace ROL {
26
27template<typename Real>
28class AffineTransformObjective : public Objective<Real> {
29private:
30 const Ptr<Objective<Real>> obj_;
31 const Ptr<Constraint<Real>> acon_;
32
33 Ptr<VectorController<Real>> storage_;
34 Ptr<Vector<Real>> primal_, dual_, Av_;
35
36public:
39 const Ptr<Constraint<Real>> &acon,
40 const Vector<Real> &range,
41 const Ptr<VectorController<Real>> &storage = nullPtr);
43 const Ptr<LinearConstraint<Real>> &acon,
44 const Ptr<VectorController<Real>> &storage = nullPtr);
46 const Ptr<const LinearOperator<Real>> &A,
47 const Ptr<const Vector<Real>> &b,
48 const Ptr<VectorController<Real>> &storage = nullPtr);
49
50 void update( const Vector<Real> &x, UpdateType type, int iter = -1 ) override;
51 void update( const Vector<Real> &x, bool flag = true, int iter = -1 ) override;
52 Real value( const Vector<Real> &x, Real &tol ) override;
53 void gradient( Vector<Real> &g, const Vector<Real> &x, Real &tol ) override;
54 void hessVec( Vector<Real> &hv, const Vector<Real> &v, const Vector<Real> &x, Real &tol ) override;
55 const Ptr<Objective<Real>> getObjective() const {return obj_;}
56
57public:
58 void setParameter(const std::vector<Real> &param) override;
59
60private:
61 Ptr<const Vector<Real>> transform(const Vector<Real> &x);
62
63}; // class AffineTransformObjective
64
65} // namespace ROL
66
68
69#endif // ROL_AFFINE_TRANSFORM_OBJECTIVE_H
Compose an objective function with an affine transformation, i.e.,.
const Ptr< Constraint< Real > > acon_
Ptr< const Vector< Real > > transform(const Vector< Real > &x)
const Ptr< Objective< Real > > getObjective() const
void update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Update objective function.
void setParameter(const std::vector< Real > &param) override
Ptr< VectorController< Real > > storage_
Real value(const Vector< Real > &x, Real &tol) override
Compute value.
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply Hessian approximation to vector.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Compute gradient.
Defines the general constraint operator interface.
Defines the general affine constraint with the form .
Provides the interface to apply a linear operator.
Provides the interface to evaluate objective functions.
Defines the linear algebra or vector space interface.