OGS
Algorithm.h File Reference

Detailed Description

Definition in file Algorithm.h.

#include <algorithm>
#include <cassert>
#include <optional>
#include <string>
#include <typeindex>
#include <typeinfo>
#include "Error.h"
Include dependency graph for Algorithm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 BaseLib
 

Functions

template<typename T >
std::vector< T > BaseLib::excludeObjectCopy (std::vector< T > const &src_vec, std::vector< std::size_t > const &exclude_positions)
 
template<typename T >
void BaseLib::excludeObjectCopy (std::vector< T > const &src_vec, std::vector< std::size_t > const &exclude_positions, std::vector< T > &dest_vec)
 
template<typename InputIt , typename Predicate >
std::iterator_traits< InputIt >::reference BaseLib::findElementOrError (InputIt begin, InputIt end, Predicate predicate, std::string const &error="")
 
template<typename Map , typename Key , typename Value >
void BaseLib::insertIfTypeIndexKeyUniqueElseError (Map &map, Key const &key, Value &&value, std::string const &error_message)
 
template<typename Map , typename Key , typename Value >
void BaseLib::insertIfKeyUniqueElseError (Map &map, Key const &key, Value &&value, std::string const &error_message)
 
template<typename Map , typename Key , typename Value >
void BaseLib::insertIfKeyValueUniqueElseError (Map &map, Key const &key, Value &&value, std::string const &error_message)
 
template<typename Map , typename Key >
Map::mapped_type & BaseLib::getOrError (Map &map, Key const &key, std::string const &error_message)
 
template<typename Map , typename Key >
Map::mapped_type const & BaseLib::getOrError (Map const &map, Key const &key, std::string const &error_message)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
template<typename Container , typename Predicate >
Container::value_type const & BaseLib::getIfOrError (Container const &container, Predicate &&predicate, std::string const &error_message)
 
template<typename T >
void BaseLib::makeVectorUnique (std::vector< T > &v)
 
template<typename T , class Compare >
void BaseLib::makeVectorUnique (std::vector< T > &v, Compare comp)
 
template<typename ValueType , typename IndexType >
void BaseLib::reorderVector (std::vector< ValueType > &v, std::vector< IndexType > const &order)
 
template<typename Container >
void BaseLib::uniquePushBack (Container &container, typename Container::value_type const &element)
 
template<typename Container >
bool BaseLib::contains (Container const &container, typename Container::value_type const &element)
 
template<typename Container , typename Predicate >
bool BaseLib::containsIf (Container const &container, Predicate &&predicate)
 
template<typename Container >
std::optional< typename Container::value_type > BaseLib::findFirstNotEqualElement (Container const &container, typename Container::value_type const &element)
 
template<typename Container >
std::size_t BaseLib::findIndex (Container const &container, typename Container::value_type const &element)
 
template<typename T >
void BaseLib::cleanupVectorElements (std::vector< T * > &items)
 
template<typename T1 , typename... Args>
void BaseLib::cleanupVectorElements (std::vector< T1 * > &dependent_items, Args &&... args)
 
template<typename List >
constexpr bool BaseLib::any_of (List const &values)
 Checks if any of the elements in the given list is true. More...
 
template<typename List >
constexpr bool BaseLib::all_of (List const &values)
 Checks if all of the elements in the given list are true. More...
 
template<typename List >
constexpr bool BaseLib::none_of (List const &values)
 Checks if none of the elements in the given list are true. More...