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

Function ValidateSparseCSXIndex

cpp/src/arrow/sparse_tensor.cc:316–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314}
315
316Status ValidateSparseCSXIndex(const std::shared_ptr<DataType>& indptr_type,
317 const std::shared_ptr<DataType>& indices_type,
318 const std::vector<int64_t>& indptr_shape,
319 const std::vector<int64_t>& indices_shape,
320 const char* type_name) {
321 if (!is_integer(indptr_type->id())) {
322 return Status::TypeError("Type of ", type_name, " indptr must be integer");
323 }
324 if (indptr_shape.size() != 1) {
325 return Status::Invalid(type_name, " indptr must be a vector");
326 }
327 if (!is_integer(indices_type->id())) {
328 return Status::Invalid("Type of ", type_name, " indices must be integer");
329 }
330 if (indices_shape.size() != 1) {
331 return Status::Invalid(type_name, " indices must be a vector");
332 }
333
334 RETURN_NOT_OK(internal::CheckSparseIndexMaximumValue(indptr_type, indptr_shape));
335 RETURN_NOT_OK(internal::CheckSparseIndexMaximumValue(indices_type, indices_shape));
336
337 return Status::OK();
338}
339
340void CheckSparseCSXIndexValidity(const std::shared_ptr<DataType>& indptr_type,
341 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