CASM  1.1.0
A Clusters Approach to Statistical Mechanics
algorithm.hh File Reference
#include <algorithm>
#include <vector>
#include "casm/global/definitions.hh"

Go to the source code of this file.

Namespaces

 CASM
 Main CASM namespace.
 

Functions

template<typename Iterator , typename T , typename BinaryCompare >
Iterator CASM::find (Iterator begin, Iterator end, const T &value, BinaryCompare q)
 Equivalent to std::find(begin, end, value), but with custom comparison. More...
 
template<typename Iterator , typename T >
Index CASM::find_index (Iterator begin, Iterator end, const T &value)
 Equivalent to std::distance(begin, std::find(begin, end, value)) More...
 
template<typename Iterator , typename T , typename BinaryCompare >
Index CASM::find_index (Iterator begin, Iterator end, const T &value, BinaryCompare q)
 Equivalent to std::distance(begin, find(begin, end, value, q)) More...
 
template<typename Container , typename T , typename BinaryCompare >
Index CASM::find_index (const Container &container, const T &value, BinaryCompare q)
 Equivalent to std::distance(container.begin(), find(container.begin(), container.end(), value,q)) More...
 
template<typename Container , typename T >
Index CASM::find_index (const Container &container, const T &value)
 Equivalent to std::distance(container.begin(), std::find(container.begin(), container.end(), value)) More...
 
template<typename Iterator , typename UnaryPredicate >
Index CASM::find_index_if (Iterator begin, Iterator end, UnaryPredicate p)
 Equivalent to std::distance(begin, std::find_if(begin, end, p)) More...
 
template<typename Container , typename UnaryPredicate >
Index CASM::find_index_if (const Container &container, UnaryPredicate p)
 Equivalent to std::distance(container.begin(), std::find_if(container.begin(), container.end(), p)) More...
 
template<typename Iterator , typename UnaryPredicate >
Index CASM::find_index_if_not (Iterator begin, Iterator end, UnaryPredicate q)
 Equivalent to std::distance(begin, std::find_if_not(begin, end, q)) More...
 
template<typename Container , typename UnaryPredicate >
Index CASM::find_index_if_not (const Container &container, UnaryPredicate q)
 Equivalent to std::distance(container.begin(), std::find_if_not(container.begin(), container.end(), p)) More...
 
template<typename Container , typename T >
bool CASM::contains (const Container &container, const T &value)
 Equivalent to container.end() != std::find(container.begin(), container.end(), value) More...
 
template<typename Container , typename T , typename BinaryCompare >
bool CASM::contains (const Container &container, const T &value, BinaryCompare q)
 Equivalent to container.end() != find(container.begin(), container.end(), value, q) More...
 
template<typename Container , typename UnaryPredicate >
bool CASM::contains_if (const Container &container, UnaryPredicate p)
 Equivalent to container.end() != std::find_if(container.begin(), container.end(), p) More...
 
template<typename Container , typename UnaryPredicate >
bool CASM::contains_if_not (const Container &container, UnaryPredicate q)
 Equivalent to container.end() != std::find_if_not(container.begin(), container.end(), q) More...
 
template<typename Container1 , typename Container2 >
bool CASM::contains_all (const Container1 &container, const Container2 &values)
 Returns true if each elements of 'values' is contained in 'container'. More...
 
template<typename Container1 , typename Container2 , typename BinaryCompare >
bool CASM::contains_all (const Container1 &container, const Container2 &values, BinaryCompare q)
 Returns true if each elements of 'values' is contained in 'container', using comparison functor 'q'. More...
 
template<typename Container >
Container::value_type CASM::sum (const Container &container, typename Container::value_type init_val=0)
 
template<typename T >
T * CASM::end_ptr (std::vector< T > &container)
 Return pointer one past end of vector. Equivalent to convainer.data()+container.size() More...
 
template<typename T >
T const * CASM::end_ptr (std::vector< T > const &container)
 Return const pointer one past end of vector. Equivalent to convainer.data()+container.size() More...