ROL
Toggle main menu visibility
Loading...
Searching...
No Matches
src
function
operator
ROL_RangeSpaceOperator.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_RANGE_SPACE_OPERATOR_H
11
#define ROL_RANGE_SPACE_OPERATOR_H
12
13
#include "
ROL_Constraint.hpp
"
14
21
22
namespace
ROL
{
23
24
template
<
class
Real>
25
class
RangeSpaceOperator
:
public
LinearOperator
<Real> {
26
private
:
27
const
Ptr<Constraint<Real>>
con_
;
28
const
Ptr<Vector<Real>>
x_
;
29
30
mutable
Ptr<Vector<Real>>
b1_
;
31
mutable
Ptr<Vector<Real>>
b2_
;
32
mutable
Ptr<Vector<Real>>
mul_
;
33
34
public
:
35
virtual
~RangeSpaceOperator
() {}
36
RangeSpaceOperator
(
const
Ptr<
Constraint<Real>
> &con,
37
const
Ptr<
const
Vector<Real>
> &dom,
38
const
Ptr<
const
Vector<Real>
> &ran)
39
:
con_
(con),
x_
(dom->clone()) {
40
x_
->set(*dom);
41
b1_
= dom->dual().clone();
42
b2_
= ran->clone();
43
mul_
= ran->dual().clone();
44
}
45
46
virtual
void
update
(
const
Vector<Real>
&x,
bool
flag =
true
,
int
iter = -1 ) {
47
x_
->set(x);
48
}
49
50
virtual
void
apply
(
Vector<Real>
&Hv,
const
Vector<Real>
&v, Real &tol )
const
{
51
b1_
->zero();
b2_
->set(v);
52
con_
->solveAugmentedSystem(Hv,*
mul_
,*
b1_
,*
b2_
,*
x_
,tol);
// This assumes linearity
53
}
54
55
void
applyAdjoint
(
Vector<Real>
&Hv,
const
Vector<Real>
&v, Real &tol )
const
{
56
throw
Exception::NotImplemented
(
">>> RangeSpaceOperator::applyAdjoint : Not Implemented!"
);
57
}
58
59
void
applyInverse
(
Vector<Real>
&Hv,
const
Vector<Real>
&v, Real &tol )
const
{
60
throw
Exception::NotImplemented
(
">>> RangeSpaceOperator::applyInverse : Not Implemented!"
);
61
}
62
63
void
applyAdjointInverse
(
Vector<Real>
&Hv,
const
Vector<Real>
&v, Real &tol )
const
{
64
throw
Exception::NotImplemented
(
">>> RangeSpaceOperator::applyAdjointInverse : Not Implemented!"
);
65
}
66
67
};
// class RangeSpaceOperator
68
69
}
// namespace ROL
70
71
#endif
ROL_Constraint.hpp
ROL::Constraint
Defines the general constraint operator interface.
Definition
ROL_Constraint.hpp:52
ROL::Exception::NotImplemented
Definition
ROL_Types.hpp:884
ROL::LinearOperator
Provides the interface to apply a linear operator.
Definition
ROL_LinearOperator.hpp:37
ROL::RangeSpaceOperator::applyAdjoint
void applyAdjoint(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Definition
ROL_RangeSpaceOperator.hpp:55
ROL::RangeSpaceOperator::x_
const Ptr< Vector< Real > > x_
Definition
ROL_RangeSpaceOperator.hpp:28
ROL::RangeSpaceOperator::b1_
Ptr< Vector< Real > > b1_
Definition
ROL_RangeSpaceOperator.hpp:30
ROL::RangeSpaceOperator::~RangeSpaceOperator
virtual ~RangeSpaceOperator()
Definition
ROL_RangeSpaceOperator.hpp:35
ROL::RangeSpaceOperator::b2_
Ptr< Vector< Real > > b2_
Definition
ROL_RangeSpaceOperator.hpp:31
ROL::RangeSpaceOperator::apply
virtual void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Definition
ROL_RangeSpaceOperator.hpp:50
ROL::RangeSpaceOperator::update
virtual void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Definition
ROL_RangeSpaceOperator.hpp:46
ROL::RangeSpaceOperator::mul_
Ptr< Vector< Real > > mul_
Definition
ROL_RangeSpaceOperator.hpp:32
ROL::RangeSpaceOperator::con_
const Ptr< Constraint< Real > > con_
Definition
ROL_RangeSpaceOperator.hpp:27
ROL::RangeSpaceOperator::applyAdjointInverse
void applyAdjointInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Definition
ROL_RangeSpaceOperator.hpp:63
ROL::RangeSpaceOperator::RangeSpaceOperator
RangeSpaceOperator(const Ptr< Constraint< Real > > &con, const Ptr< const Vector< Real > > &dom, const Ptr< const Vector< Real > > &ran)
Definition
ROL_RangeSpaceOperator.hpp:36
ROL::RangeSpaceOperator::applyInverse
void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Definition
ROL_RangeSpaceOperator.hpp:59
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