blob: ce81d0bf524c58e0292f28c49fde0686d735c500 (
plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
#include <cassert>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <timer.h>
#include <config.h>
#include <kpoint1d.h>
#include <kpoint2d.h>
using namespace std;
unsigned long num_kratpoly_sgn_at = 0;
unsigned long num_kratpoly_exact_sgn_at = 0;
unsigned long num_root1_isolate = 0;
unsigned long num_root1_exact_isolate = 0;
unsigned long num_kpoint1d_get_pts = 0;
unsigned long num_kpoint2d_get_pts = 0;
unsigned long num_ksolid_boolean = 0;
int main(const int argc, const char* argv[])
{
ifstream in_file;
long i;
K_RATPOLY P, Q;
bigrational l_s, h_s, l_t, h_t;
unsigned long num_X;
K_POINT2D** X;
long lap;
in_file.open(argv[1]);
P = read_poly(in_file);
in_file.close();
in_file.open(argv[2]);
Q = read_poly(in_file);
in_file.close();
cerr << " P = " << endl << P << endl << flush;
cerr << " Q = " << endl << Q << endl << flush;
CLOCK_START();
num_X = get_all_pts(P, Q, X, 0);
CLOCK_STOP(&lap);
cerr << " num_X = " << num_X << endl << flush;
for (i = 0; i < num_X; i++)
cerr << " X[" << i << "] = " << *X[i] << endl << flush;
cerr << " mapc_main: main: time_taken: " << lap << " micro-seconds. " << endl << flush;
for (i = 0; i < num_X; i++)
delete X[i];
if (num_X > 0)
delete [] X;
return 0;
}
|