ROL
Toggle main menu visibility
Loading...
Searching...
No Matches
src
function
objective
ROL_LinearObjective_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_LINEAR_OBJECTIVE_DEF_H
11
#define ROL_LINEAR_OBJECTIVE_DEF_H
12
13
namespace
ROL
{
14
15
template
<
typename
Real>
16
LinearObjective<Real>::LinearObjective
(
const
Ptr<
const
Vector<Real>
> &cost) :
cost_
(cost) {
17
dual_cost_
=
cost_
->dual().clone();
18
dual_cost_
->set(
cost_
->dual());
19
}
20
21
template
<
typename
Real>
22
Real
LinearObjective<Real>::value
(
const
Vector<Real>
&x, Real &tol ) {
23
return
x.
dot
(*
dual_cost_
);
24
}
25
26
template
<
typename
Real>
27
void
LinearObjective<Real>::gradient
(
Vector<Real>
&g,
const
Vector<Real>
&x, Real &tol ) {
28
g.
set
(*
cost_
);
29
}
30
31
template
<
typename
Real>
32
void
LinearObjective<Real>::hessVec
(
Vector<Real>
&hv,
const
Vector<Real>
&v,
const
Vector<Real>
&x, Real &tol ) {
33
hv.
zero
();
34
}
35
36
}
// namespace ROL
37
38
#endif
ROL::LinearObjective::gradient
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Definition
ROL_LinearObjective_Def.hpp:27
ROL::LinearObjective::hessVec
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Definition
ROL_LinearObjective_Def.hpp:32
ROL::LinearObjective::LinearObjective
LinearObjective(const Ptr< const Vector< Real > > &cost)
Definition
ROL_LinearObjective_Def.hpp:16
ROL::LinearObjective::dual_cost_
const Ptr< const Vector< Real > > dual_cost_
Definition
ROL_LinearObjective.hpp:35
ROL::LinearObjective::value
Real value(const Vector< Real > &x, Real &tol) override
Definition
ROL_LinearObjective_Def.hpp:22
ROL::LinearObjective::cost_
const Ptr< const Vector< Real > > cost_
Definition
ROL_LinearObjective.hpp:35
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::dot
virtual Real dot(const Vector &x) const =0
Compute where .
ROL
Definition
ROL_ElementwiseVector.hpp:27
Generated by
1.17.0