hameerabbasi / xsparse

XSparse is an experimental XTensor-like C++ sparse-array library.
BSD 3-Clause "New" or "Revised" License
9 stars 6 forks source link

Implement higher-level merge functionality for vectors of level formats #18

Closed adam2392 closed 1 year ago

adam2392 commented 1 year ago

Summary

This issue is to track the development of the higher-level function to merge vectors of level formats.

The current co-iteration code defines a co-iteration algorithm that also compares a tuple of level formats. If the level formats are the same, it returns True.

At a high level, this seems the most straightforward if the existing co-iteration algorithm already exists. Lmk if I misunderstood.

Plan (WIP)

Add a function after the compareHelper function inside co_iteration.hpp file in the iterator private class.

Misc.

Originally posted by @adam2392 in https://github.com/hameerabbasi/xsparse/issues/17#issuecomment-1475294562

bharath2438 commented 1 year ago

The current co-iteration code defines a co-iteration algorithm that also compares a tuple of level formats. If the level formats are the same, it returns True.

It checks if the levels have reached their end, which is used to decide the end of the combined iterator (co-iterator). It doesn't compare the levels themselves, but the iterators over these levels.

hameerabbasi commented 1 year ago

I think a focus on merge lattices is required, as well as co-iteration of non-unique and non-sorted levels. Co-iteration as an API is already complete, I would suggest you look up iterators and how they work in C++, as well as how to define your own.

adam2392 commented 1 year ago

Technically this was addressed by #31

The ability to handle co-iteration of collections of levels that are bundled together as a Tensor should be handled by a separate MergeLattice class.