| 405 | std::string SparseCSFIndex::ToString() const { return std::string("SparseCSFIndex"); } |
| 406 | |
| 407 | bool SparseCSFIndex::Equals(const SparseCSFIndex& other) const { |
| 408 | auto eq = [](const auto& a, const auto& b) { return a->Equals(*b); }; |
| 409 | // TODO: remove the use of std::equal when we no longer have partial C++20 support with |
| 410 | // CRAN. |
| 411 | #if defined(__cpp_lib_ranges) && __cpp_lib_ranges >= 201911L |
| 412 | return axis_order() == other.axis_order() && |
| 413 | std::ranges::equal(indices(), other.indices(), eq) && |
| 414 | std::ranges::equal(indptr(), other.indptr(), eq); |
| 415 | #else |
| 416 | return axis_order() == other.axis_order() && |
| 417 | std::equal(indices().begin(), indices().end(), other.indices().begin(), |
| 418 | other.indices().end(), eq) && |
| 419 | std::equal(indptr().begin(), indptr().end(), other.indptr().begin(), |
| 420 | other.indptr().end(), eq); |
| 421 | #endif |
| 422 | } |
| 423 | |
| 424 | // ---------------------------------------------------------------------- |
| 425 | // SparseTensor |
nothing calls this directly
no test coverage detected