Skip to content

Commit b0b3647

Browse files
committed
clean main.cpp
1 parent 83f8d4a commit b0b3647

File tree

1 file changed

+70
-54
lines changed

1 file changed

+70
-54
lines changed

app/main.cpp

Lines changed: 70 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void case_check()
5454
#endif
5555
}
5656

57-
# define TIDBG
57+
//# define TIDBG
5858

5959

6060
#ifdef TIGHT_INCLUSION_RUN_EXAMPLES
@@ -100,7 +100,10 @@ void run_rational_data_single_method(
100100
{
101101
for (int ff = 0; ff < 2; ff++)
102102
{
103-
103+
if (folders[fnbr] == "erleben-spike-hole"&&ff == 1)
104+
{
105+
continue;
106+
}
104107
all_V = read_rational_csv(
105108
#ifdef TIDBG
106109
"D:\\vs\\collision\\interval\\Tight-Inclusion\\build\\edge-edge-0474.csv",
@@ -205,10 +208,12 @@ void run_rational_data_single_method(
205208
}
206209
}
207210
}
211+
#ifdef TIDBG
208212
std::cout << "fps " << new_false_positives << " fns " << new_false_negatives << " total queries " << total_number + 1
209213
<<" total positives "<< total_positives << std::endl;
210214

211215
exit(0);
216+
#endif
212217
}
213218
}
214219

@@ -228,69 +233,80 @@ void run_code()
228233
{
229234
double ms = 0.0;
230235
double tolerance = 1e-6;
231-
std::cout << "\nRunning Vertex-Face data" << std::endl;
236+
237+
std::cout << "\nRunning simulation Vertex-Face data" << std::endl;
238+
run_rational_data_single_method(
239+
/*is_edge_edge*/ false, /*is_simulation*/ true, ms, tolerance);
240+
std::cout << "finish simulation Vertex-Face data" << std::endl;
241+
std::cout << "\nRunning simulation Edge-Edge data" << std::endl;
242+
run_rational_data_single_method(
243+
/*is_edge_edge*/ true, /*is_simulation*/ true, ms, tolerance);
244+
std::cout << "finish simulation Edge-Edge data" << std::endl;
245+
246+
std::cout << "\nRunning handcrafted Vertex-Face data" << std::endl;
232247
run_rational_data_single_method(
233248
/*is_edge_edge*/ false, /*is_simulation*/ false, ms, tolerance);
234-
std::cout << "finish Vertex-Face data" << std::endl;
235-
std::cout << "\nRunning Edge-Edge data" << std::endl;
249+
std::cout << "finish handcrafted Vertex-Face data" << std::endl;
250+
std::cout << "\nRunning handcrafted Edge-Edge data" << std::endl;
236251
run_rational_data_single_method(
237252
/*is_edge_edge*/ true, /*is_simulation*/ false, ms, tolerance);
238-
std::cout << "finish Edge-Edge data" << std::endl;
253+
std::cout << "finish handcrafted Edge-Edge data" << std::endl;
254+
255+
239256
}
240257
#endif
241258

242-
void run_dbg() {
243-
std::string file = "D:\\vs\\collision\\interval\\Tight-Inclusion\\build\\Release\\ee1simu1.csv";
244-
std::vector<double> tois;
245-
std::cout << "before read" << std::endl;
246-
Eigen::MatrixXd all_V = read_csv(file, tois);
247-
std::cout << "readed" << std::endl;
248-
if (all_V.rows() != tois.size() || all_V.rows() % 8 != 0) {
249-
std::cout << "wrong sizes, " << all_V.rows() << " " << tois.size() << std::endl;
250-
}
251-
252-
int v_size = all_V.rows() / 8;
253-
int counter = 0;
254-
double tolerance = 1e-6;
255-
double minimum_seperation = 0;
256-
int max_itr = 1e6;
257-
int total_positives = 0;
258-
int no_zero = 0;
259-
for (int i = 0; i < v_size; i++) {
260-
double toi_float = tois[i * 8];
261-
if (toi_float > 0) continue;
262-
Eigen::Matrix<double, 8, 3> V = all_V.middleRows<8>(8 * i);
263-
const std::array<double, 3> err = { {-1, -1, -1} };
264-
265-
double toi;
266-
const double t_max = 1;
267-
268-
double output_tolerance = tolerance;
269-
270-
int CCD_TYPE = 1;
271-
bool new_result = edgeEdgeCCD_double(
272-
V.row(0), V.row(1), V.row(2), V.row(3), V.row(4),
273-
V.row(5), V.row(6), V.row(7), err, minimum_seperation,
274-
toi, tolerance, t_max, max_itr, output_tolerance,
275-
CCD_TYPE);
276-
if (new_result) {
277-
total_positives += 1;
278-
}
279-
if (toi > 0) {
280-
no_zero += 1;
281-
}
282-
283-
}
284-
std::cout << "total positives " << total_positives << std::endl;
285-
std::cout << "no zero " << no_zero << std::endl;
286-
}
259+
//void run_dbg() {
260+
// std::string file = "D:\\vs\\collision\\interval\\Tight-Inclusion\\build\\Release\\ee1simu1.csv";
261+
// std::vector<double> tois;
262+
// std::cout << "before read" << std::endl;
263+
// Eigen::MatrixXd all_V = read_csv(file, tois);
264+
// std::cout << "readed" << std::endl;
265+
// if (all_V.rows() != tois.size() || all_V.rows() % 8 != 0) {
266+
// std::cout << "wrong sizes, " << all_V.rows() << " " << tois.size() << std::endl;
267+
// }
268+
//
269+
// int v_size = all_V.rows() / 8;
270+
// int counter = 0;
271+
// double tolerance = 1e-6;
272+
// double minimum_seperation = 0;
273+
// int max_itr = 1e6;
274+
// int total_positives = 0;
275+
// int no_zero = 0;
276+
// for (int i = 0; i < v_size; i++) {
277+
// double toi_float = tois[i * 8];
278+
// if (toi_float > 0) continue;
279+
// Eigen::Matrix<double, 8, 3> V = all_V.middleRows<8>(8 * i);
280+
// const std::array<double, 3> err = { {-1, -1, -1} };
281+
//
282+
// double toi;
283+
// const double t_max = 1;
284+
//
285+
// double output_tolerance = tolerance;
286+
//
287+
// int CCD_TYPE = 1;
288+
// bool new_result = edgeEdgeCCD_double(
289+
// V.row(0), V.row(1), V.row(2), V.row(3), V.row(4),
290+
// V.row(5), V.row(6), V.row(7), err, minimum_seperation,
291+
// toi, tolerance, t_max, max_itr, output_tolerance,
292+
// CCD_TYPE);
293+
// if (new_result) {
294+
// total_positives += 1;
295+
// }
296+
// if (toi > 0) {
297+
// no_zero += 1;
298+
// }
299+
//
300+
// }
301+
// std::cout << "total positives " << total_positives << std::endl;
302+
// std::cout << "no zero " << no_zero << std::endl;
303+
//}
287304

288305
int main(int argc, char *argv[])
289306
{
290-
run_dbg();
291-
// inclusion_ccd::Rational a;
307+
//run_dbg();
292308
#ifdef TIGHT_INCLUSION_RUN_EXAMPLES
293-
//run_code();
309+
run_code();
294310
#else
295311
case_check();
296312
#endif

0 commit comments

Comments
 (0)