mirror of https://github.com/CGAL/cgal
rename initialization from seeding_by_x to init_by_x
This commit is contained in:
parent
e9c2e55623
commit
7cbf80b02b
|
|
@ -60,7 +60,7 @@ int main(int argc, char *argv[])
|
||||||
Timer t;
|
Timer t;
|
||||||
std::cerr << "start initialization" << std::endl;
|
std::cerr << "start initialization" << std::endl;
|
||||||
t.start();
|
t.start();
|
||||||
l21_vsa.seeding_by_error(
|
l21_vsa.init_by_error(
|
||||||
static_cast<L21VSA::Method>(init), tol, iterations);
|
static_cast<L21VSA::Method>(init), tol, iterations);
|
||||||
t.stop();
|
t.stop();
|
||||||
std::cerr << "initialization time " << t.time() << " sec." << std::endl;
|
std::cerr << "initialization time " << t.time() << " sec." << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ int main(int argc, char *argv[])
|
||||||
std::cerr << "start initialization" << std::endl;
|
std::cerr << "start initialization" << std::endl;
|
||||||
t0.reset();
|
t0.reset();
|
||||||
t0.start();
|
t0.start();
|
||||||
l21_vsa.seeding_by_number(
|
l21_vsa.init_by_number(
|
||||||
static_cast<L21VSA::Method>(init), num_proxies);
|
static_cast<L21VSA::Method>(init), num_proxies);
|
||||||
t0.stop();
|
t0.stop();
|
||||||
std::cerr << "initialization time " << t0.time() << " sec." << std::endl;
|
std::cerr << "initialization time " << t0.time() << " sec." << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ See below a sample call of a function that uses the optional BGL named parameter
|
||||||
vsa_mesh_approximation(input,
|
vsa_mesh_approximation(input,
|
||||||
, output
|
, output
|
||||||
, CGAL::VSA::parameters::init_method(method)
|
, CGAL::VSA::parameters::init_method(method)
|
||||||
.seeding_by_number(num_proxies)
|
.init_by_number(num_proxies)
|
||||||
.iterations(num_iterations)
|
.iterations(num_iterations)
|
||||||
.anchor_point(std::back_inserter(anchors)));
|
.anchor_point(std::back_inserter(anchors)));
|
||||||
\endcode
|
\endcode
|
||||||
|
|
@ -79,13 +79,13 @@ the selection of seed initialization method, `0` for random, `1` for incremental
|
||||||
\b Default value is `0`
|
\b Default value is `0`
|
||||||
\cgalNPEnd
|
\cgalNPEnd
|
||||||
|
|
||||||
\cgalNPBegin{seeding_by_number} \anchor VSA_seeding_by_number
|
\cgalNPBegin{init_by_number} \anchor VSA_init_by_number
|
||||||
the number of proxies used to approximate the input mesh.\n
|
the number of proxies used to approximate the input mesh.\n
|
||||||
\b Type : `std::size_t` \n
|
\b Type : `std::size_t` \n
|
||||||
\b Default value is `0`
|
\b Default value is `0`
|
||||||
\cgalNPEnd
|
\cgalNPEnd
|
||||||
|
|
||||||
\cgalNPBegin{seeding_by_error} \anchor VSA_seeding_by_error
|
\cgalNPBegin{init_by_error} \anchor VSA_init_by_error
|
||||||
the total error drop to approximate the input mesh.\n
|
the total error drop to approximate the input mesh.\n
|
||||||
\b Type : `GeomTraits::FT` \n
|
\b Type : `GeomTraits::FT` \n
|
||||||
\b Default value is `0.01`
|
\b Default value is `0.01`
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ int main()
|
||||||
l21_approx.set_metric(metric, proxy_fitting);
|
l21_approx.set_metric(metric, proxy_fitting);
|
||||||
|
|
||||||
// initialize proxies randomly on the mesh
|
// initialize proxies randomly on the mesh
|
||||||
l21_approx.seeding_by_number(L21VSA::Random, 100);
|
l21_approx.init_by_number(L21VSA::Random, 100);
|
||||||
|
|
||||||
// run the iteration to minimize the error
|
// run the iteration to minimize the error
|
||||||
for (std::size_t i = 0; i < 30; ++i)
|
for (std::size_t i = 0; i < 30; ++i)
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ int main()
|
||||||
|
|
||||||
// free function interface with named parameters, seperated with dots
|
// free function interface with named parameters, seperated with dots
|
||||||
CGAL::vsa_mesh_approximation(input, output,
|
CGAL::vsa_mesh_approximation(input, output,
|
||||||
CGAL::VSA::parameters::seeding_by_number(200). // seeding by target number of proxies
|
CGAL::VSA::parameters::init_by_number(200). // seeding by target number of proxies
|
||||||
init_method(1). // hierarchical init
|
init_method(1). // hierarchical init
|
||||||
iterations(30). // number of relaxation iterations after seeding
|
iterations(30). // number of relaxation iterations after seeding
|
||||||
anchor_point(std::back_inserter(anchors)). // get anchor points
|
anchor_point(std::back_inserter(anchors)). // get anchor points
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ int main()
|
||||||
compact_approx.set_metric(metric, proxy_fitting);
|
compact_approx.set_metric(metric, proxy_fitting);
|
||||||
|
|
||||||
// using 200 proxies to approximate the shape
|
// using 200 proxies to approximate the shape
|
||||||
compact_approx.seeding_by_number(CompactVSA::Hierarchical, 200);
|
compact_approx.init_by_number(CompactVSA::Hierarchical, 200);
|
||||||
for (std::size_t i = 0; i < 30; ++i)
|
for (std::size_t i = 0; i < 30; ++i)
|
||||||
compact_approx.run_one_step();
|
compact_approx.run_one_step();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -326,47 +326,47 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Seeding by targeted number of proxies.
|
* @brief Initialize with targeted number of proxies.
|
||||||
* @param method seeding method
|
* @param method seeding method
|
||||||
* @param num_seed target number of proxies seed
|
* @param num_seed target number of proxies seed
|
||||||
* @param num_iterations number of re-fitting iterations
|
* @param num_iterations number of re-fitting iterations
|
||||||
* in incremental and hierarchical seeding
|
* in incremental and hierarchical seeding
|
||||||
* @return number of proxies initialized
|
* @return number of proxies initialized
|
||||||
*/
|
*/
|
||||||
std::size_t seeding_by_number(
|
std::size_t init_by_number(
|
||||||
const Method method,
|
const Method method,
|
||||||
const std::size_t num_seed,
|
const std::size_t num_seed,
|
||||||
const std::size_t num_iterations = 5) {
|
const std::size_t num_iterations = 5) {
|
||||||
switch (method) {
|
switch (method) {
|
||||||
case Random:
|
case Random:
|
||||||
return seed_random(num_seed);
|
return init_random(num_seed);
|
||||||
case Incremental:
|
case Incremental:
|
||||||
return seed_incremental(num_seed, num_iterations);
|
return init_incremental(num_seed, num_iterations);
|
||||||
case Hierarchical:
|
case Hierarchical:
|
||||||
return seed_hierarchical(num_seed, num_iterations);
|
return init_hierarchical(num_seed, num_iterations);
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Seeding by targeted error drop.
|
* @brief Initialize proxies to targeted error drop.
|
||||||
* @param method seeding method
|
* @param method seeding method
|
||||||
* @param target_drop targeted error drop to initial state, usually in range (0, 1)
|
* @param target_drop targeted error drop to initial state, usually in range (0, 1)
|
||||||
* @param num_iterations number of re-fitting iterations
|
* @param num_iterations number of re-fitting iterations
|
||||||
* @return number of proxies initialized
|
* @return number of proxies initialized
|
||||||
*/
|
*/
|
||||||
std::size_t seeding_by_error(
|
std::size_t init_by_error(
|
||||||
const Method method,
|
const Method method,
|
||||||
const FT target_drop,
|
const FT target_drop,
|
||||||
const std::size_t num_iterations = 5) {
|
const std::size_t num_iterations = 5) {
|
||||||
switch (method) {
|
switch (method) {
|
||||||
case Random:
|
case Random:
|
||||||
return seed_error_random(target_drop, num_iterations);
|
return init_error_random(target_drop, num_iterations);
|
||||||
case Incremental:
|
case Incremental:
|
||||||
return seed_error_incremental(target_drop, num_iterations);
|
return init_error_incremental(target_drop, num_iterations);
|
||||||
case Hierarchical:
|
case Hierarchical:
|
||||||
return seed_error_hierarchical(target_drop, num_iterations);
|
return init_error_hierarchical(target_drop, num_iterations);
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -930,7 +930,7 @@ private:
|
||||||
* @param num_seed number of proxies seed
|
* @param num_seed number of proxies seed
|
||||||
* @return number of proxies initialized
|
* @return number of proxies initialized
|
||||||
*/
|
*/
|
||||||
std::size_t seed_random(const std::size_t num_seed) {
|
std::size_t init_random(const std::size_t num_seed) {
|
||||||
proxies.clear();
|
proxies.clear();
|
||||||
if (num_faces(*m_pmesh) < num_seed)
|
if (num_faces(*m_pmesh) < num_seed)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -954,7 +954,7 @@ private:
|
||||||
* before each incremental proxy insertion
|
* before each incremental proxy insertion
|
||||||
* @return number of proxies initialized
|
* @return number of proxies initialized
|
||||||
*/
|
*/
|
||||||
std::size_t seed_incremental(const std::size_t num_seed,
|
std::size_t init_incremental(const std::size_t num_seed,
|
||||||
const std::size_t num_iterations) {
|
const std::size_t num_iterations) {
|
||||||
proxies.clear();
|
proxies.clear();
|
||||||
if (num_faces(*m_pmesh) < num_seed)
|
if (num_faces(*m_pmesh) < num_seed)
|
||||||
|
|
@ -976,7 +976,7 @@ private:
|
||||||
* before each hierarchical proxy insertion
|
* before each hierarchical proxy insertion
|
||||||
* @return number of proxies initialized
|
* @return number of proxies initialized
|
||||||
*/
|
*/
|
||||||
std::size_t seed_hierarchical(const std::size_t num_seed,
|
std::size_t init_hierarchical(const std::size_t num_seed,
|
||||||
const std::size_t num_iterations) {
|
const std::size_t num_iterations) {
|
||||||
proxies.clear();
|
proxies.clear();
|
||||||
if (num_faces(*m_pmesh) < num_seed)
|
if (num_faces(*m_pmesh) < num_seed)
|
||||||
|
|
@ -1004,12 +1004,12 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Initialize by targeted error drop.
|
* @brief Initialize by targeted error drop with random seeding.
|
||||||
* @param target_drop targeted error drop to initial state, usually in range (0, 1)
|
* @param target_drop targeted error drop to initial state, usually in range (0, 1)
|
||||||
* @param num_iterations number of re-fitting iterations
|
* @param num_iterations number of re-fitting iterations
|
||||||
* @return number of proxies initialized
|
* @return number of proxies initialized
|
||||||
*/
|
*/
|
||||||
std::size_t seed_error_random(const FT target_drop,
|
std::size_t init_error_random(const FT target_drop,
|
||||||
const std::size_t num_iterations) {
|
const std::size_t num_iterations) {
|
||||||
// maximum allowed number of proxies
|
// maximum allowed number of proxies
|
||||||
const std::size_t max_proxies = num_faces(*m_pmesh) / 3;
|
const std::size_t max_proxies = num_faces(*m_pmesh) / 3;
|
||||||
|
|
@ -1028,7 +1028,7 @@ private:
|
||||||
std::size_t target_px = 2;
|
std::size_t target_px = 2;
|
||||||
do {
|
do {
|
||||||
proxies.clear();
|
proxies.clear();
|
||||||
seed_random(target_px);
|
init_random(target_px);
|
||||||
for (std::size_t i = 0; i < num_iterations; ++i) {
|
for (std::size_t i = 0; i < num_iterations; ++i) {
|
||||||
partition();
|
partition();
|
||||||
fit();
|
fit();
|
||||||
|
|
@ -1042,12 +1042,12 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Initialize by targeted error drop.
|
* @brief Initialize by targeted error dropwith incremental seeding.
|
||||||
* @param target_drop targeted error drop to initial state, usually in range (0, 1)
|
* @param target_drop targeted error drop to initial state, usually in range (0, 1)
|
||||||
* @param num_iterations number of re-fitting iterations
|
* @param num_iterations number of re-fitting iterations
|
||||||
* @return number of proxies initialized
|
* @return number of proxies initialized
|
||||||
*/
|
*/
|
||||||
std::size_t seed_error_incremental(const FT target_drop,
|
std::size_t init_error_incremental(const FT target_drop,
|
||||||
const std::size_t num_iterations) {
|
const std::size_t num_iterations) {
|
||||||
// maximum allowed number of proxies
|
// maximum allowed number of proxies
|
||||||
const std::size_t max_proxies = num_faces(*m_pmesh) / 3;
|
const std::size_t max_proxies = num_faces(*m_pmesh) / 3;
|
||||||
|
|
@ -1077,12 +1077,12 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Initialize by targeted error drop.
|
* @brief Initialize by targeted error drop with hierarchical seeding.
|
||||||
* @param target_drop targeted error drop to initial state, usually in range (0, 1)
|
* @param target_drop targeted error drop to initial state, usually in range (0, 1)
|
||||||
* @param num_iterations number of re-fitting iterations
|
* @param num_iterations number of re-fitting iterations
|
||||||
* @return number of proxies initialized
|
* @return number of proxies initialized
|
||||||
*/
|
*/
|
||||||
std::size_t seed_error_hierarchical(const FT target_drop,
|
std::size_t init_error_hierarchical(const FT target_drop,
|
||||||
const std::size_t num_iterations) {
|
const std::size_t num_iterations) {
|
||||||
// maximum allowed number of proxies
|
// maximum allowed number of proxies
|
||||||
const std::size_t max_proxies = num_faces(*m_pmesh) / 3;
|
const std::size_t max_proxies = num_faces(*m_pmesh) / 3;
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ CGAL_add_named_parameter(geom_traits_t, geom_traits, geom_traits)
|
||||||
|
|
||||||
// approximation parameters
|
// approximation parameters
|
||||||
CGAL_add_named_parameter(init_method_t, init_method, init_method)
|
CGAL_add_named_parameter(init_method_t, init_method, init_method)
|
||||||
CGAL_add_named_parameter(seeding_by_number_t, seeding_by_number, seeding_by_number)
|
CGAL_add_named_parameter(init_by_number_t, init_by_number, init_by_number)
|
||||||
CGAL_add_named_parameter(seeding_by_error_t, seeding_by_error, seeding_by_error)
|
CGAL_add_named_parameter(init_by_error_t, init_by_error, init_by_error)
|
||||||
CGAL_add_named_parameter(iterations_t, iterations, iterations)
|
CGAL_add_named_parameter(iterations_t, iterations, iterations)
|
||||||
CGAL_add_named_parameter(inner_iterations_t, inner_iterations, inner_iterations)
|
CGAL_add_named_parameter(inner_iterations_t, inner_iterations, inner_iterations)
|
||||||
CGAL_add_named_parameter(chord_subdivide_t, chord_subdivide, chord_subdivide)
|
CGAL_add_named_parameter(chord_subdivide_t, chord_subdivide, chord_subdivide)
|
||||||
|
|
|
||||||
|
|
@ -44,9 +44,9 @@ namespace CGAL
|
||||||
* \cgalParamEnd
|
* \cgalParamEnd
|
||||||
* \cgalParamBegin{init_method} the selection of seed initialization method.
|
* \cgalParamBegin{init_method} the selection of seed initialization method.
|
||||||
* \cgalParamEnd
|
* \cgalParamEnd
|
||||||
* \cgalParamBegin{seeding_by_number} the number of proxies to approximate the geometry.
|
* \cgalParamBegin{init_by_number} the number of proxies to approximate the geometry.
|
||||||
* \cgalParamEnd
|
* \cgalParamEnd
|
||||||
* \cgalParamBegin{seeding_by_error} the error drop of the approximation.
|
* \cgalParamBegin{init_by_error} the error drop of the approximation.
|
||||||
* \cgalParamEnd
|
* \cgalParamEnd
|
||||||
* \cgalParamBegin{iterations} the relaxation iterations after seeding.
|
* \cgalParamBegin{iterations} the relaxation iterations after seeding.
|
||||||
* \cgalParamEnd
|
* \cgalParamEnd
|
||||||
|
|
@ -94,15 +94,15 @@ bool vsa_mesh_approximation(const TriangleMesh &tm_in,
|
||||||
|
|
||||||
// default random initialization
|
// default random initialization
|
||||||
int init = choose_param(get_param(np, internal_np::init_method), 0);
|
int init = choose_param(get_param(np, internal_np::init_method), 0);
|
||||||
std::size_t num_proxies = choose_param(get_param(np, internal_np::seeding_by_number), 0);
|
std::size_t num_proxies = choose_param(get_param(np, internal_np::init_by_number), 0);
|
||||||
std::size_t inner_iterations = choose_param(get_param(np, internal_np::inner_iterations), 10);
|
std::size_t inner_iterations = choose_param(get_param(np, internal_np::inner_iterations), 10);
|
||||||
if (num_proxies == 0 || num_proxies > num_faces(tm_in)) {
|
if (num_proxies == 0 || num_proxies > num_faces(tm_in)) {
|
||||||
FT drop = choose_param(get_param(np, internal_np::seeding_by_error), FT(0.01));
|
FT drop = choose_param(get_param(np, internal_np::init_by_error), FT(0.01));
|
||||||
vsa_l21.seeding_by_error(
|
vsa_l21.init_by_error(
|
||||||
static_cast<typename VSAL21::Method>(init), drop, inner_iterations);
|
static_cast<typename VSAL21::Method>(init), drop, inner_iterations);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
vsa_l21.seeding_by_number(
|
vsa_l21.init_by_number(
|
||||||
static_cast<typename VSAL21::Method>(init), num_proxies, inner_iterations);
|
static_cast<typename VSAL21::Method>(init), num_proxies, inner_iterations);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ int main()
|
||||||
|
|
||||||
// random init and run
|
// random init and run
|
||||||
std::cout << "random init and run" << std::endl;
|
std::cout << "random init and run" << std::endl;
|
||||||
l2_approx.seeding_by_number(L2VSA::Random, 10);
|
l2_approx.init_by_number(L2VSA::Random, 10);
|
||||||
for (std::size_t i = 0; i < 10; ++i)
|
for (std::size_t i = 0; i < 10; ++i)
|
||||||
l2_approx.run_one_step();
|
l2_approx.run_one_step();
|
||||||
if (l2_approx.get_proxies_size() != 10)
|
if (l2_approx.get_proxies_size() != 10)
|
||||||
|
|
@ -124,7 +124,7 @@ int main()
|
||||||
l2_approx.rebuild();
|
l2_approx.rebuild();
|
||||||
if (l2_approx.get_proxies_size() != 0)
|
if (l2_approx.get_proxies_size() != 0)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
l2_approx.seeding_by_error(L2VSA::Hierarchical, drop, iterations);
|
l2_approx.init_by_error(L2VSA::Hierarchical, drop, iterations);
|
||||||
for (std::size_t i = 0; i < 10; ++i)
|
for (std::size_t i = 0; i < 10; ++i)
|
||||||
l2_approx.run_one_step();
|
l2_approx.run_one_step();
|
||||||
std::cout << "#proxies " << l2_approx.get_proxies_size() << std::endl;
|
std::cout << "#proxies " << l2_approx.get_proxies_size() << std::endl;
|
||||||
|
|
@ -133,7 +133,7 @@ int main()
|
||||||
l2_approx.rebuild();
|
l2_approx.rebuild();
|
||||||
if (l2_approx.get_proxies_size() != 0)
|
if (l2_approx.get_proxies_size() != 0)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
l2_approx.seeding_by_error(L2VSA::Incremental, drop, iterations);
|
l2_approx.init_by_error(L2VSA::Incremental, drop, iterations);
|
||||||
for (std::size_t i = 0; i < 10; ++i)
|
for (std::size_t i = 0; i < 10; ++i)
|
||||||
l2_approx.run_one_step();
|
l2_approx.run_one_step();
|
||||||
std::cout << "#proxies " << l2_approx.get_proxies_size() << std::endl;
|
std::cout << "#proxies " << l2_approx.get_proxies_size() << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ bool test_shape(const char *file_name, const std::size_t target_num_proxies)
|
||||||
const FT drop(1e-8);
|
const FT drop(1e-8);
|
||||||
const std::size_t num_iterations = 20;
|
const std::size_t num_iterations = 20;
|
||||||
const std::size_t inner_iterations = 10;
|
const std::size_t inner_iterations = 10;
|
||||||
vsa_l21.seeding_by_error(L21VSA::Incremental, drop, inner_iterations);
|
vsa_l21.init_by_error(L21VSA::Incremental, drop, inner_iterations);
|
||||||
for (std::size_t i = 0; i < num_iterations; ++i)
|
for (std::size_t i = 0; i < num_iterations; ++i)
|
||||||
vsa_l21.run_one_step();
|
vsa_l21.run_one_step();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ int main()
|
||||||
L21ProxyFitting l21_fitting(mesh);
|
L21ProxyFitting l21_fitting(mesh);
|
||||||
vsa_l21.set_metric(l21_metric, l21_fitting);
|
vsa_l21.set_metric(l21_metric, l21_fitting);
|
||||||
|
|
||||||
vsa_l21.seeding_by_number(L21VSA::Random, 100);
|
vsa_l21.init_by_number(L21VSA::Random, 100);
|
||||||
std::vector<FT> error;
|
std::vector<FT> error;
|
||||||
for (std::size_t i = 0; i < 30; ++i)
|
for (std::size_t i = 0; i < 30; ++i)
|
||||||
error.push_back(vsa_l21.run_one_step());
|
error.push_back(vsa_l21.run_one_step());
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ int main()
|
||||||
std::map<Polyhedron::Facet_handle, std::size_t> fidxmap;
|
std::map<Polyhedron::Facet_handle, std::size_t> fidxmap;
|
||||||
boost::associative_property_map<std::map<Polyhedron::Facet_handle, std::size_t> > fpxmap(fidxmap);
|
boost::associative_property_map<std::map<Polyhedron::Facet_handle, std::size_t> > fpxmap(fidxmap);
|
||||||
CGAL::vsa_mesh_approximation(mesh, out_mesh,
|
CGAL::vsa_mesh_approximation(mesh, out_mesh,
|
||||||
CGAL::VSA::parameters::seeding_by_number(6).
|
CGAL::VSA::parameters::init_by_number(6).
|
||||||
iterations(30).
|
iterations(30).
|
||||||
inner_iterations(5).
|
inner_iterations(5).
|
||||||
chord_subdivide(0.5).
|
chord_subdivide(0.5).
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ int test() {
|
||||||
typedef CGAL::Polyhedron_3<K> Polyhedron;
|
typedef CGAL::Polyhedron_3<K> Polyhedron;
|
||||||
Polyhedron out_mesh;
|
Polyhedron out_mesh;
|
||||||
CGAL::vsa_mesh_approximation(tm, out_mesh,
|
CGAL::vsa_mesh_approximation(tm, out_mesh,
|
||||||
CGAL::VSA::parameters::seeding_by_number(6).
|
CGAL::VSA::parameters::init_by_number(6).
|
||||||
iterations(30).
|
iterations(30).
|
||||||
inner_iterations(5).
|
inner_iterations(5).
|
||||||
chord_subdivide(0.5));
|
chord_subdivide(0.5));
|
||||||
|
|
|
||||||
|
|
@ -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
|
// approximation, init from error, drop to the target error incrementally
|
||||||
const std::size_t num_iterations = 20;
|
const std::size_t num_iterations = 20;
|
||||||
const std::size_t inner_iterations = 5;
|
const std::size_t inner_iterations = 5;
|
||||||
vsa_l21.seeding_by_error(L21VSA::Incremental, drop, inner_iterations);
|
vsa_l21.init_by_error(L21VSA::Incremental, drop, inner_iterations);
|
||||||
for (std::size_t i = 0; i < num_iterations; ++i)
|
for (std::size_t i = 0; i < num_iterations; ++i)
|
||||||
vsa_l21.run_one_step();
|
vsa_l21.run_one_step();
|
||||||
std::cout << "#proxies " << vsa_l21.get_proxies_size() << std::endl;
|
std::cout << "#proxies " << vsa_l21.get_proxies_size() << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ int main()
|
||||||
compact_approx.set_metric(metric, proxy_fitting);
|
compact_approx.set_metric(metric, proxy_fitting);
|
||||||
|
|
||||||
std::cout << "random init and run" << std::endl;
|
std::cout << "random init and run" << std::endl;
|
||||||
compact_approx.seeding_by_number(CompactVSA::Random, 20);
|
compact_approx.init_by_number(CompactVSA::Random, 20);
|
||||||
for (std::size_t i = 0; i < 20; ++i)
|
for (std::size_t i = 0; i < 20; ++i)
|
||||||
compact_approx.run_one_step();
|
compact_approx.run_one_step();
|
||||||
if (compact_approx.get_proxies_size() != 20)
|
if (compact_approx.get_proxies_size() != 20)
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ int main()
|
||||||
l21_vsa.set_metric(l21_metric, l21_fitting);
|
l21_vsa.set_metric(l21_metric, l21_fitting);
|
||||||
|
|
||||||
std::cout << "Seeding by number." << std::endl;
|
std::cout << "Seeding by number." << std::endl;
|
||||||
l21_vsa.seeding_by_number(L21VSA::Random, 50);
|
l21_vsa.init_by_number(L21VSA::Random, 50);
|
||||||
if (l21_vsa.get_proxies_size() != 50)
|
if (l21_vsa.get_proxies_size() != 50)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
for (std::size_t i = 0; i < 10; ++i) {
|
for (std::size_t i = 0; i < 10; ++i) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue