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

Function CheckSparseCSFIndexValidity

cpp/src/arrow/sparse_tensor.cc:356–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

354namespace {
355
356inline Status CheckSparseCSFIndexValidity(const std::shared_ptr<DataType>& indptr_type,
357 const std::shared_ptr<DataType>& indices_type,
358 const int64_t num_indptrs,
359 const int64_t num_indices,
360 const int64_t axis_order_size) {
361 if (!is_integer(indptr_type->id())) {
362 return Status::TypeError("Type of SparseCSFIndex indptr must be integer");
363 }
364 if (!is_integer(indices_type->id())) {
365 return Status::TypeError("Type of SparseCSFIndex indices must be integer");
366 }
367 if (num_indptrs + 1 != num_indices) {
368 return Status::Invalid(
369 "Length of indices must be equal to length of indptrs + 1 for SparseCSFIndex.");
370 }
371 if (axis_order_size != num_indices) {
372 return Status::Invalid(
373 "Length of indices must be equal to number of dimensions for SparseCSFIndex.");
374 }
375 return Status::OK();
376}
377
378} // namespace
379

Callers 2

MakeMethod · 0.85
SparseCSFIndexMethod · 0.85

Calls 5

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

Tested by

no test coverage detected