Guest User

Untitled

a guest
Jun 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. struct arraySizeTwoEqualityStruct
  2.  
  3. bool operator()( const array< double, 2 >& leftArraySizeTwo,
  4. const array< double, 2 >& rightArraySizeTwo ) const
  5. {
  6.  
  7. return
  8. abs( leftArraySizeTwo[ 0 ] - rightArraySizeTwo[ 0 ] ) < 0.0001 &&
  9. abs( leftArraySizeTwo[ 1 ] - rightArraySizeTwo[ 1 ] ) < 0.0001;
  10.  
  11. }
  12.  
  13. struct arraySizeTwoHashStruct
  14.  
  15. size_t operator( )( const array< double, 2 >& arrayToHash ) const
  16. {
  17.  
  18. return ( hash< double > ( ) ( arrayToHash[ 0 ] ) ^ hash< double > ( ) ( arrayToHash[ 1 ] ) );
  19.  
  20. }
  21.  
  22. bool potentialNodeDuplicate( array< double, 2 > & possibleDuplicateValuesArgument,
  23. int parentReferenceArgument,
  24. double edgeWeightArgument,
  25. unordered_map< array< double, 2 >, int, arraySizeTwoHashStruct, arraySizeTwoEqualityStruct > possibleDuplicateReferencesArgument,
  26. vector< pair< vehicleNode, vector< nodeEdge > > >& adjacencyListArgument )
  27.  
  28. if ( possibleDuplicateReferencesArgument.find( possibleDuplicateValuesArgument ) != possibleDuplicateReferencesArgument.end() )
  29. {
  30.  
  31. ...
  32. }
Add Comment
Please, Sign In to add comment