ROL
Toggle main menu visibility
Loading...
Searching...
No Matches
src
function
operator
ROL_AugmentedSystemOperator.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_OPERATOR_H
11
#define ROL_AUGMENTED_SYSTEM_OPERATOR_H
12
13
#include "
ROL_Constraint.hpp
"
14
#include "
ROL_PartitionedVector.hpp
"
15
22
23
namespace
ROL
{
24
25
template
<
class
Real>
26
class
AugmentedSystemOperator
:
public
LinearOperator
<Real> {
27
private
:
28
const
Ptr<Constraint<Real>>
con_
;
29
const
Ptr<const Vector<Real>>
x_
;
30
const
Real
delta_
;
31
32
public
:
33
virtual
~AugmentedSystemOperator
() {}
34
AugmentedSystemOperator
(
const
Ptr<
Constraint<Real>
> &con,
35
const
Ptr<
const
Vector<Real>
> &x,
36
const
Real delta = 0.0)
37
:
con_
(con),
x_
(x),
delta_
(delta) {}
38
39
void
apply
(
Vector<Real>
&Hv,
const
Vector<Real>
&v, Real &tol )
const
{
40
PartitionedVector<Real>
&Hvp =
dynamic_cast<
PartitionedVector<Real>
&
>
(Hv);
41
const
PartitionedVector<Real>
&vp =
dynamic_cast<
const
PartitionedVector<Real>
&
>
(v);
42
43
Ptr<Vector<Real>> h1 = Hvp.
get
(0)->dual().clone();
44
con_
->applyAdjointJacobian(*h1, *(vp.
get
(1)), *
x_
, tol);
45
//con_->applyAdjointJacobian(*(Hvp.get(0)), *(vp.get(1)), *x_, tol);
46
//Hvp.get(0)->plus(*(vp.get(0)));
47
Hvp.
get
(0)->set(h1->
dual
()); Hvp.
get
(0)->plus(*(vp.
get
(0)));
48
49
con_
->applyJacobian(*(Hvp.
get
(1)), *(vp.
get
(0)), *
x_
, tol);
50
if
(
delta_
>
static_cast<
Real
>
(0) ) {
51
Hvp.
get
(1)->axpy(-
delta_
*
delta_
, *(vp.
get
(1)));
52
}
53
}
54
55
void
applyAdjoint
(
Vector<Real>
&Hv,
const
Vector<Real>
&v, Real &tol )
const
{
56
apply
(Hv,v,tol);
57
}
58
59
void
applyInverse
(
Vector<Real>
&Hv,
const
Vector<Real>
&v, Real &tol )
const
{
60
throw
Exception::NotImplemented
(
">>> AugmentedSystemOperator::applyInverse : Not implemented!"
);
61
}
62
63
void
applyAdjointInverse
(
Vector<Real>
&Hv,
const
Vector<Real>
&v, Real &tol )
const
{
64
throw
Exception::NotImplemented
(
">>> AugmentedSystemOperator::applyAdjointInverse : Not implemented!"
);
65
}
66
67
};
// class AugmentedSystemOperator
68
69
}
// namespace ROL
70
71
#endif
ROL_Constraint.hpp
ROL_PartitionedVector.hpp
ROL::AugmentedSystemOperator::~AugmentedSystemOperator
virtual ~AugmentedSystemOperator()
Definition
ROL_AugmentedSystemOperator.hpp:33
ROL::AugmentedSystemOperator::AugmentedSystemOperator
AugmentedSystemOperator(const Ptr< Constraint< Real > > &con, const Ptr< const Vector< Real > > &x, const Real delta=0.0)
Definition
ROL_AugmentedSystemOperator.hpp:34
ROL::AugmentedSystemOperator::applyAdjointInverse
void applyAdjointInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Definition
ROL_AugmentedSystemOperator.hpp:63
ROL::AugmentedSystemOperator::x_
const Ptr< const Vector< Real > > x_
Definition
ROL_AugmentedSystemOperator.hpp:29
ROL::AugmentedSystemOperator::apply
void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Definition
ROL_AugmentedSystemOperator.hpp:39
ROL::AugmentedSystemOperator::con_
const Ptr< Constraint< Real > > con_
Definition
ROL_AugmentedSystemOperator.hpp:28
ROL::AugmentedSystemOperator::applyAdjoint
void applyAdjoint(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Definition
ROL_AugmentedSystemOperator.hpp:55
ROL::AugmentedSystemOperator::applyInverse
void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Definition
ROL_AugmentedSystemOperator.hpp:59
ROL::AugmentedSystemOperator::delta_
const Real delta_
Definition
ROL_AugmentedSystemOperator.hpp:30
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::PartitionedVector
Defines the linear algebra of vector space on a generic partitioned vector.
Definition
ROL_PartitionedVector.hpp:26
ROL::PartitionedVector::get
ROL::Ptr< const Vector< Real > > get(size_type i) const
Definition
ROL_PartitionedVector.hpp:221
ROL::PartitionedVector::dual
const V & dual(void) const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis,...
Definition
ROL_PartitionedVector.hpp:111
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