ROL
Toggle main menu visibility
Loading...
Searching...
No Matches
src
function
operator
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
13
#include "
ROL_BlockOperator2UnitUpper.hpp
"
14
#include "
ROL_BlockOperator2UnitLower.hpp
"
15
#include "
ROL_BlockOperator2Diagonal.hpp
"
16
17
namespace
ROL
{
18
42
43
template
class<Real>
44
class
SchurComplement
{
45
46
typedef
Vector<Real>
V
;
47
typedef
PartitionedVector<Real>
PV
;
48
typedef
LinearOperator<Real>
OP
;
49
typedef
BlockOperator2UnitUpper
UPPER
;
50
typedef
BlockOperator2UnitLower
LOWER
;
51
52
private
:
53
54
ROL::Ptr<OP>
A_
,
B_
,
C_
,
D_
;
55
56
ROL::Ptr<OP>
L_
,
U_
;
57
ROL::Ptr<V>
scratch1_
;
58
59
60
61
public
:
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_BlockOperator2Diagonal.hpp
ROL_BlockOperator2UnitLower.hpp
ROL_BlockOperator2UnitUpper.hpp
ROL::BlockOperator2UnitLower
Provides the interface to apply a 2x2 block unit lower operator to a partitioned vector.
Definition
ROL_BlockOperator2UnitLower.hpp:29
ROL::BlockOperator2UnitUpper
Provides the interface to apply a 2x2 block unit upper operator to a partitioned vector.
Definition
ROL_BlockOperator2UnitUpper.hpp:29
ROL::BlockOperator2
Provides the interface to apply a 2x2 block operator to a partitioned vector.
Definition
ROL_BlockOperator2.hpp:26
ROL::LinearOperator
Provides the interface to apply a linear operator.
Definition
ROL_LinearOperator.hpp:37
ROL::PartitionedVector
Defines the linear algebra of vector space on a generic partitioned vector.
Definition
ROL_PartitionedVector.hpp:26
ROL::SchurComplement::UPPER
BlockOperator2UnitUpper UPPER
Definition
ROL_SchurComplement.hpp:49
ROL::SchurComplement::V
Vector< Real > V
Definition
ROL_SchurComplement.hpp:46
ROL::SchurComplement::applyUpperInverse
void applyUpperInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol)
Definition
ROL_SchurComplement.hpp:99
ROL::SchurComplement::applyLower
void applyLower(Vector< Real > &Hv, const Vector< Real > &v, Real &tol)
Definition
ROL_SchurComplement.hpp:87
ROL::SchurComplement::OP
LinearOperator< Real > OP
Definition
ROL_SchurComplement.hpp:48
ROL::SchurComplement::getS11
ROL::Ptr< OP > getS11(void)
Definition
ROL_SchurComplement.hpp:103
ROL::SchurComplement< Real >::L_
ROL::Ptr< OP > L_
Definition
ROL_SchurComplement.hpp:56
ROL::SchurComplement::LOWER
BlockOperator2UnitLower LOWER
Definition
ROL_SchurComplement.hpp:50
ROL::SchurComplement::applyUpper
void applyUpper(Vector< Real > &Hv, const Vector< Real > &v, Real &tol)
Definition
ROL_SchurComplement.hpp:95
ROL::SchurComplement< Real >::C_
ROL::Ptr< OP > C_
Definition
ROL_SchurComplement.hpp:54
ROL::SchurComplement< Real >::B_
ROL::Ptr< OP > B_
Definition
ROL_SchurComplement.hpp:54
ROL::SchurComplement< Real >::A_
ROL::Ptr< OP > A_
Definition
ROL_SchurComplement.hpp:54
ROL::SchurComplement::applyLowerInverse
void applyLowerInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol)
Definition
ROL_SchurComplement.hpp:91
ROL::SchurComplement::PV
PartitionedVector< Real > PV
Definition
ROL_SchurComplement.hpp:47
ROL::SchurComplement< Real >::scratch1_
ROL::Ptr< V > scratch1_
Definition
ROL_SchurComplement.hpp:57
ROL::SchurComplement::SchurComplement
SchurComplement(BlockOperator2< Real > &op, ROL::Ptr< Vector< Real > > &scratch1)
Definition
ROL_SchurComplement.hpp:74
ROL::SchurComplement::solve2
void solve2(Vector< Real > &Hv2, const Vector< Real > &v2, Real &tol)
Definition
ROL_SchurComplement.hpp:107
ROL::SchurComplement::SchurComplement
SchurComplement(ROL::Ptr< OP > &A, ROL::Ptr< OP > &B, ROL::Ptr< OP > &C, ROL::Ptr< OP > &D, ROL::Ptr< V > &scratch1)
Definition
ROL_SchurComplement.hpp:63
ROL::SchurComplement< Real >::U_
ROL::Ptr< OP > U_
Definition
ROL_SchurComplement.hpp:56
ROL::SchurComplement< Real >::D_
ROL::Ptr< OP > D_
Definition
ROL_SchurComplement.hpp:54
ROL::Vector
Defines the linear algebra or vector space interface.
Definition
ROL_Vector.hpp:51
ROL
Definition
ROL_ElementwiseVector.hpp:27
Generated by
1.17.0