ROL
ROL_AffineTransformConstraint.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_CONSTRAINT_H
11 #define ROL_AFFINE_TRANSFORM_CONSTRAINT_H
12 
13 #include "ROL_Constraint.hpp"
14 #include "ROL_LinearConstraint.hpp"
15 #include "ROL_VectorController.hpp"
16 
25 namespace ROL {
26 
27 template <class Real>
28 class AffineTransformConstraint : public Constraint<Real> {
29 private:
30  const Ptr<Constraint<Real>> con_;
31  const Ptr<Constraint<Real>> acon_;
32 
33  Ptr<VectorController<Real>> storage_;
34  Ptr<Vector<Real>> primal_, dual_, Av_;
35 
36 public:
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  void value( Vector<Real> &c, const Vector<Real> &x, Real &tol ) override;
53  void applyJacobian( Vector<Real> &jv, const Vector<Real> &v, const Vector<Real> &x, Real &tol ) override;
54  void applyAdjointJacobian( Vector<Real> &ajv, const Vector<Real> &v, const Vector<Real> &x, Real &tol ) override;
55  void applyAdjointHessian( Vector<Real> &ahuv, const Vector<Real> &u, const Vector<Real> &v, const Vector<Real> &x, Real &tol ) override;
56 
57 private:
58  Ptr<const Vector<Real>> transform(const Vector<Real> &x);
59 
60 }; // class AffineTransformConstraint
61 
62 } // namespace ROL
63 
65 
66 #endif // ROL_AFFINE_TRANSFORM_OBJECTIVE_H
Defines the general affine constraint with the form .
Ptr< VectorController< Real > > storage_
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the constraint Jacobian at , , to vector .
Compose a constraint operator with an affine transformation, i.e.,.
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
void applyAdjointJacobian(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the adjoint of the the constraint Jacobian at , , to vector .
AffineTransformConstraint(const Ptr< Constraint< Real >> &con, const Ptr< Constraint< Real >> &acon, const Vector< Real > &range, const Ptr< VectorController< Real >> &storage=nullPtr)
Ptr< const Vector< Real > > transform(const Vector< Real > &x)
void update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Update constraint function.
Provides the interface to apply a linear operator.
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol) override
Evaluate the constraint operator at .
void applyAdjointHessian(Vector< Real > &ahuv, const Vector< Real > &u, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the derivative of the adjoint of the constraint Jacobian at to vector in direction ...
const Ptr< Constraint< Real > > acon_
Defines the general constraint operator interface.
const Ptr< Constraint< Real > > con_