Changed float to double

This commit is contained in:
Efi Fogel 2024-03-12 14:32:25 +02:00
parent 6164b2c4a3
commit 50a2ae0a42
3 changed files with 12 additions and 12 deletions

View File

@ -1836,7 +1836,7 @@ std::string Aos::locate_country(Arr_handle arrh, const QVector3D& point) {
} }
Aos::Approx_arcs Aos::Approx_arcs
Aos::get_approx_arcs_from_faces_edges(Arr_handle arrh, float error) { Aos::get_approx_arcs_from_faces_edges(Arr_handle arrh, double error) {
auto& arr = *reinterpret_cast<Countries_arr*>(arrh.get()); auto& arr = *reinterpret_cast<Countries_arr*>(arrh.get());
auto ctr_cv = s_traits.construct_curve_2_object(); auto ctr_cv = s_traits.construct_curve_2_object();
Curves xcvs; Curves xcvs;

View File

@ -76,9 +76,9 @@ public:
static std::string locate_country(Arr_handle arrh, const QVector3D& point); static std::string locate_country(Arr_handle arrh, const QVector3D& point);
// this will get the approximate arcs of face-edges from the arrangement // this will get the approximate arcs of face-edges from the arrangement
// NOTE: this is similar to "get_approx_arcs(KML::Placemarks&, float)" above! // NOTE: this is similar to "get_approx_arcs(KML::Placemarks&, double)" above!
static Approx_arcs get_approx_arcs_from_faces_edges(Arr_handle arrh, static Approx_arcs get_approx_arcs_from_faces_edges(Arr_handle arrh,
float error); double error);
}; };
#endif #endif

View File

@ -20,13 +20,13 @@ public:
void reset() { m_Start = std::chrono::high_resolution_clock::now(); } void reset() { m_Start = std::chrono::high_resolution_clock::now(); }
float elapsed() { double elapsed() {
return std::chrono::duration_cast<std::chrono::nanoseconds>( return std::chrono::duration_cast<std::chrono::nanoseconds>(
std::chrono::high_resolution_clock::now() - m_Start).count() std::chrono::high_resolution_clock::now() - m_Start).count() *
* 0.001f * 0.001f * 0.001f; 0.001 * 0.001 * 0.001;
} }
float elapsed_millis() { return elapsed() * 1000.0f; } double elapsed_millis() { return elapsed() * 1000.0f; }
private: private:
std::chrono::time_point<std::chrono::high_resolution_clock> m_Start; std::chrono::time_point<std::chrono::high_resolution_clock> m_Start;
@ -34,16 +34,16 @@ private:
class ScopedTimer { class ScopedTimer {
public: public:
ScopedTimer(const std::string& name) : m_Name(name) {} ScopedTimer(const std::string& name) : m_name(name) {}
~ScopedTimer() { ~ScopedTimer() {
float time = m_Timer.elapsed_millis(); double time = m_timer.elapsed_millis();
std::cout << "[TIMER] " << m_Name << " - " << time << "ms\n"; std::cout << "[TIMER] " << m_name << " - " << time << "ms\n";
} }
private: private:
std::string m_Name; std::string m_name;
Timer m_Timer; Timer m_timer;
}; };