ROL
Toggle main menu visibility
Loading...
Searching...
No Matches
src
function
operator
ROL_BlockOperator2Determinant.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_BLOCKOPERATOR2DETERMINANT_H
11
#define ROL_BLOCKOPERATOR2DETERMINANT_H
12
13
#include "
ROL_BlockOperator2.hpp
"
14
20
21
22
namespace
ROL
{
23
24
template
<
class
Real>
25
class
BlockOperator2Determinant
:
public
LinearOperator
<Real> {
26
27
typedef
Vector<Real>
V
;
28
typedef
LinearOperator<Real>
OP
;
29
30
private
:
31
32
ROL::Ptr<OP>
A_
,
B_
,
C_
,
D_
;
33
ROL::Ptr<V>
scratch_
;
34
35
public
:
36
37
BlockOperator2Determinant
( ROL::Ptr<OP> &A,
38
ROL::Ptr<OP> &B,
39
ROL::Ptr<OP> &C,
40
ROL::Ptr<OP> &D,
41
ROL::Ptr<V> &scratch ) :
42
A_
(A),
B_
(B),
C_
(C),
D_
(D),
scratch_
(scratch) {}
43
44
45
virtual
void
update
(
const
Vector<Real>
&x,
bool
flag =
true
,
int
iter = -1 ) {
46
A_
->update(x,flag,
true
);
47
B_
->update(x,flag,
true
);
48
C_
->update(x,flag,
true
);
49
D_
->update(x,flag,
true
);
50
}
51
52
// Apply the determinant \f$(A-BD^{-1}B)\f$
53
virtual
void
apply
(
Vector<Real>
&Hv,
const
Vector<Real>
&v, Real &tol )
const
{
54
B_
->apply(*
scratch_
,v,tol);
55
D_
->applyInverse(Hv,*
scratch_
,tol);
56
C_
->apply(*
scratch_
,Hv,tol);
57
A_
->apply(Hv,v,tol);
58
Hv.
axpy
(-1.0,*
scratch_
);
59
}
60
61
virtual
void
applyInverse
(
Vector<Real>
&Hv,
const
Vector<Real>
&v, Real &tol )
const
{
62
63
ROL_TEST_FOR_EXCEPTION(
true
, std::logic_error,
64
">>> ERROR (ROL_BlockOperator2Determinant, applyInverse): "
65
"Not implemented."
);
66
}
67
68
};
// class BlockOperator2Determinant
69
70
}
// namespace ROL
71
72
#endif
// ROL_BLOCKOPERATOR2DETERMINANT_H
ROL_BlockOperator2.hpp
ROL::BlockOperator2Determinant::B_
ROL::Ptr< OP > B_
Definition
ROL_BlockOperator2Determinant.hpp:32
ROL::BlockOperator2Determinant::D_
ROL::Ptr< OP > D_
Definition
ROL_BlockOperator2Determinant.hpp:32
ROL::BlockOperator2Determinant::update
virtual void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Definition
ROL_BlockOperator2Determinant.hpp:45
ROL::BlockOperator2Determinant::OP
LinearOperator< Real > OP
Definition
ROL_BlockOperator2Determinant.hpp:28
ROL::BlockOperator2Determinant::C_
ROL::Ptr< OP > C_
Definition
ROL_BlockOperator2Determinant.hpp:32
ROL::BlockOperator2Determinant::A_
ROL::Ptr< OP > A_
Definition
ROL_BlockOperator2Determinant.hpp:32
ROL::BlockOperator2Determinant::V
Vector< Real > V
Definition
ROL_BlockOperator2Determinant.hpp:27
ROL::BlockOperator2Determinant::apply
virtual void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Definition
ROL_BlockOperator2Determinant.hpp:53
ROL::BlockOperator2Determinant::scratch_
ROL::Ptr< V > scratch_
Definition
ROL_BlockOperator2Determinant.hpp:33
ROL::BlockOperator2Determinant::BlockOperator2Determinant
BlockOperator2Determinant(ROL::Ptr< OP > &A, ROL::Ptr< OP > &B, ROL::Ptr< OP > &C, ROL::Ptr< OP > &D, ROL::Ptr< V > &scratch)
Definition
ROL_BlockOperator2Determinant.hpp:37
ROL::BlockOperator2Determinant::applyInverse
virtual void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Definition
ROL_BlockOperator2Determinant.hpp:61
ROL::LinearOperator
Provides the interface to apply a linear operator.
Definition
ROL_LinearOperator.hpp:37
ROL::Vector
Defines the linear algebra or vector space interface.
Definition
ROL_Vector.hpp:51
ROL::Vector::axpy
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Definition
ROL_Vector.hpp:120
ROL
Definition
ROL_ElementwiseVector.hpp:27
Generated by
1.17.0