diff --git a/modules/wfc/wave_form_collapse.cpp b/modules/wfc/wave_form_collapse.cpp index c1ab63679..e98c4fdcd 100644 --- a/modules/wfc/wave_form_collapse.cpp +++ b/modules/wfc/wave_form_collapse.cpp @@ -2,9 +2,8 @@ #include -namespace { // Normalize a vector so the sum of its elements is equal to 1.0f -void normalize(Vector &v) { +void WaveFormCollapse::normalize(Vector &v) { double sum_weights = 0.0; int size = v.size(); const double *vpr = v.ptr(); @@ -20,7 +19,7 @@ void normalize(Vector &v) { } // Return distribution * log(distribution). -Vector get_plogp(const Vector &distribution) { +Vector WaveFormCollapse::get_plogp(const Vector &distribution) { Vector plogp; for (int i = 0; i < distribution.size(); i++) { @@ -31,7 +30,7 @@ Vector get_plogp(const Vector &distribution) { } // Return min(v) / 2. -double get_min_abs_half(const Vector &v) { +double WaveFormCollapse::get_min_abs_half(const Vector &v) { double min_abs_half = std::numeric_limits::infinity(); for (int i = 0; i < v.size(); i++) { @@ -41,8 +40,6 @@ double get_min_abs_half(const Vector &v) { return min_abs_half; } -} //namespace - bool WaveFormCollapse::get_eriodic_output() const { return is_impossible; } @@ -339,7 +336,6 @@ WaveFormCollapse::WaveFormCollapse() { } WaveFormCollapse::~WaveFormCollapse() { - } void WaveFormCollapse::bind_methods() { diff --git a/modules/wfc/wave_form_collapse.h b/modules/wfc/wave_form_collapse.h index 94af15df5..74ec55d49 100644 --- a/modules/wfc/wave_form_collapse.h +++ b/modules/wfc/wave_form_collapse.h @@ -107,6 +107,10 @@ public: propagating.push_back(PropagatingEntry(y, x, pattern)); } + void normalize(Vector &v); + Vector get_plogp(const Vector &distribution); + double get_min_abs_half(const Vector &v); + void propagate(); void initialize();