| 298 | namespace internal { |
| 299 | |
| 300 | Status 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 | |
| 324 | void CheckSparseCSXIndexValidity(const std::shared_ptr<DataType>& indptr_type, |
| 325 | const std::shared_ptr<DataType>& indices_type, |
no test coverage detected