scicpp::mask

Defined in header <scicpp/core.hpp>

Return a vector with masked values.

template<typename T, std::size_t N, class Mask>
std::vector<T> mask(const std::array<T, N> &a, const Mask &m)

template<typename T, class Mask>
std::vector<T> mask(const std::vector<T> &a, const Mask &m)

template<typename T, class Mask>
std::vector<T> mask(std::vector<T> &&a, const Mask &m)

Mask is an array or vector of booleans, it must be the same size as a.

Return a std::vector containing only the elements of a with a mask index true.