Skip to content
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

Support withSelect==true in SucVectorT::save/load #4

Merged
merged 1 commit into from
Nov 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions include/cybozu/sucvector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ class SucVectorT {
cybozu::save(os, numTbl_[0]);
cybozu::save(os, numTbl_[1]);
cybozu::savePodVec(os, blk_);
if (withSelect) {
cybozu::savePodVec(os, selTbl_[0]);
cybozu::savePodVec(os, selTbl_[1]);
}
}
template<class InputStream>
void load(InputStream& is)
Expand All @@ -205,6 +209,12 @@ class SucVectorT {
cybozu::load(numTbl_[0], is);
cybozu::load(numTbl_[1], is);
cybozu::loadPodVec(blk_, is);
if (withSelect) {
cybozu::loadPodVec(selTbl_[0], is);
cybozu::loadPodVec(selTbl_[1], is);
} else {
initSelTbl();
}
}
SucVectorT() : bitSize_(0), freezed_(false) { numTbl_[0] = numTbl_[1] = 0; }
SucVectorT(const uint64_t *buf, uint64_t bitSize)
Expand Down