MCPcopy Create free account
hub / github.com/apache/arrow / CheckSparseIndexMaximumValue

Function CheckSparseIndexMaximumValue

cpp/src/arrow/sparse_tensor.cc:52–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50
51template <typename IndexValueType>
52Status CheckSparseIndexMaximumValue(const std::vector<int64_t>& shape) {
53 using c_index_value_type = typename IndexValueType::c_type;
54 constexpr int64_t type_max =
55 static_cast<int64_t>(std::numeric_limits<c_index_value_type>::max());
56 auto greater_than_type_max = [&](int64_t x) { return x > type_max; };
57 if (std::any_of(shape.begin(), shape.end(), greater_than_type_max)) {
58 return Status::Invalid("The bit width of the index value type is too small");
59 }
60 return Status::OK();
61}
62
63template <>
64Status CheckSparseIndexMaximumValue<Int64Type>(const std::vector<int64_t>& shape) {

Callers 6

ValidateSparseCSXIndexFunction · 0.85
MakeMethod · 0.85
ConvertMethod · 0.85
ConvertMethod · 0.85
ConvertMethod · 0.85

Calls 6

InvalidFunction · 0.70
OKFunction · 0.70
TypeErrorFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected