Commit 6a69a25c authored by Rayan Chikhi's avatar Rayan Chikhi
Browse files

fixed load/save features of boophf. also made mphf (using boophf) default graph behavior

we should think about phasing out no-mphf support. gcc < 4.7 is becoming obsolete. let's make mphf mandatory
parent 3b13f0f7
......@@ -212,7 +212,7 @@ struct configure_visitor : public boost::static_visitor<> {
data.setBranching (algo.getBranchingCollection());
}
if ((graph.getState() & GraphTemplate<Node, Edge, GraphDataVariant>::STATE_MPHF_DONE) && (graph.getState() & GraphTemplate<Node, Edge, GraphDataVariant>::STATE_SORTING_COUNT_DONE))
if ((graph._mphfKind != MPHF_NONE) && (graph.getState() & GraphTemplate<Node, Edge, GraphDataVariant>::STATE_MPHF_DONE) && (graph.getState() & GraphTemplate<Node, Edge, GraphDataVariant>::STATE_SORTING_COUNT_DONE))
{
typedef typename Kmer<span>::Count Count;
typedef typename Kmer<span>::Type Type;
......@@ -651,7 +651,7 @@ struct build_visitor_postsolid : public boost::static_visitor<> {
** REMARKS :
*********************************************************************/
template<typename Node, typename Edge, typename GraphDataVariant>
IOptionsParser* GraphTemplate<Node, Edge, GraphDataVariant>::getOptionsParser (bool includeMandatory, bool enableMphf)
IOptionsParser* GraphTemplate<Node, Edge, GraphDataVariant>::getOptionsParser (bool includeMandatory)
{
/** We build the root options parser. */
......@@ -666,7 +666,7 @@ IOptionsParser* GraphTemplate<Node, Edge, GraphDataVariant>::getOptionsParser (b
if (MPHF<char>::enabled)
{
IOptionsParser* parserEmphf = new OptionsParser ("mphf");
parserEmphf->push_back (new tools::misc::impl::OptionOneParam (STR_MPHF_TYPE, "mphf type ('none' or 'emphf' or 'BooPHF')", false, enableMphf ? "BooPHF":"none"));
parserEmphf->push_back (new tools::misc::impl::OptionOneParam (STR_MPHF_TYPE, "mphf type ('none' or 'emphf' or 'BooPHF')", false, "BooPHF"));
parser->push_back (parserEmphf);
}
......
......@@ -488,7 +488,7 @@ public:
/** Get a parser object that knows the user options for building a graph.
* \return the options parser object.
*/
static tools::misc::IOptionsParser* getOptionsParser (bool includeMandatory=true, bool enablemphf=false );
static tools::misc::IOptionsParser* getOptionsParser (bool includeMandatory=true);
/********************************************************************************/
template<typename Item, int NB=8>
......
......@@ -135,9 +135,8 @@ public:
/** We need an input stream for the given collection given by group/name. */
tools::storage::impl::Storage::istream is (group, name);
/** We load the emphf object from the input stream. */
//mphf.load (is);
std::cout << "BooPHF load not implemented" << std::endl; exit(1);
/** We return the number of keys. */
bphf = new boophf_t();
bphf->load (is);
return size();
}
......@@ -148,8 +147,7 @@ public:
/** We need an output stream for the given collection given by group/name. */
tools::storage::impl::Storage::ostream os (group, name);
/** We save the emphf object to the output stream. */
//mphf.save (os);
std::cout << "BooPHF save not implemented" << std::endl;
bphf->save (os);
/** We set the number of keys as an attribute of the group. */
group.addProperty ("nb_keys", misc::impl::Stringify().format("%d",nbKeys)); // FIXME: maybe overflow here
return os.tellp();
......
......@@ -891,7 +891,6 @@ we need this 2-functors scheme because HashFunctors won't work with unordered_ma
is.read(reinterpret_cast<char*>(&_lastbitsetrank), sizeof(_lastbitsetrank));
is.read(reinterpret_cast<char*>(&_nelem), sizeof(_nelem));
_levels = (level **) malloc(_nb_levels * sizeof(level *) );
for(int ii=0; ii<_nb_levels; ii++)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment