|
MolSim
|
Utility functions for working with iterable data containers. More...
#include <algorithm>#include <array>#include <cmath>#include <functional>#include <list>#include <map>#include <numeric>#include <set>#include <sstream>#include <string>#include <unordered_map>#include <unordered_set>#include <vector>Go to the source code of this file.
Classes | |
| struct | ArrayUtils::is_container_impl::is_container< T > |
| Default case: T is not a container. More... | |
| struct | ArrayUtils::is_container_impl::is_container< std::array< T, N > > |
| Specialization to allow std::array. More... | |
| struct | ArrayUtils::is_container_impl::is_container< std::vector< Args... > > |
| Specialization to allow std::vector. More... | |
| struct | ArrayUtils::is_container_impl::is_container< std::list< Args... > > |
| Specialization to allow std::list. More... | |
| struct | ArrayUtils::is_container_impl::is_container< std::set< Args... > > |
| Specialization to allow std::set. More... | |
| struct | ArrayUtils::is_container_impl::is_container< std::unordered_set< Args... > > |
| Specialization to allow std::unordered_set. More... | |
| struct | ArrayUtils::is_container< T > |
| Type trait to check if a given type is a container. More... | |
Namespaces | |
| namespace | ArrayUtils |
| Collection of utility functions and operators for iterable data containers like std::array, std::vector, etc. | |
| namespace | ArrayUtils::is_container_impl |
| Collection of structs that define what we consider a container. Remove / add whatever you need. | |
Functions | |
| template<class Container > | |
| std::string | ArrayUtils::to_string (const Container &container, const std::string &delimiter=", ", const std::array< std::string, 2 > &surround={"[", "]"}) |
| Generates a string representation of a container which fulfills the Container requirement (provide cbegin and cend). | |
| template<class Container , class F > | |
| Container | ArrayUtils::elementWisePairOp (const Container &lhs, const Container &rhs, F binaryFunction) |
| Applies an element wise binary function F to two containers. | |
| template<class Scalar , class Container , class F > | |
| Container | ArrayUtils::elementWiseScalarOp (const Scalar &lhs, const Container &rhs, F binaryFunction) |
| Applies a binary function F to with a scalar to every element in a container. | |
| template<class Container > | |
| auto | ArrayUtils::L2NormSquared (const Container &c) |
| Calculates the square of the L2 norm for a given container. | |
| template<class Container > | |
| auto | ArrayUtils::L2Norm (const Container &c) |
| Calculates the L2 norm for a given container. | |
| template<class Container > | |
| std::enable_if_t< ArrayUtils::is_container< Container >::value, std::ostream & > | operator<< (std::ostream &os, const Container &container) |
| Stream operator for containers. | |
| template<class Container > | |
| std::enable_if_t< ArrayUtils::is_container< Container >::value, Container > | operator+ (const Container &lhs, const Container &rhs) |
| Element wise addition of two containers. | |
| template<class Container > | |
| std::enable_if_t< ArrayUtils::is_container< Container >::value, Container > | operator- (const Container &lhs, const Container &rhs) |
| Element wise subtraction of two containers. | |
| template<class Container > | |
| std::enable_if_t< ArrayUtils::is_container< Container >::value, Container > | operator* (const Container &lhs, const Container &rhs) |
| Element wise multiplication of two containers. | |
| template<class Scalar , class Container > | |
| std::enable_if_t< ArrayUtils::is_container< Container >::value, Container > | operator* (const Scalar &lhs, const Container &rhs) |
| Element wise scaling of a container. | |
| template<class Container > | |
| std::enable_if_t< ArrayUtils::is_container< Container >::value, bool > | operator== (const Container &lhs, const Container &rhs) |
| Element wise comparison of two containers. | |
Utility functions for working with iterable data containers.
| std::enable_if_t< ArrayUtils::is_container< Container >::value, Container > operator* | ( | const Container & | lhs, |
| const Container & | rhs | ||
| ) |
Element wise multiplication of two containers.
| Container |
| lhs | |
| rhs |
| std::enable_if_t< ArrayUtils::is_container< Container >::value, Container > operator* | ( | const Scalar & | lhs, |
| const Container & | rhs | ||
| ) |
Element wise scaling of a container.
| Container |
| lhs | |
| rhs |
| std::enable_if_t< ArrayUtils::is_container< Container >::value, Container > operator+ | ( | const Container & | lhs, |
| const Container & | rhs | ||
| ) |
Element wise addition of two containers.
| Container |
| lhs | |
| rhs |
| std::enable_if_t< ArrayUtils::is_container< Container >::value, Container > operator- | ( | const Container & | lhs, |
| const Container & | rhs | ||
| ) |
Element wise subtraction of two containers.
| Container |
| lhs | |
| rhs |
| std::enable_if_t< ArrayUtils::is_container< Container >::value, std::ostream & > operator<< | ( | std::ostream & | os, |
| const Container & | container | ||
| ) |
Stream operator for containers.
This function actually checks if the given Template parameter satisfies is_container.
| Container |
| os | |
| container |
| std::enable_if_t< ArrayUtils::is_container< Container >::value, bool > operator== | ( | const Container & | lhs, |
| const Container & | rhs | ||
| ) |
Element wise comparison of two containers.
| Container |
| lhs | |
| rhs |