ROL
ROL_AugmentedSystemPrecOperator.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_AUGMENTED_SYSTEM_PREC_OPERATOR_H
11 #define ROL_AUGMENTED_SYSTEM_PREC_OPERATOR_H
12 
13 #include "ROL_Constraint.hpp"
15 
23 namespace ROL {
24 
25 template <class Real>
27 private:
28  const Ptr<Constraint<Real>> con_;
29  const Ptr<const Vector<Real>> x_;
30 
31 public:
34  const Ptr<const Vector<Real>> &x)
35  : con_(con), x_(x) {}
36 
37  void apply( Vector<Real> &Hv, const Vector<Real> &v, Real &tol ) const {
38  throw Exception::NotImplemented(">>> AugmentedSystemPrecOperator::apply : Not Implemented!");
39  }
40 
41  void applyAdjoint( Vector<Real> &Hv, const Vector<Real> &v, Real &tol ) const {
42  throw Exception::NotImplemented(">>> AugmentedSystemPrecOperator::applyAdjoint : Not Implemented!");
43  }
44 
45  void applyInverse( Vector<Real> &Hv, const Vector<Real> &v, Real &tol ) const {
46  Real zero(0);
47  PartitionedVector<Real> &Hvp = dynamic_cast<PartitionedVector<Real>&>(Hv);
48  const PartitionedVector<Real> &vp = dynamic_cast<const PartitionedVector<Real>&>(v);
49 
50  Hvp.set(0, *(vp.get(0)));
51  // Second x should be dual, but unused?
52  con_->applyPreconditioner(*(Hvp.get(1)),*(vp.get(1)),*x_,*x_, zero);
53  }
54 
55  void applyAdjointInverse( Vector<Real> &Hv, const Vector<Real> &v, Real &tol ) const {
56  applyInverse(Hv,v,tol);
57  }
58 
59 }; // class AugmentedSystemPrecOperator
60 
61 } // namespace ROL
62 
63 #endif
ROL::Ptr< const Vector< Real > > get(size_type i) const
void applyAdjoint(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply adjoint of linear operator.
Defines the linear algebra of vector space on a generic partitioned vector.
void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
AugmentedSystemPrecOperator(const Ptr< Constraint< Real >> &con, const Ptr< const Vector< Real >> &x)
void applyAdjointInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply adjoint of the inverse linear operator.
void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply inverse of linear operator.
void set(const V &x)
Set where .
Provides the interface to apply a linear operator.
Implements a preconditioner for the augmented system.
Defines the general constraint operator interface.