MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
mtl::tensor::detail_index Namespace Reference

Functions

template<std::size_t NA, std::size_t NB>
constexpr char find_repeated (const std::array< char, NA > &a, const std::array< char, NB > &b)
 Find the repeated index between two name arrays.
template<std::size_t NA, std::size_t NB>
constexpr std::size_t count_shared (const std::array< char, NA > &a, const std::array< char, NB > &b)
 How many indices of a also appear in b.
template<std::size_t N>
constexpr std::size_t find_pos (const std::array< char, N > &arr, char c)
 Find the position of a character in an array.

Function Documentation

◆ count_shared()

template<std::size_t NA, std::size_t NB>
std::size_t mtl::tensor::detail_index::count_shared ( const std::array< char, NA > & a,
const std::array< char, NB > & b )
constexpr

How many indices of a also appear in b.

◆ find_pos()

template<std::size_t N>
std::size_t mtl::tensor::detail_index::find_pos ( const std::array< char, N > & arr,
char c )
constexpr

Find the position of a character in an array.

◆ find_repeated()

template<std::size_t NA, std::size_t NB>
char mtl::tensor::detail_index::find_repeated ( const std::array< char, NA > & a,
const std::array< char, NB > & b )
constexpr

Find the repeated index between two name arrays.

Returns the character of the repeated index, or '\0' if none.