Scaffolding  0.1
This program can assemble genome scaffolds using the pairing information in paired-end reads.
Classes | Macros | Functions
utils.hpp File Reference
#include <iostream>
#include <string>
#include <cassert>
#include <bitset>
#include <boost/unordered_set.hpp>
#include <boost/unordered_map.hpp>
#include "unordered_pair.hpp"

Go to the source code of this file.

Classes

struct  diagonal_counter
 

Macros

#define default_buckets   boost::unordered::detail::default_bucket_count
 
#define byte   unsigned char
 
#define SIZE_T_BITS   (unsigned)(8*sizeof(size_t))
 
#define DEEP_EMPLACE(x, y)   emplace(std::piecewise_construct, std::make_tuple(x), std::make_tuple(y))
 
#define DEFAULT_EMPLACE(x)   emplace(std::piecewise_construct, std::make_tuple(x), std::make_tuple())
 
#define MAX_TW   (unsigned char)64
 
#define debuglevel   5
 
#define DEBUG1(x)   x
 
#define DEBUG2(x)   x
 
#define DEBUG3(x)   x
 
#define DEBUG4(x)   x
 
#define DEBUG5(x)   x
 
#define DEBUG6(x)
 

Functions

template<typename ElementA , typename ElementB >
bool pareto_le (const std::pair< ElementA, ElementB > &p1, const std::pair< ElementA, ElementB > &p2)
 return whether a pair is pareto-smaller than another pair
 
template<typename Element >
std::ostream & operator<< (std::ostream &os, const std::list< Element > &lst)
 output list of things
 
template<typename Element1 , typename Element2 >
std::ostream & operator<< (std::ostream &os, const boost::unordered_map< Element1, Element2 > &map)
 output map of things
 
template<class Set , typename Element >
bool contains (const Set &s, const Element &el)
 a more readable containment check More...
 
template<typename T >
size_t hash_value (const boost::unordered_set< T > &S)
 a hash computation for an unordered set, XORing its members
 
template<typename T >
void operator&= (boost::unordered_set< T > &S1, const boost::unordered_set< T > &S2)
 set intersection for unordered sets More...
 
template<typename T >
void operator^= (boost::unordered_set< T > &S1, const boost::unordered_set< T > &S2)
 symmetric set difference for unordered sets More...
 
bool file_exists (const std::string &filename)
 testing whether a file exists by trying to open it
 
template<typename A , typename B >
std::pair< B, A > reverse (const std::pair< A, B > &p)
 reverse a pair of things, that is, turn (x,y) into (y,x)
 

Detailed Description

collection of general utilities

Function Documentation

template<class Set , typename Element >
bool contains ( const Set &  s,
const Element &  el 
)
inline

a more readable containment check

Parameters
sany container object that implements find() and cend()
elsome element to check containment of in s
template<typename T >
void operator&= ( boost::unordered_set< T > &  S1,
const boost::unordered_set< T > &  S2 
)

set intersection for unordered sets

removes all elements from S1 that are not in S2

template<typename T >
void operator^= ( boost::unordered_set< T > &  S1,
const boost::unordered_set< T > &  S2 
)

symmetric set difference for unordered sets

removes all elements of S1 that are not in S2 and emplaces copies of all elements of S2 that are not in S1