Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Functions
commonUtils.hpp File Reference
#include <array>
#include <algorithm>
#include <cfloat>
#include <cmath>
#include <functional>
#include <limits>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include "commonUtils.tpp"
Include dependency graph for commonUtils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  bitpit::utils::DoubleFloatingComparison
 
struct  bitpit::utils::DoubleFloatingEqual
 
struct  bitpit::utils::DoubleFloatingGreater
 
struct  bitpit::utils::DoubleFloatingGreaterEqual
 
struct  bitpit::utils::DoubleFloatingLess
 
struct  bitpit::utils::DoubleFloatingLessEqual
 

Namespaces

namespace  bitpit::utils
 Namespace for generic utility functions.
 

Macros

#define BITPIT_ARGS_SIZE(...)   BITPIT_EXPAND_ARGS_FOR_COUNT(BITPIT_COUNT_ARGS_MAX6(__VA_ARGS__, 6, 5, 4, 3, 2, 1, 0))
 
#define BITPIT_CAT(A, B)   A ## B
 
#define BITPIT_COUNT_ARGS_MAX6(_1, _2, _3, _4, _5, _6, COUNT, ...)   COUNT
 
#define BITPIT_CREATE_WORKSPACE(workspace, item_type, size, stack_size)
 
#define BITPIT_EXPAND_ARGS_FOR_COUNT(x)   x
 
#define BITPIT_OVERLOAD_CALL(NAME, ...)   BITPIT_SELECT_OVERLOAD(NAME, BITPIT_ARGS_SIZE(__VA_ARGS__))(__VA_ARGS__)
 
#define BITPIT_SELECT_OVERLOAD(NAME, NUM)   BITPIT_CAT(NAME ## _, NUM)
 
#define BITPIT_STR(X)   BITPIT_STR2(X)
 
#define BITPIT_STR2(X)   #X
 

Functions

template bool bitpit::utils::addToOrderedVector (const long &, std::vector< long > &, std::less< long >)
 
template<typename T , typename Comparator = std::less<T>>
bool bitpit::utils::addToOrderedVector (const T &value, std::vector< T > &list, Comparator comparator=Comparator())
 
template bool bitpit::utils::addToOrderedVector (const unsigned long &, std::vector< unsigned long > &, std::less< unsigned long >)
 
std::size_t bitpit::utils::countDigits (int n)
 
template<class T >
void bitpit::utils::eraseValue (std::vector< T > &, const T &)
 
void bitpit::utils::extractWithoutReplacement (int n, int m, std::vector< int > &list)
 
unsigned long bitpit::utils::factorial (unsigned long n)
 
template std::vector< long >::const_iterator bitpit::utils::findInOrderedVector (const long &, const std::vector< long > &, std::less< long >)
 
template<typename T , typename Comparator = std::less<T>>
std::vector< T >::const_iterator bitpit::utils::findInOrderedVector (const T &value, const std::vector< T > &list, Comparator comparator=Comparator())
 
template std::vector< unsignedlong >::const_iterator bitpit::utils::findInOrderedVector (const unsigned long &, const std::vector< unsigned long > &, std::less< unsigned long >)
 
template<class T >
std::vector< T > bitpit::utils::intersectionVector (const std::vector< T > &, const std::vector< T > &)
 
template<typename OrderContainer , typename DataContainer >
void bitpit::utils::reorderContainer (OrderContainer &order, DataContainer &v, std::size_t size)
 
template<typename T >
void bitpit::utils::reorderVector (std::vector< size_t > &order, std::vector< T > &v, std::size_t size)
 
template<typename Container , typename Index >
void bitpit::utils::swapValue (Container &v, Index i, Index j)
 
template<>
void bitpit::utils::swapValue (std::vector< bool > &v, std::size_t i, std::size_t j)
 

Macro Definition Documentation

◆ BITPIT_ARGS_SIZE

#define BITPIT_ARGS_SIZE ( ...)    BITPIT_EXPAND_ARGS_FOR_COUNT(BITPIT_COUNT_ARGS_MAX6(__VA_ARGS__, 6, 5, 4, 3, 2, 1, 0))

Definition at line 52 of file commonUtils.hpp.

◆ BITPIT_CAT

#define BITPIT_CAT ( A,
B )   A ## B

Definition at line 48 of file commonUtils.hpp.

◆ BITPIT_COUNT_ARGS_MAX6

#define BITPIT_COUNT_ARGS_MAX6 ( _1,
_2,
_3,
_4,
_5,
_6,
COUNT,
... )   COUNT

Definition at line 50 of file commonUtils.hpp.

◆ BITPIT_EXPAND_ARGS_FOR_COUNT

#define BITPIT_EXPAND_ARGS_FOR_COUNT ( x)    x

Definition at line 51 of file commonUtils.hpp.

◆ BITPIT_OVERLOAD_CALL

#define BITPIT_OVERLOAD_CALL ( NAME,
... )   BITPIT_SELECT_OVERLOAD(NAME, BITPIT_ARGS_SIZE(__VA_ARGS__))(__VA_ARGS__)

Definition at line 55 of file commonUtils.hpp.

◆ BITPIT_SELECT_OVERLOAD

#define BITPIT_SELECT_OVERLOAD ( NAME,
NUM )   BITPIT_CAT(NAME ## _, NUM)

Definition at line 54 of file commonUtils.hpp.

◆ BITPIT_STR

#define BITPIT_STR ( X)    BITPIT_STR2(X)

Definition at line 45 of file commonUtils.hpp.

◆ BITPIT_STR2

#define BITPIT_STR2 ( X)    #X

Definition at line 44 of file commonUtils.hpp.

--- layout: doxygen_footer ---