11#pragma once
22
3- #include " core/config/project_settings.h"
43#include " core/templates/local_vector.h"
54
65#include " core.h"
76#include " processor.h"
87#include " var_data.h"
8+ #include < math.h>
99#include < chrono>
1010#include < map>
1111#include < string>
@@ -361,7 +361,7 @@ T StatisticalRingBuffer<T>::average() const {
361361 a = a / T (data.size ());
362362 T b = avg_sum / T (data.size ());
363363 const T difference = a > b ? a - b : b - a;
364- ERR_FAIL_COND_V_MSG (difference > (CMP_EPSILON * 4.0 ), b, " The `avg_sum` accumulated a sensible precision loss: " + rtos (difference));
364+ ERR_FAIL_COND_V_MSG (difference > (std::numeric_limits<T>:: epsilon () * 4.0 ), b, " The `avg_sum` accumulated a sensible precision loss: " + rtos (difference));
365365 return b;
366366#else
367367 // Divide it by the buffer size is wrong when the buffer is not yet fully
@@ -381,10 +381,10 @@ T StatisticalRingBuffer<T>::average_rounded() const {
381381 for (uint32_t i = 1 ; i < data.size (); i += 1 ) {
382382 a += data[i];
383383 }
384- a = Math:: round (double (a) / double (data.size ()));
385- T b = Math:: round (double (avg_sum) / double (data.size ()));
384+ a = round (double (a) / double (data.size ()));
385+ T b = round (double (avg_sum) / double (data.size ()));
386386 const T difference = a > b ? a - b : b - a;
387- ERR_FAIL_COND_V_MSG (difference > (CMP_EPSILON * 4.0 ), b, " The `avg_sum` accumulated a sensible precision loss: " + rtos (difference));
387+ ERR_FAIL_COND_V_MSG (difference > (std::numeric_limits<T>:: epsilon () * 4.0 ), b, " The `avg_sum` accumulated a sensible precision loss: " + rtos (difference));
388388 return b;
389389#else
390390 // Divide it by the buffer size is wrong when the buffer is not yet fully
@@ -403,10 +403,10 @@ T StatisticalRingBuffer<T>::get_deviation(T p_mean) const {
403403
404404 double r = 0 ;
405405 for (uint32_t i = 0 ; i < data.size (); i += 1 ) {
406- r += Math:: pow (double (data[i]) - double (p_mean), 2.0 );
406+ r += pow (double (data[i]) - double (p_mean), 2.0 );
407407 }
408408
409- return Math:: sqrt (r / double (data.size ()));
409+ return sqrt (r / double (data.size ()));
410410}
411411
412412template <class T >
@@ -474,8 +474,8 @@ struct SyncGroup {
474474public:
475475 struct Change {
476476 bool unknown = false ;
477- RBSet <std::string> uknown_vars;
478- RBSet <std::string> vars;
477+ std::vector <std::string> uknown_vars;
478+ std::vector <std::string> vars;
479479 };
480480
481481 struct SimulatedObjectInfo {
0 commit comments