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

1-based index (Fortran convention). More...

#include <index.hpp>

Static Public Member Functions

static constexpr std::size_t to_internal (std::size_t i)
static constexpr std::size_t to_external (std::size_t i)

Static Public Attributes

static constexpr std::size_t base = 1

Detailed Description

1-based index (Fortran convention).

Index 0 is out of range: to_internal(0) wraps to SIZE_MAX, which every bounds check rejects (dense2D's element access checks ri >= num_rows() when bounds_checking is on), and which is undefined to use without one, like any out-of-range index (#838).

Member Function Documentation

◆ to_external()

constexpr std::size_t mtl::detail::f_index::to_external ( std::size_t i)
inlinestaticconstexpr

◆ to_internal()

constexpr std::size_t mtl::detail::f_index::to_internal ( std::size_t i)
inlinestaticconstexpr

Member Data Documentation

◆ base

std::size_t mtl::detail::f_index::base = 1
staticconstexpr

The documentation for this struct was generated from the following file:
  • /home/runner/work/mtl5/mtl5/include/mtl/detail/index.hpp