HighMap library (C++)
Loading...
Searching...
No Matches
vector_utils.cpp File Reference

Namespaces

namespace  hmap
 

Functions

std::vector< size_t > hmap::argsort (const std::vector< float > &v)
 Returns the indices that would sort the vector.
 
float hmap::compute_median (std::vector< float > values)
 Computes the median value of a set of floats.
 
std::vector< size_t > hmap::find_sign_changes (const std::vector< float > &data)
 Returns indices where a sign change occurs in the input vector.
 
std::string hmap::make_histogram (const std::vector< float > &values, int bin_count, int hist_height)
 Generates an ASCII histogram representation of values.
 
std::vector< float > hmap::moving_average (const std::vector< float > &input, int radius)
 Smooths a vector using a centered moving average.
 
size_t hmap::upperbound_right (const std::vector< float > &v, float value)
 Returns the index of the first element greater than a given value.
 
void hmap::reindex_vector (std::vector< int > &v, std::vector< size_t > &idx)
 
void hmap::reindex_vector (std::vector< float > &v, std::vector< size_t > &idx)
 
std::vector< float > hmap::remap (const std::vector< float > &data, float new_min=0.f, float new_max=1.f)
 Remaps values of a vector to a given range [new_min, new_max].
 
void hmap::vector_unique_values (std::vector< float > &v)
 Removes duplicate values from a vector.