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

Go to the source code of this file.

Namespaces

namespace  hmap
 

Typedefs

typedef unsigned int uint
 

Functions

std::vector< size_t > hmap::argsort (const std::vector< float > &v)
 Returns the indices that would sort the vector.
 
template<typename T >
void hmap::reindex_vector (std::vector< T > &v, std::vector< size_t > &idx)
 Reorders a vector using a given index mapping.
 
size_t hmap::upperbound_right (const std::vector< float > &v, float value)
 Returns the index of the first element greater than a given value.
 
template<typename T >
void hmap::shuffle_vector (std::vector< T > &values, std::uint32_t seed)
 Shuffles a vector in-place using a deterministic seed.
 
template<typename T >
std::vector< T > hmap::shuffled_vector (const std::vector< T > &values, std::uint32_t seed)
 Returns a shuffled copy of a vector.
 
std::vector< size_t > hmap::find_sign_changes (const std::vector< float > &data)
 Returns indices where a sign change occurs in the input vector.
 
float hmap::compute_median (std::vector< float > values)
 Computes the median value of a set of floats.
 
std::vector< float > hmap::moving_average (const std::vector< float > &input, int radius)
 Smooths a vector using a centered moving average.
 
void hmap::vector_unique_values (std::vector< float > &v)
 Removes duplicate values from a vector.
 
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].
 
std::string hmap::make_histogram (const std::vector< float > &values, int bin_count, int hist_height)
 Generates an ASCII histogram representation of values.
 

Detailed Description

Typedef Documentation

◆ uint

typedef unsigned int uint