Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double level_set_value = .5;
- int NRUNS = 10;
- Eigen::MatrixXd isoV1;
- Eigen::MatrixXi isoF1;
- auto start_sort = std::chrono::high_resolution_clock::now();
- for (int i = 0; i < NRUNS; i++) {
- igl::marching_tets(TV, TT, isovalues, level_set_value, isoV1, isoF1);
- }
- auto finish_sort = std::chrono::high_resolution_clock::now();
- std::chrono::duration<double> elapsed_sort = finish_sort - start_sort;
- std::cout << "MT with SORT took (average over " << NRUNS << " runs) " << elapsed_sort.count()/ NRUNS << "s" << std::endl;
- Eigen::MatrixXd isoV2;
- Eigen::MatrixXi isoF2;
- auto start_hash = std::chrono::high_resolution_clock::now();
- for (int i = 0; i < NRUNS; i++) {
- igl::marching_tets_2(TV, TT, isovalues, level_set_value, isoV2, isoF2);
- }
- auto finish_hash = std::chrono::high_resolution_clock::now();
- std::chrono::duration<double> elapsed_hash = finish_hash - start_hash;
- std::cout << "MT with HASH took (average over " << NRUNS << " runs) " << elapsed_hash.count() / NRUNS << "s" << std::endl;
- Eigen::MatrixXd isoV3;
- Eigen::MatrixXi isoF3;
- auto start_hash2 = std::chrono::high_resolution_clock::now();
- for (int i = 0; i < NRUNS; i++) {
- igl::marching_tets_3(TV, TT, isovalues, level_set_value, isoV3, isoF3);
- }
- auto finish_hash2 = std::chrono::high_resolution_clock::now();
- std::chrono::duration<double> elapsed_hash2 = finish_hash2 - start_hash2;
- std::cout << "MT with HASH2 took (average over " << NRUNS << " runs) " << elapsed_hash2.count() / NRUNS << "s" << std::endl;
Advertisement
Add Comment
Please, Sign In to add comment