Main Page
Namespaces
Classes
Files
File List
File Members
include
grid_map_core
eigen_plugins
Functors.hpp
Go to the documentation of this file.
1
/*
2
* Functors.hpp
3
*
4
* Created on: Nov 23, 2015
5
* Author: Péter Fankhauser
6
* Institute: ETH Zurich, ANYbotics
7
*/
8
9
#pragma once
10
11
namespace
grid_map
{
12
13
template
<
typename
Scalar>
14
struct
Clamp
15
{
16
Clamp
(
const
Scalar& min,
const
Scalar& max)
17
:
min_
(min),
18
max_
(max)
19
{
20
}
21
const
Scalar
operator()
(
const
Scalar& x)
const
22
{
23
return
x < min_ ? min_ : (x >
max_
?
max_
: x);
24
}
25
Scalar
min_
,
max_
;
26
};
27
28
}
grid_map::Clamp::min_
Scalar min_
Definition:
Functors.hpp:25
grid_map
Definition:
BufferRegion.hpp:13
grid_map::Clamp
Definition:
Functors.hpp:14
grid_map::Clamp::operator()
const Scalar operator()(const Scalar &x) const
Definition:
Functors.hpp:21
grid_map::Clamp::max_
Scalar max_
Definition:
Functors.hpp:25
grid_map::Clamp::Clamp
Clamp(const Scalar &min, const Scalar &max)
Definition:
Functors.hpp:16
grid_map_core
Author(s): Péter Fankhauser
autogenerated on Tue Jun 1 2021 02:13:27