.. _program_listing_file__tmp_ws_src_grid_map_grid_map_core_include_grid_map_core_eigen_plugins_Functors.hpp: Program Listing for File Functors.hpp ===================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/grid_map/grid_map_core/include/grid_map_core/eigen_plugins/Functors.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* * Functors.hpp * * Created on: Nov 23, 2015 * Author: Péter Fankhauser * Institute: ETH Zurich, ANYbotics */ #ifndef GRID_MAP_CORE__EIGEN_PLUGINS__FUNCTORS_HPP_ #define GRID_MAP_CORE__EIGEN_PLUGINS__FUNCTORS_HPP_ namespace grid_map { template struct Clamp { Clamp(const Scalar & min, const Scalar & max) : min_(min), max_(max) { } const Scalar operator()(const Scalar & x) const { return x < min_ ? min_ : (x > max_ ? max_ : x); } Scalar min_, max_; }; } // namespace grid_map #endif // GRID_MAP_CORE__EIGEN_PLUGINS__FUNCTORS_HPP_