ROL
ROL_SchurComplement.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_SCHURCOMPLEMENT_H
11#define ROL_SCHURCOMPLEMENT_H
12
16
17namespace ROL {
18
43template class<Real>
45
46 typedef Vector<Real> V;
51
52private:
53
54 ROL::Ptr<OP> A_, B_, C_, D_;
55
56 ROL::Ptr<OP> L_,U_;
57 ROL::Ptr<V> scratch1_;
58
59
60
61public:
62
63 SchurComplement( ROL::Ptr<OP> &A, ROL::Ptr<OP> &B,
64 ROL::Ptr<OP> &C, ROL::Ptr<OP> &D,
65 ROL::Ptr<V> &scratch1 ) :
66 A_(A), B_(B), C_(C), D_(D), scratch1_(scratch1) {
67
68 U_ = ROL::makePtr<UPPER>(B_);
69 L_ = ROL::makePtr<LOWER>(C_);
70
71 }
72
73
74 SchurComplement( BlockOperator2<Real> &op, ROL::Ptr<Vector<Real> > &scratch1 ) :
75 scratch1_(scratch1) {}
76
77
78
79 A_ = op.getOperator(0,0);
80 B_ = op.getOperator(0,1);
81 C_ = op.getOperator(1,0);
82 D_ = op.getOperator(1,1);
83
84 U_ = ROL::makePtr<UPPER>(B_);
85 L_ = ROL::makePtr<LOWER>(C_);
86
87 void applyLower( Vector<Real> &Hv, const Vector<Real> &v, Real &tol ) {
88 L_->apply(Hv,v,tol);
89 }
90
91 void applyLowerInverse( Vector<Real> &Hv, const Vector<Real> &v, Real &tol ) {
92 L_->applyInverse(Hv,v,tol);
93 }
94
95 void applyUpper( Vector<Real> &Hv, const Vector<Real> &v, Real &tol ) {
96 U_->apply(Hv,v,tol);
97 }
98
99 void applyUpperInverse( Vector<Real> &Hv, const Vector<Real> &v, Real &tol ) {
100 U_->applyInverse(Hv,v,tol);
101 }
102
103 ROL::Ptr<OP> getS11( void ) {
104 return ROL::makePtr<BlockOperator2Determinant<Real>>(A_,B_,C_,D_,scratch1_);
105 }
106
107 void solve2( Vector<Real> &Hv2, const Vector<Real> &v2, Real &tol ) {
108 D_->applyInverse(Hv2,v2,tol);
109 }
110
111}; // class SchurComplement
112
113
114} // namesapce ROL
115
116#endif // ROL_SCHURCOMPLEMENT_H
117
ROL::Ptr< OP > A_
ROL::Ptr< OP > D_
ROL::Ptr< OP > C_
ROL::Ptr< OP > B_
Provides the interface to apply a 2x2 block unit lower operator to a partitioned vector.
Provides the interface to apply a 2x2 block unit upper operator to a partitioned vector.
Provides the interface to apply a 2x2 block operator to a partitioned vector.
Provides the interface to apply a linear operator.
Defines the linear algebra of vector space on a generic partitioned vector.
Given a 2x2 block operator, perform the Schur reduction and return the decoupled system components.
BlockOperator2UnitUpper UPPER
void applyUpperInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol)
void applyLower(Vector< Real > &Hv, const Vector< Real > &v, Real &tol)
LinearOperator< Real > OP
ROL::Ptr< OP > getS11(void)
BlockOperator2UnitLower LOWER
void applyUpper(Vector< Real > &Hv, const Vector< Real > &v, Real &tol)
void applyLowerInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol)
PartitionedVector< Real > PV
SchurComplement(BlockOperator2< Real > &op, ROL::Ptr< Vector< Real > > &scratch1)
void solve2(Vector< Real > &Hv2, const Vector< Real > &v2, Real &tol)
SchurComplement(ROL::Ptr< OP > &A, ROL::Ptr< OP > &B, ROL::Ptr< OP > &C, ROL::Ptr< OP > &D, ROL::Ptr< V > &scratch1)
Defines the linear algebra or vector space interface.