diff --git a/Trajectory_Hotspots/Trajectory_Hotspots/float.h b/Trajectory_Hotspots/Trajectory_Hotspots/float.h index 9ab9fcf..b33f9a9 100644 --- a/Trajectory_Hotspots/Trajectory_Hotspots/float.h +++ b/Trajectory_Hotspots/Trajectory_Hotspots/float.h @@ -11,7 +11,7 @@ class Float static inline float fixed_epsilon = 0.0000001f; float get_value() const { return value; } - float set_value(const float value) { this->value = value; } + void set_value(const float value) { this->value = value; } Float& operator=(const Float& other); Float& operator=(float value); @@ -84,4 +84,4 @@ class Float float value = 0.0f; }; -Float operator/(const float& value, const Float& divider); \ No newline at end of file +Float operator/(const float& value, const Float& divider); diff --git a/Trajectory_Hotspots/Trajectory_Hotspots/trajectory.cpp b/Trajectory_Hotspots/Trajectory_Hotspots/trajectory.cpp index f26278d..aa4751d 100644 --- a/Trajectory_Hotspots/Trajectory_Hotspots/trajectory.cpp +++ b/Trajectory_Hotspots/Trajectory_Hotspots/trajectory.cpp @@ -1,12 +1,12 @@ #include "pch.h" #include "trajectory.h" -Trajectory::Trajectory(std::vector& ordered_segments) : trajectory_segments(ordered_segments) +Trajectory::Trajectory(const std::vector& ordered_segments) : trajectory_segments(ordered_segments) { trajectory_start = ordered_segments.front().start_t; trajectory_end = ordered_segments.back().end_t; - for (Segment& i : ordered_segments) + for (const Segment& i : ordered_segments) { trajectory_length += i.length(); } diff --git a/Trajectory_Hotspots/Trajectory_Hotspots/trajectory.h b/Trajectory_Hotspots/Trajectory_Hotspots/trajectory.h index 1b43634..89058d8 100644 --- a/Trajectory_Hotspots/Trajectory_Hotspots/trajectory.h +++ b/Trajectory_Hotspots/Trajectory_Hotspots/trajectory.h @@ -6,7 +6,7 @@ class Trajectory { public: Trajectory(){} - Trajectory(std::vector& ordered_segments); + Trajectory(const std::vector& ordered_segments); Trajectory(const std::vector& ordered_points);