Skip to content

Commit

Permalink
Merge branch 'Smattr-63DADBC9-CFD6-4C2E-A70A-5EA771A3B770'
Browse files Browse the repository at this point in the history
  • Loading branch information
rchikhi committed Apr 12, 2020
2 parents a788493 + 44492d2 commit 275568b
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 29 deletions.
2 changes: 1 addition & 1 deletion gatb-core/src/gatb/bank/impl/BankComposite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class BankComposite : public AbstractBank
size_t getCompositionNb() { return _banks.size(); }

/** \return maximum number of files. */
static const size_t getMaxNbFiles () { return 30; }
static size_t getMaxNbFiles () { return 30; }

/** Return the vector of IBank objects.
* \return the IBank objects. */
Expand Down
2 changes: 1 addition & 1 deletion gatb-core/src/gatb/bank/impl/BankFasta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class BankFasta : public AbstractBank
protected:

/** \return maximum number of files. */
static const size_t getMaxNbFiles () { return 1; }
static size_t getMaxNbFiles () { return 1; }

friend class Iterator;

Expand Down
2 changes: 1 addition & 1 deletion gatb-core/src/gatb/bank/impl/BankRandom.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class BankRandom : public AbstractBank
void estimate (u_int64_t& number, u_int64_t& totalSize, u_int64_t& maxSize);

/** \return maximum number of files. */
static const size_t getMaxNbFiles () { return 0; }
static size_t getMaxNbFiles () { return 0; }

/************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion gatb-core/src/gatb/bank/impl/BankSplitter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class BankSplitter : public AbstractBank
void estimate (u_int64_t& number, u_int64_t& totalSize, u_int64_t& maxSize);

/** \return maximum number of files. */
static const size_t getMaxNbFiles () { return 0; }
static size_t getMaxNbFiles () { return 0; }

/************************************************************/

Expand Down
4 changes: 2 additions & 2 deletions gatb-core/src/gatb/kmer/impl/CountProcessorHistogram.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class CountProcessorHistogram : public CountProcessorAbstract<span>
fprintf(histo2Dfile,"%5i:\t",ii);
for(int jj=0; jj<= _histogram->getLength2(); jj++)
{
fprintf(histo2Dfile,"\t%6lli", _histogram->get2D(ii,jj));
fprintf(histo2Dfile,"\t%6lli", (long long)_histogram->get2D(ii,jj));
}
fprintf(histo2Dfile,"\n");
}
Expand All @@ -134,7 +134,7 @@ class CountProcessorHistogram : public CountProcessorAbstract<span>
//output 1D histogram now
for(int ii=1; ii<= _histogram->getLength(); ii++)
{
fprintf(histo1Dfile,"%i\t%lli",ii,_histogram->get(ii));
fprintf(histo1Dfile,"%i\t%lli",ii,(long long)_histogram->get(ii));
fprintf(histo1Dfile,"\n");
}

Expand Down
22 changes: 7 additions & 15 deletions gatb-core/src/gatb/tools/compression/HeaderCoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#define PRINT_DEBUG_ENCODER
#define PRINT_DEBUG_DECODER
*/
#include <string>


//====================================================================================
Expand Down Expand Up @@ -703,13 +704,10 @@ void HeaderDecoder::decodeNumeric(){
u_int64_t value = CompressionUtils::decodeNumeric(_rangeDecoder, _numericModels[_misIndex]);
//_currentHeader += CompressionUtils::numberToString(value);

char temp[200];
snprintf(temp,200,"%llu",value);
_currentHeader += string(temp);
//_currentHeader += to_string(value); // C++11
_currentHeader += std::to_string(value);

#ifdef PRINT_DEBUG_DECODER
cout << "\t\t\tAdding: " << string(temp) << endl;
cout << "\t\t\tAdding: " << std::to_string(value) << endl;
#endif
}

Expand All @@ -723,13 +721,10 @@ void HeaderDecoder::decodeDelta(){

value = CompressionUtils::getValueFromDelta(1, _prevFieldValues[_fieldIndex], value);

char temp[200];
snprintf(temp,200,"%llu",value);
_currentHeader += string(temp);
//_currentHeader += to_string(value);
_currentHeader += std::to_string(value);

#ifdef PRINT_DEBUG_DECODER
cout << "\t\t\tAdding: " << string(temp) << endl;
cout << "\t\t\tAdding: " << std::to_string(value) << endl;
#endif
}

Expand All @@ -742,13 +737,10 @@ void HeaderDecoder::decodeDelta2(){
u_int64_t value = CompressionUtils::decodeNumeric(_rangeDecoder, _numericModels[_misIndex]);

value = CompressionUtils::getValueFromDelta(2, _prevFieldValues[_fieldIndex], value);
char temp[200];
snprintf(temp,200,"%llu",value);
_currentHeader += string(temp);
//_currentHeader += to_string(value);
_currentHeader += std::to_string(value);

#ifdef PRINT_DEBUG_DECODER
cout << "\t\t\tAdding: " << string(temp) << endl;
cout << "\t\t\tAdding: " << std::to_string(value) << endl;
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion gatb-core/src/gatb/tools/compression/Leon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ class BankLeon : public AbstractBank
void estimate (u_int64_t& number, u_int64_t& totalSize, u_int64_t& maxSize);

/** \return maximum number of files. */
static const size_t getMaxNbFiles () { return 0; }
static size_t getMaxNbFiles () { return 0; }

/************************************************************/

Expand Down
4 changes: 2 additions & 2 deletions gatb-core/src/gatb/tools/math/Integer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class IntegerTemplate
/** Get the size of an instance of the class used by the variant (ie. one of the Ti template class parameters)
* \return the size of an object (in bits).
*/
const size_t getSize () { return boost::apply_visitor (Integer_size(), *(*this)); }
size_t getSize () { return boost::apply_visitor (Integer_size(), *(*this)); }

/** Get the HDF5 type for the the class used by the variant (ie. one of the Ti template class parameters)
* \param[in] isCompound : tells whether the type is composed or not
Expand Down Expand Up @@ -310,7 +310,7 @@ class IntegerTemplate
template<typename T> const char* operator() (const T& a) const { return a.getName(); }};

struct Integer_size : public boost::static_visitor<const size_t> {
template<typename T> const size_t operator() (const T& a) const { return a.getSize(); }};
template<typename T> size_t operator() (const T& a) const { return a.getSize(); }};

struct Integer_plus : public boost::static_visitor<IntegerTemplate> {
template<typename T> IntegerTemplate operator() (const T& a, const T& b) const { return IntegerTemplate(a + b); }
Expand Down
2 changes: 1 addition & 1 deletion gatb-core/src/gatb/tools/math/LargeInt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ template<int precision> class LargeInt
/** Get the size of an instance of the class
* \return the size of an object (in bits).
*/
static const size_t getSize () { return 8*sizeof(u_int64_t)*precision; }
static size_t getSize () { return 8*sizeof(u_int64_t)*precision; }

/********************************************************************************/
/** Returns lower 64 bits */
Expand Down
2 changes: 1 addition & 1 deletion gatb-core/src/gatb/tools/math/LargeInt1.pri
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public:

static const char* getName () { return "LargeInt<1>"; }

static const size_t getSize () { return 8*sizeof(u_int64_t); }
static size_t getSize () { return 8*sizeof(u_int64_t); }

/** Returns lower 64 bits */
u_int64_t toInt () const { return value; }
Expand Down
2 changes: 1 addition & 1 deletion gatb-core/src/gatb/tools/math/NativeInt64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class NativeInt64
void setVal (u_int64_t c) { value = c; }


static const size_t getSize () { return 8*sizeof(u_int64_t); }
static size_t getSize () { return 8*sizeof(u_int64_t); }

NativeInt64 operator+ (const NativeInt64& other) const { return value + other.value; }
NativeInt64 operator- (const NativeInt64& other) const { return value - other.value; }
Expand Down
2 changes: 1 addition & 1 deletion gatb-core/src/gatb/tools/math/NativeInt8.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class NativeInt8 : private misc::ArrayData<u_int8_t, 1>

static const char* getName () { return "NativeInt8"; }

static const size_t getSize () { return 8*sizeof(u_int8_t); }
static size_t getSize () { return 8*sizeof(u_int8_t); }

operator char () const { return (char) value[0]; }

Expand Down
3 changes: 2 additions & 1 deletion gatb-core/thirdparty/BooPHF/BooPHF.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#pragma once
#include <stdio.h>
#include <cinttypes>
#include <climits>
#include <stdlib.h>
#include <iostream>
Expand Down Expand Up @@ -836,7 +837,7 @@ we need this 2-functors scheme because HashFunctors won't work with unordered_ma

uint64_t totalsize = totalsizeBitset + _final_hash.size()*42*8 ; // unordered map takes approx 42B per elem [personal test] (42B with uint64_t key, would be larger for other type of elem)

printf("Bitarray %12llu bits (%.2f %%) (array + ranks )\n",
printf("Bitarray %12" PRIu64 " bits (%.2f %%) (array + ranks )\n",
totalsizeBitset, 100*(float)totalsizeBitset/totalsize);
printf("final hash %12lu bits (%.2f %%) (nb in final hash %lu)\n",
_final_hash.size()*42*8, 100*(float)(_final_hash.size()*42*8)/totalsize,
Expand Down

0 comments on commit 275568b

Please sign in to comment.