Doxygen 1.9.1
Toolkit for Adaptive Stochastic Modeling and Non-Intrusive ApproximatioN: Tasmanian v8.2 (development)
Miscellaneous utility templates
Collaboration diagram for Miscellaneous utility templates:

Files

file  tsgUtils.hpp
 Miscellaneous utility templates used thoughout the code.
 

Classes

class  TasGrid::Utils::Wrapper2D< T >
 Wraps around a C-style of an array and mimics 2D data-structure. More...
 

Typedefs

template<bool condition>
using TasGrid::Utils::use_if = typename std::enable_if< condition, void >::type
 Equivalent to C++14 enable_if_t<condition, void>
 

Functions

template<typename IntA , typename IntB >
size_t TasGrid::Utils::size_mult (IntA a, IntB b)
 Converts two integer-like variables to size_t and returns the product.. More...
 
template<typename T , typename I >
std::vector< typename std::remove_const< T >::type > TasGrid::Utils::copyArray (T *x, I size)
 Copies an array into a vector, returns empty vector if the input is nullpntr. More...
 
template<typename T >
std::vector< T > TasGrid::Utils::mergeVectors (std::vector< std::vector< T >> const &vec)
 Takes a vector of vectors and returns a single contiguous vector. More...
 
template<typename T , typename U >
TasGrid::Utils::exchange (T &x, U new_x)
 Equivalent to C++14 exchange, but works with simpler types (int, double, float*).
 
template<typename T , typename... Args>
std::unique_ptr< T > TasGrid::Utils::make_unique (Args &&... args)
 Equivalent to C++14 make_unique.
 

Detailed Description

Function Documentation

◆ size_mult()

template<typename IntA , typename IntB >
size_t TasGrid::Utils::size_mult ( IntA  a,
IntB  b 
)
inline

Converts two integer-like variables to size_t and returns the product..

◆ copyArray()

template<typename T , typename I >
std::vector<typename std::remove_const<T>::type> TasGrid::Utils::copyArray ( T *  x,
size 
)

Copies an array into a vector, returns empty vector if the input is nullpntr.

◆ mergeVectors()

template<typename T >
std::vector<T> TasGrid::Utils::mergeVectors ( std::vector< std::vector< T >> const &  vec)

Takes a vector of vectors and returns a single contiguous vector.