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

Function CheckSparseCSFIndexValidity

cpp/src/arrow/sparse_tensor.cc:340–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338namespace {
339
340inline Status CheckSparseCSFIndexValidity(const std::shared_ptr<DataType>& indptr_type,
341 const std::shared_ptr<DataType>& indices_type,
342 const int64_t num_indptrs,
343 const int64_t num_indices,
344 const int64_t axis_order_size) {
345 if (!is_integer(indptr_type->id())) {
346 return Status::TypeError("Type of SparseCSFIndex indptr must be integer");
347 }
348 if (!is_integer(indices_type->id())) {
349 return Status::TypeError("Type of SparseCSFIndex indices must be integer");
350 }
351 if (num_indptrs + 1 != num_indices) {
352 return Status::Invalid(
353 "Length of indices must be equal to length of indptrs + 1 for SparseCSFIndex.");
354 }
355 if (axis_order_size != num_indices) {
356 return Status::Invalid(
357 "Length of indices must be equal to number of dimensions for SparseCSFIndex.");
358 }
359 return Status::OK();
360}
361
362} // namespace
363

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