removing all FLT_EPSILONs
This commit is contained in:
		
							parent
							
								
									770a07cc28
								
							
						
					
					
						commit
						bf8505a285
					
				| @ -38,7 +38,6 @@ or see http://www.gnu.org/licenses/agpl.txt. | ||||
| #include <boost/make_shared.hpp> | ||||
| #include <boost/shared_ptr.hpp> | ||||
| 
 | ||||
| #include <cfloat> | ||||
| #include <ctime> | ||||
| 
 | ||||
| #include <algorithm> | ||||
| @ -732,7 +731,7 @@ private: | ||||
|             if ( priority > targetPriority ) | ||||
|                 return false; | ||||
|             //tie breaking
 | ||||
|             if ( fabs(priority - targetPriority) < FLT_EPSILON && bias(node, target) ) { | ||||
|             if ( fabs(priority - targetPriority) < std::numeric_limits<double>::epsilon() && bias(node, target) ) { | ||||
|                 return false; | ||||
|             } | ||||
|             neighbours.push_back( target ); | ||||
| @ -754,7 +753,7 @@ private: | ||||
|                 if ( priority > targetPriority) | ||||
|                     return false; | ||||
|                 //tie breaking
 | ||||
|                 if ( fabs(priority - targetPriority) < FLT_EPSILON && bias(node, target) ) { | ||||
|                 if ( fabs(priority - targetPriority) < std::numeric_limits<double>::epsilon() && bias(node, target) ) { | ||||
|                     return false; | ||||
|                 } | ||||
|             } | ||||
|  | ||||
| @ -467,7 +467,7 @@ public: | ||||
|         //initialize queue with root element
 | ||||
|         std::priority_queue<QueryCandidate> traversal_queue; | ||||
|         traversal_queue.push(QueryCandidate(0, m_search_tree[0].minimum_bounding_rectangle.GetMinDist(input_coordinate))); | ||||
|         BOOST_ASSERT_MSG(FLT_EPSILON > (0. - traversal_queue.top().min_dist), "Root element in NN Search has min dist != 0."); | ||||
|         BOOST_ASSERT_MSG(std::numberic_limits<double>::epsilon() > (0. - traversal_queue.top().min_dist), "Root element in NN Search has min dist != 0."); | ||||
| 
 | ||||
|         while(!traversal_queue.empty()) { | ||||
|             const QueryCandidate current_query_node = traversal_queue.top(); traversal_queue.pop(); | ||||
|  | ||||
| @ -166,7 +166,7 @@ void DescriptionFactory::Run(const SearchEngine &sEngine, const unsigned zoomLev | ||||
|     //    SimpleLogger().Write() << "#segs: " << pathDescription.size();
 | ||||
| 
 | ||||
|     //Post-processing to remove empty or nearly empty path segments
 | ||||
|     if(FLT_EPSILON > pathDescription.back().length) { | ||||
|     if(std::numeric_limits<double>::epsilon() > pathDescription.back().length) { | ||||
|         //        SimpleLogger().Write() << "#segs: " << pathDescription.size() << ", last ratio: " << targetPhantom.ratio << ", length: " << pathDescription.back().length;
 | ||||
|         if(pathDescription.size() > 2){ | ||||
|             pathDescription.pop_back(); | ||||
| @ -178,7 +178,7 @@ void DescriptionFactory::Run(const SearchEngine &sEngine, const unsigned zoomLev | ||||
|     } else { | ||||
|         pathDescription[indexOfSegmentBegin].duration *= (1.-targetPhantom.ratio); | ||||
|     } | ||||
|     if(FLT_EPSILON > pathDescription[0].length) { | ||||
|     if(std::numeric_limits<double>::epsilon() > pathDescription[0].length) { | ||||
|         //TODO: this is never called actually?
 | ||||
|         if(pathDescription.size() > 2) { | ||||
|             pathDescription.erase(pathDescription.begin()); | ||||
|  | ||||
| @ -30,6 +30,7 @@ | ||||
| #include "../Util/SimpleLogger.h" | ||||
| #include "../typedefs.h" | ||||
| 
 | ||||
| #include <limits> | ||||
| #include <vector> | ||||
| 
 | ||||
| /* This class is fed with all way segments in consecutive order
 | ||||
|  | ||||
| @ -56,7 +56,7 @@ void ExtractorCallbacks::wayFunction(ExtractionWay &parsed_way) { | ||||
|             parsed_way.speed = parsed_way.duration/(parsed_way.path.size()-1); | ||||
|         } | ||||
| 
 | ||||
|         if(FLT_EPSILON >= fabs(-1. - parsed_way.speed)){ | ||||
|         if(std::numeric_limits<double>::epsilon() >= fabs(-1. - parsed_way.speed)){ | ||||
|             SimpleLogger().Write(logDEBUG) << | ||||
|                 "found way with bogus speed, id: " << parsed_way.id; | ||||
|             return; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user