From fed37adc5e3e9e5bd50a75e6625010923e8e0108 Mon Sep 17 00:00:00 2001 From: vfisikop Date: Wed, 9 Oct 2024 13:29:51 +0300 Subject: [PATCH] Remove unnecessary template keywords --- .../estimate_L_smooth_parameter.hpp | 6 +++--- include/sampling/mmcs.hpp | 2 +- include/sampling/parallel_mmcs.hpp | 2 +- include/sampling/random_point_generators.hpp | 18 ++++++++--------- .../random_point_generators_multithread.hpp | 20 +++++++++---------- include/volume/volume_cooling_balls.hpp | 6 +++--- include/volume/volume_cooling_gaussians.hpp | 4 ++-- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/include/preprocess/estimate_L_smooth_parameter.hpp b/include/preprocess/estimate_L_smooth_parameter.hpp index 180f20947..340ece756 100644 --- a/include/preprocess/estimate_L_smooth_parameter.hpp +++ b/include/preprocess/estimate_L_smooth_parameter.hpp @@ -21,7 +21,7 @@ template typename NegativeGradientFunctor, typename RandomNumberGenerator > -double estimate_L_smooth(Polytope &P, Point &p, unsigned int const& walk_length, +double estimate_L_smooth(Polytope &P, Point &p, unsigned int const& walk_length, NegativeGradientFunctor F, RandomNumberGenerator &rng) { typedef typename Point::FT NT; @@ -44,11 +44,11 @@ double estimate_L_smooth(Polytope &P, Point &p, unsigned int const& walk_length, RandomWalk walk(P, p, rng); for (unsigned int i=0; i::lowest(), Ltemp; for (auto pit=listOfPoints.begin(); pit!=(listOfPoints.end()-1); ++pit) diff --git a/include/sampling/mmcs.hpp b/include/sampling/mmcs.hpp index 07529ad6d..02791535b 100644 --- a/include/sampling/mmcs.hpp +++ b/include/sampling/mmcs.hpp @@ -81,7 +81,7 @@ bool perform_mmcs_step(Polytope &P, walk.template get_starting_point(P, p, q, 10, rng); for (int i = 0; i < window; i++) { - walk.template apply(P, q, walk_length, rng); + walk.apply(P, q, walk_length, rng); winPoints.col(i) = q.getCoefficients(); } estimator.update_estimator(winPoints); diff --git a/include/sampling/parallel_mmcs.hpp b/include/sampling/parallel_mmcs.hpp index a8308f4ce..da22e8f6e 100644 --- a/include/sampling/parallel_mmcs.hpp +++ b/include/sampling/parallel_mmcs.hpp @@ -126,7 +126,7 @@ bool perform_parallel_mmcs_step(Polytope &P, walk.template get_starting_point(P, p, thread_random_walk_parameters, 10, rng); for (int i = 0; i < window; i++) { - walk.template apply(P, thread_random_walk_parameters, walk_length, rng); + walk.apply(P, thread_random_walk_parameters, walk_length, rng); winPoints_per_thread[thread_index].col(i) = thread_random_walk_parameters.p.getCoefficients(); } diff --git a/include/sampling/random_point_generators.hpp b/include/sampling/random_point_generators.hpp index e60181969..998d8dafc 100644 --- a/include/sampling/random_point_generators.hpp +++ b/include/sampling/random_point_generators.hpp @@ -35,7 +35,7 @@ struct RandomPointGenerator Walk walk(P, p, rng, parameters); for (unsigned int i=0; i struct policy_storing { template - static void store(WalkPolicy &policy, PointList &randPoints, ThreadParameters &thread_random_walk_parameters) + static void store(WalkPolicy &policy, PointList &randPoints, ThreadParameters &thread_random_walk_parameters) { policy.apply(randPoints, thread_random_walk_parameters.p); } @@ -30,7 +30,7 @@ template <> struct policy_storing { template - static void store(WalkPolicy &policy, PointList &randPoints, ThreadParameters &thread_random_walk_parameters) + static void store(WalkPolicy &policy, PointList &randPoints, ThreadParameters &thread_random_walk_parameters) { policy.apply(randPoints, thread_random_walk_parameters.p1); policy.apply(randPoints, thread_random_walk_parameters.p2); @@ -38,7 +38,7 @@ struct policy_storing }; template <> -struct policy_storing : policy_storing +struct policy_storing : policy_storing {}; @@ -72,7 +72,7 @@ struct RandomPointGeneratorMultiThread omp_set_num_threads(num_threads); unsigned int d = P.dimension(), m = P.num_of_hyperplanes(); - + std::vector num_points_per_thread(rnum%num_threads, rnum/num_threads+1); std::vector a(num_threads - rnum%num_threads, rnum/num_threads); num_points_per_thread.insert(num_points_per_thread.end(), a.begin(), a.end()); @@ -88,7 +88,7 @@ struct RandomPointGeneratorMultiThread for (unsigned int it = 0; it < num_points_per_thread[thread_index]; it++) { - walk.template apply(P, thread_random_walk_parameters, walk_length, rng); + walk.apply(P, thread_random_walk_parameters, walk_length, rng); #pragma omp critical { policy_storing::template store(policy, randPoints, thread_random_walk_parameters); @@ -135,7 +135,7 @@ struct RandomPointGeneratorMultiThread for (unsigned int it = 0; it < num_points_per_thread[thread_index]; it++) { - walk.template apply(P, thread_random_walk_parameters, walk_length, rng); + walk.apply(P, thread_random_walk_parameters, walk_length, rng); #pragma omp critical { policy_storing::template store(policy, randPoints, thread_random_walk_parameters); @@ -178,7 +178,7 @@ struct GaussianPointGeneratorMultiThread omp_set_num_threads(num_threads); unsigned int d = P.dimension(), m = P.num_of_hyperplanes(); - + std::vector num_points_per_thread(rnum%num_threads, rnum/num_threads+1); std::vector a(num_threads - rnum%num_threads, rnum/num_threads); num_points_per_thread.insert(num_points_per_thread.end(), a.begin(), a.end()); @@ -194,7 +194,7 @@ struct GaussianPointGeneratorMultiThread for (unsigned int it = 0; it < num_points_per_thread[thread_index]; it++) { - walk.template apply(P, thread_random_walk_parameters, a_i, walk_length, rng); + walk.apply(P, thread_random_walk_parameters, a_i, walk_length, rng); #pragma omp critical { policy_storing::template store(policy, randPoints, thread_random_walk_parameters); @@ -226,7 +226,7 @@ struct GaussianPointGeneratorMultiThread omp_set_num_threads(num_threads); unsigned int d = P.dimension(), m = P.num_of_hyperplanes(); - + std::vector num_points_per_thread(rnum%num_threads, rnum/num_threads+1); std::vector a(num_threads - rnum%num_threads, rnum/num_threads); num_points_per_thread.insert(num_points_per_thread.end(), a.begin(), a.end()); @@ -242,7 +242,7 @@ struct GaussianPointGeneratorMultiThread for (unsigned int it = 0; it < num_points_per_thread[thread_index]; it++) { - walk.template apply(P, thread_random_walk_parameters, a_i, walk_length, rng); + walk.apply(P, thread_random_walk_parameters, a_i, walk_length, rng); #pragma omp critical { policy_storing::template store(policy, randPoints, thread_random_walk_parameters); diff --git a/include/volume/volume_cooling_balls.hpp b/include/volume/volume_cooling_balls.hpp index d90604fa4..7f3d00d53 100644 --- a/include/volume/volume_cooling_balls.hpp +++ b/include/volume/volume_cooling_balls.hpp @@ -466,7 +466,7 @@ NT estimate_ratio(PolyBall1 &Pb1, do { - walk.template apply(Pb1, p, walk_length, rng); + walk.apply(Pb1, p, walk_length, rng); } while(!estimate_ratio_generic(Pb2, p, error, ratio_parameters)); return NT(ratio_parameters.count_in) / NT(ratio_parameters.tot_count); @@ -674,14 +674,14 @@ NT estimate_ratio_interval(PolyBall1 &Pb1, for (int i = 0; i < ratio_parameters.W; ++i) { - walk.template apply(Pb1, p, walk_length, rng); + walk.apply(Pb1, p, walk_length, rng); full_sliding_window(Pb2, p, ratio_parameters); } ratio_parameters.mean = ratio_parameters.sum / NT(ratio_parameters.W); do { - walk.template apply(Pb1, p, walk_length, rng); + walk.apply(Pb1, p, walk_length, rng); } while (!estimate_ratio_interval_generic(Pb2, p, error, zp, ratio_parameters)); return NT(ratio_parameters.count_in) / NT(ratio_parameters.tot_count); diff --git a/include/volume/volume_cooling_gaussians.hpp b/include/volume/volume_cooling_gaussians.hpp index ca06ce315..62835bd84 100644 --- a/include/volume/volume_cooling_gaussians.hpp +++ b/include/volume/volume_cooling_gaussians.hpp @@ -241,7 +241,7 @@ void compute_annealing_schedule(Polytope& P, // Compute some ratios to decide if this is the last gaussian for (unsigned int j = 0; j < steps; j++) { - walk.template apply(P, p, a_vals[it], walk_length, rng); + walk.apply(P, p, a_vals[it], walk_length, rng); curr_its += 1.0; curr_fn += eval_exp(p, next_a) / eval_exp(p, a_vals[it]); } @@ -398,7 +398,7 @@ double volume_cooling_gaussians(Polytope& Pin, while (!done || (*itsIt)