Exhaustive.cc | Exhaustive.cc | |||
---|---|---|---|---|
skipping to change at line 37 | skipping to change at line 37 | |||
#include <cmath> | #include <cmath> | |||
#include <stdint.h> | #include <stdint.h> | |||
using namespace std; | using namespace std; | |||
#define INSERT 1 | #define INSERT 1 | |||
#define DELETE 0 | #define DELETE 0 | |||
#define QUERY 2 | #define QUERY 2 | |||
#if defined _WIN32 || defined _WIN64 || defined WIN32 || defined WIN64 | #if defined _WIN32 || defined _WIN64 || defined WIN32 || defined WIN64 | |||
#if _MSC_VER <= 1500 | ||||
typedef __int8 int8_t; | typedef __int8 int8_t; | |||
typedef __int16 int16_t; | typedef __int16 int16_t; | |||
typedef __int32 int32_t; | typedef __int32 int32_t; | |||
typedef __int64 int64_t; | typedef __int64 int64_t; | |||
typedef unsigned __int8 uint8_t; | typedef unsigned __int8 uint8_t; | |||
typedef unsigned __int16 uint16_t; | typedef unsigned __int16 uint16_t; | |||
typedef unsigned __int32 uint32_t; | typedef unsigned __int32 uint32_t; | |||
typedef unsigned __int64 uint64_t; | typedef unsigned __int64 uint64_t; | |||
#endif | ||||
// Nuke this annoying warning. See http://www.unknownroad.com/rtfm/VisualS tudio/warningC4251.html | // Nuke this annoying warning. See http://www.unknownroad.com/rtfm/VisualS tudio/warningC4251.html | |||
#pragma warning( disable: 4251 ) | #pragma warning( disable: 4251 ) | |||
#else | #else | |||
#include <stdint.h> | #include <stdint.h> | |||
#endif | #endif | |||
class Rectangle | class Rectangle | |||
{ | { | |||
skipping to change at line 258 | skipping to change at line 260 | |||
{ | { | |||
data.insert(pair<size_t, MovingPoint>(id, MovingPoin t(ax, vx, ay, vy, ct))); | data.insert(pair<size_t, MovingPoint>(id, MovingPoin t(ax, vx, ay, vy, ct))); | |||
} | } | |||
else if (op == DELETE) | else if (op == DELETE) | |||
{ | { | |||
data.erase(id); | data.erase(id); | |||
} | } | |||
else if (op == QUERY) | else if (op == QUERY) | |||
{ | { | |||
TimeRectangle query = TimeRectangle(ax, vx, ay, vy, ct, rt); | TimeRectangle query = TimeRectangle(ax, vx, ay, vy, ct, rt); | |||
for (multimap<size_t, MovingPoint>::iterator it = da | std::map<size_t, MovingPoint>::iterator it; | |||
ta.begin(); it != data.end(); it++) | for (it = data.begin(); it != data.end(); it++) | |||
{ | { | |||
//assert(query.intersects((*it).second) == q uery.intersectsStupid((*it).second)); | //assert(query.intersects((*it).second) == q uery.intersectsStupid((*it).second)); | |||
if (query.intersects((*it).second) == false && query.intersectsStupid((*it).second) == true) | if (query.intersects((*it).second) == false && query.intersectsStupid((*it).second) == true) | |||
{ | { | |||
cerr << "Something is wrong: " << ct << " " << (*it).first << endl; | cerr << "Something is wrong: " << ct << " " << (*it).first << endl; | |||
return -1; | return -1; | |||
} | } | |||
if (query.intersects((*it).second)) cout << (*it).first << endl; | if (query.intersects((*it).second)) cout << (*it).first << endl; | |||
} | } | |||
} | } | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 4 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |