MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ normalize_row()

void MayaFlux::Kinesis::Stochastic::Weights::normalize_row ( size_t  row)
inlinenoexcept

Scale a row so its cells sum to one.

Note
A row that sums to zero is left unchanged.

Definition at line 174 of file Weights.hpp.

175 {
176 double sum = 0.0;
177 for (size_t col = 0; col < m_cols; ++col) {
178 sum += get(row, col);
179 }
180 if (sum != 0.0) {
181 scale_row(row, 1.0 / sum);
182 }
183 }
std::span< const double > row(size_t row) const noexcept
Non-atomic view of one row.
Definition Weights.hpp:150
void scale_row(size_t row, double factor) noexcept
Definition Weights.hpp:162
double get(size_t row, size_t col) const noexcept
Atomic read of one cell.
Definition Weights.hpp:141
std::vector< double > sum(std::span< const double > data, size_t n_windows, uint32_t hop_size, uint32_t window_size)
Sum per window.
Definition Analysis.cpp:469

References get(), m_cols, row(), and scale_row().

Referenced by apply_edges(), and uniform_excluding_self().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: