-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpip200644.h
40 lines (32 loc) · 857 Bytes
/
pip200644.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <vector>
#include <gmpxx.h>
#define PREC 500
namespace N200644 {
class Point {
private:
mpf_class _x, _y;
public:
Point() { _x = mpf_class(0, PREC); mpf_class(0, PREC); }
Point(double x, double y) { _x = mpf_class(x, PREC); _y = mpf_class(y, PREC); }
mpf_class x() const {return _x;}
mpf_class y() const {return _y;}
};
template <typename InputIterator>
class Polygon {
private:
typedef std::vector<Point> Points;
Points points;
public:
typedef Points::iterator iterator;
iterator begin() { return points.begin(); }
iterator end() { return points.end(); }
Polygon(InputIterator first, InputIterator last);
bool contains( const Point q ) ;
};
}
template <typename InputIterator>
class K200644 {
public:
typedef N200644::Point Point;
typedef N200644::Polygon<InputIterator> Polygon;
};