Loading...
Searching...
No Matches
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.
Namespaces | |
| namespace | bitpit::utils |
| Namespace for generic utility functions. | |
Macros | |
| #define | BITPIT_ARGS_SIZE(...) |
| #define | BITPIT_CAT(A, B) |
| #define | BITPIT_COUNT_ARGS_MAX6(_1, _2, _3, _4, _5, _6, COUNT, ...) |
| #define | BITPIT_CREATE_WORKSPACE(workspace, item_type, size, stack_size) |
| #define | BITPIT_EXPAND_ARGS_FOR_COUNT(x) |
| #define | BITPIT_OVERLOAD_CALL(NAME, ...) |
| #define | BITPIT_SELECT_OVERLOAD(NAME, NUM) |
| #define | BITPIT_STR(X) |
| #define | BITPIT_STR2(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 | ( | ... | ) |
Value:
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 ) |
Value:
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, | |||
| ... ) |
Value:
COUNT
Definition at line 50 of file commonUtils.hpp.
◆ BITPIT_EXPAND_ARGS_FOR_COUNT
| #define BITPIT_EXPAND_ARGS_FOR_COUNT | ( | x | ) |
Value:
x
Definition at line 51 of file commonUtils.hpp.
◆ BITPIT_OVERLOAD_CALL
| #define BITPIT_OVERLOAD_CALL | ( | NAME, | |
| ... ) |
Value:
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 ) |
Value:
BITPIT_CAT(NAME ## _, NUM)
Definition at line 54 of file commonUtils.hpp.
◆ BITPIT_STR
| #define BITPIT_STR | ( | X | ) |
Value:
BITPIT_STR2(X)
Definition at line 45 of file commonUtils.hpp.
◆ BITPIT_STR2
| #define BITPIT_STR2 | ( | X | ) |
Value:
#X
Definition at line 44 of file commonUtils.hpp.
1.13.2