Molecular Dynamics  v0.4
Project for the Practical hosted by the Scientific Computing Chair
Classes | Namespaces | Functions
ArrayUtils.h File Reference
#include <array>
#include <cmath>
#include <list>
#include <numeric>
#include <set>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <vector>
Include dependency graph for ArrayUtils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ArrayUtils::is_container_impl::is_container< T >
 
struct  ArrayUtils::is_container_impl::is_container< std::array< T, N > >
 
struct  ArrayUtils::is_container_impl::is_container< std::vector< Args... > >
 
struct  ArrayUtils::is_container_impl::is_container< std::list< Args... > >
 
struct  ArrayUtils::is_container_impl::is_container< std::set< Args... > >
 
struct  ArrayUtils::is_container_impl::is_container< std::unordered_set< Args... > >
 
struct  ArrayUtils::is_container< T >
 

Namespaces

 ArrayUtils
 
 ArrayUtils::is_container_impl
 

Functions

template<class Container >
std::string ArrayUtils::to_string (const Container &container, const std::string &delimiter=", ", const std::array< std::string, 2 > &surround={"[", "]"})
 
template<class Container , class F >
Container ArrayUtils::elementWisePairOp (const Container &lhs, const Container &rhs, F binaryFunction)
 
template<class Scalar , class Container , class F >
Container ArrayUtils::elementWiseScalarOp (const Scalar &lhs, const Container &rhs, F binaryFunction)
 
template<class Container >
auto ArrayUtils::L2Norm (const Container &c)
 
template<class Container >
std::enable_if_t< ArrayUtils::is_container< Container >::value, std::ostream & > operator<< (std::ostream &os, const Container &container)
 
template<class Container >
std::enable_if_t< ArrayUtils::is_container< Container >::value, Container > operator+ (const Container &lhs, const Container &rhs)
 
template<class Container >
std::enable_if_t< ArrayUtils::is_container< Container >::value, Container > operator- (const Container &lhs, const Container &rhs)
 
template<class Container >
std::enable_if_t< ArrayUtils::is_container< Container >::value, Container > operator* (const Container &lhs, const Container &rhs)
 
template<class Scalar , class Container >
std::enable_if_t< ArrayUtils::is_container< Container >::value, Container > operator* (const Scalar &lhs, const Container &rhs)
 
template<class Container >
std::enable_if_t< ArrayUtils::is_container< Container >::value, bool > operator== (const Container &lhs, const Container &rhs)
 

Function Documentation

◆ operator*() [1/2]

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 Parameters
Container
Parameters
lhs
rhs
Returns
For all i lhs[i] * rhs[i].
Here is the call graph for this function:

◆ operator*() [2/2]

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 Parameters
Container
Parameters
lhs
rhs
Returns
For all i lhs * rhs[i].
Here is the call graph for this function:

◆ operator+()

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 Parameters
Container
Parameters
lhs
rhs
Returns
For all i lhs[i] + rhs[i].
Here is the call graph for this function:

◆ operator-()

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 Parameters
Container
Parameters
lhs
rhs
Returns
For all i lhs[i] - rhs[i].
Here is the call graph for this function:

◆ operator<<()

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.

This function actually checks if the given Template parameter satisfies is_container.

Template Parameters
Container
Parameters
os
container
Returns

◆ operator==()

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.

Template Parameters
Container
Parameters
lhs
rhs
Returns
True iff the containers are of the same size, all elements are equal, and in the same order.