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

Function CheckSparseIndexMaximumValue

cpp/src/arrow/sparse_tensor.cc:51–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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