ROL
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
13namespace ROL {
14
15template<typename Real>
17 : bnd_(bnd), con_(nullPtr) {}
18
19template<typename Real>
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
33template<typename Real>
34void 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
43template<typename Real>
44const Ptr<Constraint<Real>> PolyhedralProjection<Real>::getLinearConstraint(void) const {
45 return con_;
46}
47
48template<typename Real>
49const Ptr<BoundConstraint<Real>> PolyhedralProjection<Real>::getBoundConstraint(void) const {
50 return bnd_;
51}
52
53template<typename Real>
54const Ptr<Vector<Real>> PolyhedralProjection<Real>::getMultiplier(void) const {
55 return mul_;
56}
57
58template<typename Real>
59const Ptr<Vector<Real>> PolyhedralProjection<Real>::getResidual(void) const {
60 return res_;
61}
62
63} // namespace ROL
64
65#endif
Provides the interface to apply upper and lower bound constraints.
Defines the general constraint operator interface.
const Ptr< BoundConstraint< Real > > getBoundConstraint(void) const
virtual void project(Vector< Real > &x, std::ostream &stream=std::cout)
const Ptr< Vector< Real > > getResidual(void) const
const Ptr< Vector< Real > > getMultiplier(void) const
PolyhedralProjection(const Ptr< BoundConstraint< Real > > &bnd)
const Ptr< Constraint< Real > > getLinearConstraint(void) const
Defines the linear algebra or vector space interface.
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.