ROL
Toggle main menu visibility
Loading...
Searching...
No Matches
src
function
polyproj
ROL_PolyhedralProjection_Def.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_POLYHEDRALPROJECTION_DEF_H
11
#define ROL_POLYHEDRALPROJECTION_DEF_H
12
13
namespace
ROL
{
14
15
template
<
typename
Real>
16
PolyhedralProjection<Real>::PolyhedralProjection
(
const
Ptr<
BoundConstraint<Real>
> &bnd)
17
:
bnd_
(bnd),
con_
(nullPtr) {}
18
19
template
<
typename
Real>
20
PolyhedralProjection<Real>::PolyhedralProjection
(
const
Vector<Real>
&xprim,
21
const
Vector<Real>
&xdual,
22
const
Ptr<
BoundConstraint<Real>
> &bnd,
23
const
Ptr<
Constraint<Real>
> &con,
24
const
Vector<Real>
&mul,
25
const
Vector<Real>
&res)
26
:
bnd_
(bnd),
con_
(con) {
27
xprim_
= xprim.
clone
();
28
xdual_
= xdual.
clone
();
29
mul_
= mul.
clone
();
30
res_
= res.
clone
();
31
}
32
33
template
<
typename
Real>
34
void
PolyhedralProjection<Real>::project
(
Vector<Real>
&x, std::ostream &stream) {
35
if
(
con_
== nullPtr) {
36
bnd_
->project(x);
37
}
38
else
{
39
throw
Exception::NotImplemented
(
">>> ROL::PolyhedralProjection::project : No projection implemented!"
);
40
}
41
}
42
43
template
<
typename
Real>
44
const
Ptr<Constraint<Real>>
PolyhedralProjection<Real>::getLinearConstraint
(
void
)
const
{
45
return
con_
;
46
}
47
48
template
<
typename
Real>
49
const
Ptr<BoundConstraint<Real>>
PolyhedralProjection<Real>::getBoundConstraint
(
void
)
const
{
50
return
bnd_
;
51
}
52
53
template
<
typename
Real>
54
const
Ptr<Vector<Real>>
PolyhedralProjection<Real>::getMultiplier
(
void
)
const
{
55
return
mul_
;
56
}
57
58
template
<
typename
Real>
59
const
Ptr<Vector<Real>>
PolyhedralProjection<Real>::getResidual
(
void
)
const
{
60
return
res_
;
61
}
62
63
}
// namespace ROL
64
65
#endif
ROL::BoundConstraint
Provides the interface to apply upper and lower bound constraints.
Definition
ROL_BoundConstraint.hpp:39
ROL::Constraint
Defines the general constraint operator interface.
Definition
ROL_Constraint.hpp:52
ROL::Exception::NotImplemented
Definition
ROL_Types.hpp:884
ROL::PolyhedralProjection::getBoundConstraint
const Ptr< BoundConstraint< Real > > getBoundConstraint(void) const
Definition
ROL_PolyhedralProjection_Def.hpp:49
ROL::PolyhedralProjection::con_
const Ptr< Constraint< Real > > con_
Definition
ROL_PolyhedralProjection.hpp:23
ROL::PolyhedralProjection::xprim_
Ptr< Vector< Real > > xprim_
Definition
ROL_PolyhedralProjection.hpp:24
ROL::PolyhedralProjection::bnd_
const Ptr< BoundConstraint< Real > > bnd_
Definition
ROL_PolyhedralProjection.hpp:22
ROL::PolyhedralProjection::project
virtual void project(Vector< Real > &x, std::ostream &stream=std::cout)
Definition
ROL_PolyhedralProjection_Def.hpp:34
ROL::PolyhedralProjection::mul_
Ptr< Vector< Real > > mul_
Definition
ROL_PolyhedralProjection.hpp:24
ROL::PolyhedralProjection::getResidual
const Ptr< Vector< Real > > getResidual(void) const
Definition
ROL_PolyhedralProjection_Def.hpp:59
ROL::PolyhedralProjection::xdual_
Ptr< Vector< Real > > xdual_
Definition
ROL_PolyhedralProjection.hpp:24
ROL::PolyhedralProjection::getMultiplier
const Ptr< Vector< Real > > getMultiplier(void) const
Definition
ROL_PolyhedralProjection_Def.hpp:54
ROL::PolyhedralProjection::res_
Ptr< Vector< Real > > res_
Definition
ROL_PolyhedralProjection.hpp:24
ROL::PolyhedralProjection::PolyhedralProjection
PolyhedralProjection(const Ptr< BoundConstraint< Real > > &bnd)
Definition
ROL_PolyhedralProjection_Def.hpp:16
ROL::PolyhedralProjection::getLinearConstraint
const Ptr< Constraint< Real > > getLinearConstraint(void) const
Definition
ROL_PolyhedralProjection_Def.hpp:44
ROL::Vector
Defines the linear algebra or vector space interface.
Definition
ROL_Vector.hpp:51
ROL::Vector::clone
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
ROL
Definition
ROL_ElementwiseVector.hpp:27
Generated by
1.17.0