| 314 | } |
| 315 | |
| 316 | Status 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 | |
| 340 | void CheckSparseCSXIndexValidity(const std::shared_ptr<DataType>& indptr_type, |
| 341 | const std::shared_ptr<DataType>& indices_type, |
no test coverage detected