Skip to content

Commit

Permalink
cjange list
Browse files Browse the repository at this point in the history
  • Loading branch information
riasc committed Nov 8, 2024
1 parent a223a78 commit aca90c5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Chroms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
namespace genogrove {
Chroms::Chroms() : chromosomes{}, nextValue{0} {}

std::bitset<BITS> Chroms::registerChrom(const std::string& chrom) {
std::bitset<constants::BITS> Chroms::registerChrom(const std::string& chrom) {
auto it = chromosomes.find(chrom);
if(it != chromosomes.end()) {
return it->second; // chromosome is already registered
}

// create a new bitset (for the provided chromosome)
std::bitset<BITS> bits(nextValue);
std::bitset<constants::BITS> bits(nextValue);
chromosomes[chrom] = bits;
nextValue++;
return bits;
}

// get the next available bitset (without registering the chromosome)
std::bitset<BITS> Chroms::getNextBitset() const {
return std::bitset<BITS>(nextValue);
std::bitset<constants::BITS> Chroms::getNextBitset() const {
return std::bitset<constants::BITS>(nextValue);
}

std::bitset<BITS> Chroms::getBitset(std::string chrom) const {
std::bitset<constants::BITS> Chroms::getBitset(std::string chrom) const {
auto it = chromosomes.find(chrom);
if(it != chromosomes.end()) {
throw std::runtime_error("Chromosome " + chrom + " not registered");
Expand Down

0 comments on commit aca90c5

Please sign in to comment.