gtopt::ArrayIndexBase struct

Derived classes

template<typename Type, typename Map, typename FSched, typename... Uid>
struct ArrayIndexTraits

Public types

enum class ValueKind: std::uint8_t { integer, real, other }
C++ value kind a schedule reads from a long table's value column.

Public static variables

template<typename Type>
static ValueKind value_kind_v
Mirrors the int32 / double dispatch of InputTraits::access_sched.

Public static functions

static auto coerce_value_column(const ArrowChunkedArray& col, ValueKind kind, std::string_view cname, std::string_view fname) -> ArrowChunkedArray
template<typename Type, typename... Uid>
static auto get_arrow_index(const SystemContext& system_context, std::string_view cname, std::string_view fname, const Id& id, auto& array_map, auto& table_map) -> auto
static auto read_arrow_table(const SystemContext& sc, std::string_view cname, std::string_view fname) -> ArrowTable

Enum documentation

enum class gtopt::ArrayIndexBase::ValueKind: std::uint8_t

C++ value kind a schedule reads from a long table's value column.

Enumerators
integer

int32-backed (IntBool such as active, Int, Uid)

real

double-backed (Real)

other

anything else: no coercion

Function documentation

static ArrowChunkedArray gtopt::ArrayIndexBase::coerce_value_column(const ArrowChunkedArray& col, ValueKind kind, std::string_view cname, std::string_view fname)

Coerce a long table's value column to the type the schedule reads, once at load time:

  • integer: any integer column is widened to int32; a float/double column is accepted when every value is a whole number in int32 range (e.g. an active schedule written as 1.0 / 0.0).
  • real: float is widened and any integer column is converted to double. Any other column type, or a fractional value for an integer schedule, throws std::runtime_error naming <cname>/<fname>, the offending row and value.