-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slight redesign of the I/O system and binary I/O for Array #90
Conversation
…d implemented binary io for Array format
src/sparsebase/sparse_reader.h
Outdated
public: | ||
virtual format::COO<VertexID, NumEdges, Weight> *ReadCOO() const = 0; | ||
virtual format::Array<T> *ReadCOO() const = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be ReadArray
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, totally
src/sparsebase/sparse_reader.h
Outdated
}; | ||
|
||
template <class VertexID, typename NumEdges, typename Weight> | ||
template <typename IDType, typename NNZType, typename ValueType> | ||
class ReadsSparseFormat { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this whole interface is pointless at this point 🤔 what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should rename it as ReadOrderTwoFormat
since that's what it's supposed to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to CLion, it is not used anywhere in the library. So I think we should just remove it. Graphs right now have methods for both CSR and COO so a generic one is not really necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can always add it back in if we end up needing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. There's a typo + I think ReadsSparseFormat
was meant for reading connectivity in graphs so maybe it should be ReadsOrderTwoFormat
. What do you think?
The primary goal of this PR is to implement binary readers and writers for the newly added Array format. However the current class structure of the I/O system caused some issues with this. So this PR also features a slight redesign of the system to accommodate Array and make the library more future proof.
Previous Design
The main problem with this design is that to write an Array object, the user still has to pass three template types only one of which would be used. Similar situations would occur as new formats with more or less templates get added to the library.
New Design
The new design is inspired heavily by the recently updated conversion system. However in this case CRTP is not necessary so it is omitted. For more information, please refer to #85.