remove init_by_ interfaces

This commit is contained in:
Lingjie Zhu 2017-11-21 09:24:06 +08:00
parent 431570427c
commit b11b32e35e
11 changed files with 13 additions and 42 deletions

View File

@ -60,8 +60,8 @@ int main(int argc, char *argv[])
Timer t;
std::cerr << "start initialization" << std::endl;
t.start();
approx.init_by_error(
static_cast<CGAL::VSA::Seeding>(init), tol, iterations);
approx.init(
static_cast<CGAL::VSA::Seeding>(init), boost::none, tol, iterations);
t.stop();
std::cerr << "initialization time " << t.time() << " sec." << std::endl;
std::cerr << "#proxies " << approx.get_proxies_size() << std::endl;

View File

@ -64,7 +64,7 @@ int main(int argc, char *argv[])
std::cerr << "start initialization" << std::endl;
t0.reset();
t0.start();
approx.init_by_number(
approx.init(
static_cast<CGAL::VSA::Seeding>(init), num_proxies);
t0.stop();
std::cerr << "initialization time " << t0.time() << " sec." << std::endl;

View File

@ -36,7 +36,7 @@ int main()
approx.set_metric(metric, proxy_fitting);
// initialize 100 random proxies
approx.init_by_number(CGAL::VSA::Random, 100);
approx.init(CGAL::VSA::Random, 100);
// run 30 iterations
approx.run(30);

View File

@ -109,7 +109,7 @@ int main()
approx.set_metric(metric, proxy_fitting);
// approximation via 200 proxies and 30 iterations
approx.init_by_number(CGAL::VSA::Hierarchical, 200);
approx.init(CGAL::VSA::Hierarchical, 200);
approx.run(30);
return EXIT_SUCCESS;

View File

@ -399,35 +399,6 @@ public:
}
}
/*!
* @brief Initialize with targeted number of proxies.
* @param method seeding method
* @param max_nb_proxies target maximum number of proxies
* @param num_iterations number of re-fitting iterations
* in incremental and hierarchical seeding
* @return number of proxies initialized
*/
std::size_t init_by_number(
const Seeding method,
const std::size_t max_nb_proxies,
const std::size_t num_iterations = 5) {
return init(method, max_nb_proxies, boost::none, num_iterations);
}
/*!
* @brief Initialize proxies to targeted error drop.
* @param method seeding method
* @param target_drop targeted error drop to initial state, in range (0, 1)
* @param num_iterations number of re-fitting iterations
* @return number of proxies initialized
*/
std::size_t init_by_error(
const Seeding method,
const FT target_drop,
const std::size_t num_iterations = 5) {
return init(method, boost::none, target_drop, num_iterations);
}
/*!
* @brief Run the partitioning and fitting processes.
* @param num_iterations number of iterations.

View File

@ -53,7 +53,7 @@ int main()
// random init and run
std::cout << "random init and run" << std::endl;
approx.init_by_number(CGAL::VSA::Random, 10);
approx.init(CGAL::VSA::Random, 10);
approx.run(10);
if (approx.get_proxies_size() != 10)
return EXIT_FAILURE;
@ -125,7 +125,7 @@ int main()
approx.rebuild();
if (approx.get_proxies_size() != 0)
return EXIT_FAILURE;
approx.init_by_error(CGAL::VSA::Hierarchical, drop, iterations);
approx.init(CGAL::VSA::Hierarchical, boost::none, drop, iterations);
approx.run(10);
std::cout << "#proxies " << approx.get_proxies_size() << std::endl;
@ -133,7 +133,7 @@ int main()
approx.rebuild();
if (approx.get_proxies_size() != 0)
return EXIT_FAILURE;
approx.init_by_error(CGAL::VSA::Incremental, drop, iterations);
approx.init(CGAL::VSA::Incremental, boost::none, drop, iterations);
approx.run(10);
std::cout << "#proxies " << approx.get_proxies_size() << std::endl;

View File

@ -40,7 +40,7 @@ bool test_shape(const char *file_name, const std::size_t target_num_proxies)
const FT drop(1e-8);
const std::size_t num_iterations = 20;
const std::size_t inner_iterations = 10;
approx.init_by_error(CGAL::VSA::Incremental, drop, inner_iterations);
approx.init(CGAL::VSA::Incremental, boost::none, drop, inner_iterations);
approx.run(num_iterations);
// eliminate redundant area (local minima) by merging

View File

@ -51,7 +51,7 @@ int main()
L21_proxy_fitting proxy_fitting(mesh);
approx.set_metric(error_metric, proxy_fitting);
approx.init_by_number(CGAL::VSA::Random, 100);
approx.init(CGAL::VSA::Random, 100);
std::vector<FT> error;
for (std::size_t i = 0; i < 30; ++i)
error.push_back(approx.run());

View File

@ -38,7 +38,7 @@ bool test_manifold(const char *file_name, const FT drop = FT(1e-8))
// approximation, init from error, drop to the target error incrementally
const std::size_t num_iterations = 20;
const std::size_t inner_iterations = 5;
approx.init_by_error(CGAL::VSA::Incremental, drop, inner_iterations);
approx.init(CGAL::VSA::Incremental, boost::none, drop, inner_iterations);
approx.run(num_iterations);
std::cout << "#proxies " << approx.get_proxies_size() << std::endl;

View File

@ -99,7 +99,7 @@ int main()
approx.set_metric(error_metric, proxy_fitting);
std::cout << "random init and run" << std::endl;
approx.init_by_number(CGAL::VSA::Random, 20);
approx.init(CGAL::VSA::Random, 20);
approx.run(20);
if (approx.get_proxies_size() != 20)
return EXIT_FAILURE;

View File

@ -66,7 +66,7 @@ int main()
approx.set_metric(error_metric, proxy_fitting);
std::cout << "Seeding by number." << std::endl;
approx.init_by_number(CGAL::VSA::Random, 50);
approx.init(CGAL::VSA::Random, 50);
if (approx.get_proxies_size() != 50)
return EXIT_FAILURE;
for (std::size_t i = 0; i < 10; ++i) {