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

Function ValidateSparseCSXIndex

cpp/src/arrow/sparse_tensor.cc:300–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298namespace internal {
299
300Status ValidateSparseCSXIndex(const std::shared_ptr<DataType>& indptr_type,
301 const std::shared_ptr<DataType>& indices_type,
302 const std::vector<int64_t>& indptr_shape,
303 const std::vector<int64_t>& indices_shape,
304 const char* type_name) {
305 if (!is_integer(indptr_type->id())) {
306 return Status::TypeError("Type of ", type_name, " indptr must be integer");
307 }
308 if (indptr_shape.size() != 1) {
309 return Status::Invalid(type_name, " indptr must be a vector");
310 }
311 if (!is_integer(indices_type->id())) {
312 return Status::Invalid("Type of ", type_name, " indices must be integer");
313 }
314 if (indices_shape.size() != 1) {
315 return Status::Invalid(type_name, " indices must be a vector");
316 }
317
318 RETURN_NOT_OK(internal::CheckSparseIndexMaximumValue(indptr_type, indptr_shape));
319 RETURN_NOT_OK(internal::CheckSparseIndexMaximumValue(indices_type, indices_shape));
320
321 return Status::OK();
322}
323
324void CheckSparseCSXIndexValidity(const std::shared_ptr<DataType>& indptr_type,
325 const std::shared_ptr<DataType>& indices_type,

Callers 2

MakeMethod · 0.85

Calls 7

is_integerFunction · 0.70
TypeErrorFunction · 0.70
InvalidFunction · 0.70
OKFunction · 0.70
idMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected