ROL
Toggle main menu visibility
Loading...
Searching...
No Matches
src
function
constraint
ROL_LowerBoundToConstraint_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_LOWER_BOUND_TO_CONSTRAINT_DEF_H
11
#define ROL_LOWER_BOUND_TO_CONSTRAINT_DEF_H
12
13
namespace
ROL
{
14
15
template
<
typename
Real>
16
LowerBoundToConstraint<Real>::LowerBoundToConstraint
(
BoundConstraint<Real>
&bnd) {
17
lo_
= bnd.
getLowerBound
()->clone();
18
lo_
->set(*bnd.
getLowerBound
());
19
}
20
21
template
<
typename
Real>
22
LowerBoundToConstraint<Real>::LowerBoundToConstraint
(
const
Vector<Real>
&lo) {
23
lo_
= lo.
clone
();
24
lo_
->set(lo);
25
}
26
27
template
<
typename
Real>
28
void
LowerBoundToConstraint<Real>::value
(
Vector<Real>
&c,
const
Vector<Real>
&x, Real &tol) {
29
const
Real one(1);
30
c.
set
(x);
31
c.
axpy
(-one,*
lo_
);
32
}
33
34
template
<
typename
Real>
35
void
LowerBoundToConstraint<Real>::applyJacobian
(
Vector<Real>
&jv,
36
const
Vector<Real>
&v,
37
const
Vector<Real>
&x,
38
Real &tol) {
39
jv.
set
(v);
40
}
41
42
template
<
typename
Real>
43
void
LowerBoundToConstraint<Real>::applyAdjointJacobian
(
Vector<Real>
&ajv,
44
const
Vector<Real>
&v,
45
const
Vector<Real>
&x,
46
Real &tol) {
47
ajv.
set
(v);
48
}
49
50
template
<
typename
Real>
51
void
LowerBoundToConstraint<Real>::applyAdjointHessian
(
Vector<Real>
&ahuv,
52
const
Vector<Real>
&u,
53
const
Vector<Real>
&v,
54
const
Vector<Real>
&x,
55
Real &tol) {
56
ahuv.
zero
();
57
}
58
59
}
60
61
#endif
ROL::BoundConstraint
Provides the interface to apply upper and lower bound constraints.
Definition
ROL_BoundConstraint.hpp:39
ROL::BoundConstraint::getLowerBound
virtual const Ptr< const Vector< Real > > getLowerBound(void) const
Return the ref count pointer to the lower bound vector.
Definition
ROL_BoundConstraint_Def.hpp:82
ROL::LowerBoundToConstraint::value
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol) override
Definition
ROL_LowerBoundToConstraint_Def.hpp:28
ROL::LowerBoundToConstraint::LowerBoundToConstraint
LowerBoundToConstraint(BoundConstraint< Real > &bnd)
Definition
ROL_LowerBoundToConstraint_Def.hpp:16
ROL::LowerBoundToConstraint::lo_
Ptr< Vector< Real > > lo_
Definition
ROL_LowerBoundToConstraint.hpp:26
ROL::LowerBoundToConstraint::applyJacobian
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Definition
ROL_LowerBoundToConstraint_Def.hpp:35
ROL::LowerBoundToConstraint::applyAdjointJacobian
void applyAdjointJacobian(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Definition
ROL_LowerBoundToConstraint_Def.hpp:43
ROL::LowerBoundToConstraint::applyAdjointHessian
void applyAdjointHessian(Vector< Real > &ahuv, const Vector< Real > &u, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Definition
ROL_LowerBoundToConstraint_Def.hpp:51
ROL::Vector
Defines the linear algebra or vector space interface.
Definition
ROL_Vector.hpp:51
ROL::Vector::set
virtual void set(const Vector &x)
Set where .
Definition
ROL_Vector.hpp:176
ROL::Vector::zero
virtual void zero()
Set to zero vector.
Definition
ROL_Vector.hpp:134
ROL::Vector::clone
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
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