| 421 | std::string SparseCSFIndex::ToString() const { return std::string("SparseCSFIndex"); } |
| 422 | |
| 423 | bool SparseCSFIndex::Equals(const SparseCSFIndex& other) const { |
| 424 | auto eq = [](const auto& a, const auto& b) { return a->Equals(*b); }; |
| 425 | // TODO: remove the use of std::equal when we no longer have partial C++20 support with |
| 426 | // CRAN. |
| 427 | #if defined(__cpp_lib_ranges) && __cpp_lib_ranges >= 201911L |
| 428 | return axis_order() == other.axis_order() && |
| 429 | std::ranges::equal(indices(), other.indices(), eq) && |
| 430 | std::ranges::equal(indptr(), other.indptr(), eq); |
| 431 | #else |
| 432 | return axis_order() == other.axis_order() && |
| 433 | std::equal(indices().begin(), indices().end(), other.indices().begin(), |
| 434 | other.indices().end(), eq) && |
| 435 | std::equal(indptr().begin(), indptr().end(), other.indptr().begin(), |
| 436 | other.indptr().end(), eq); |
| 437 | #endif |
| 438 | } |
| 439 | |
| 440 | // ---------------------------------------------------------------------- |
| 441 | // SparseTensor |
nothing calls this directly
no test coverage detected