Map Utilities

Header: fiction/utils/math/map_utils.hpp

template<typename MapType>
MapType::const_iterator fiction::utils::math::find_key_with_tolerance(const MapType &map, const typename MapType::key_type &key)

This function searches for a floating-point value specified by the key in the provided map map, applying a tolerance specified by fiction::constants::ERROR_MARGIN. Each key in the map is compared to the specified key within this tolerance.

Template Parameters:

MapType – The type of the map containing parameter points as keys.

Parameters:
  • map – The map containing parameter points as keys and associated values.

  • key – The parameter point to search for in the map.

Returns:

An iterator to the found parameter point in the map, or map.cend() if not found.