24std::vector<size_t>
argsort(
const std::vector<float> &v);
124std::vector<float>
moving_average(
const std::vector<float> &input,
int radius);
138 std::vector<T> v_new(v.size());
139 for (std::uint32_t k = 0; k < v.size(); k++)
140 v_new[k] = v[idx[k]];
154std::vector<float>
remap(
const std::vector<float> &data,
156 float new_max = 1.f);
168 std::mt19937 rng(seed);
169 std::shuffle(values.begin(), values.end(), rng);
183 std::vector<T> result = values;
Definition algebra.hpp:23
std::vector< size_t > find_sign_changes(const std::vector< float > &data)
Returns indices where a sign change occurs in the input vector.
Definition vectors.cpp:48
std::vector< T > shuffled_vector(const std::vector< T > &values, std::uint32_t seed)
Returns a shuffled copy of a vector.
Definition vectors.hpp:181
size_t upperbound_right(const std::vector< float > &v, float value)
Returns the index of the first element greater than a given value.
Definition vectors.cpp:236
void remap(Array &array, float vmin, float vmax, float from_min, float from_max)
Remap array elements from a starting range to a target range.
Definition range.cpp:363
std::vector< float > moving_average(const std::vector< float > &input, int radius)
Smooths a vector using a centered moving average.
Definition vectors.cpp:210
std::string make_histogram(const std::vector< float > &values, int bin_count, int hist_height)
Generates an ASCII histogram representation of values.
Definition vectors.cpp:144
std::vector< float > generate_random_vector(size_t size, float min_value, float max_value, uint32_t seed)
Generate a vector of random floating-point values within a given range.
Definition vectors.cpp:77
std::vector< size_t > argsort(const std::vector< float > &v)
Returns the indices that would sort the vector.
Definition vectors.cpp:17
std::vector< int > generate_unique_random_vector(size_t size, int min_value, int max_value, uint32_t seed)
Generate a vector of unique random integers within a given range.
Definition vectors.cpp:113
float compute_median(std::vector< float > values)
Computes the median value of a set of floats.
Definition vectors.cpp:28
void vector_unique_values(std::vector< float > &v)
Removes duplicate values from a vector.
Definition vectors.cpp:280
void reindex_vector(std::vector< T > &v, std::vector< size_t > &idx)
Reorders a vector using a given index mapping.
Definition vectors.hpp:136
void shuffle_vector(std::vector< T > &values, std::uint32_t seed)
Shuffles a vector in-place using a deterministic seed.
Definition vectors.hpp:166