Grappa  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Grappa::util Namespace Reference

Classes

struct  SimpleIterator
 

Functions

template<typename T >
std::string array_str (const char *name, GlobalAddress< T > base, size_t nelem, int width=10)
 String representation of a global array. More...
 
template<int width = 10, typename ArrayT = nullptr_t>
std::string array_str (const char *name, const ArrayT &array)
 
template<int width = 10, typename ArrayT = nullptr_t>
std::string array_str (const ArrayT &array)
 
template<typename T >
SimpleIterator< T > iterate (T *base=nullptr, size_t nelem=0)
 Easier C++11 iteration over local array. More...
 
template<int width = 10, typename T = nullptr_t>
std::string array_str (const char *name, T *base, size_t nelem)
 String representation of a local array, matches form of Grappa::array_str that takes a global array. More...
 

Function Documentation

template<typename T >
std::string Grappa::util::array_str ( const char *  name,
GlobalAddress< T >  base,
size_t  nelem,
int  width = 10 
)
inline

String representation of a global array.

DVLOG(2) << array_str("x", xs, 4);
// (if DEBUG=1 and --v=2)
//> x: [
//> 7 4 2 3
//> ]

Definition at line 175 of file Array.hpp.

template<int width = 10, typename ArrayT = nullptr_t>
std::string Grappa::util::array_str ( const char *  name,
const ArrayT &  array 
)
inline

Definition at line 186 of file Array.hpp.

template<int width = 10, typename ArrayT = nullptr_t>
std::string Grappa::util::array_str ( const ArrayT &  array)
inline

Definition at line 204 of file Array.hpp.

template<int width = 10, typename T = nullptr_t>
std::string Grappa::util::array_str ( const char *  name,
T *  base,
size_t  nelem 
)
inline

String representation of a local array, matches form of Grappa::array_str that takes a global array.

Definition at line 233 of file Array.hpp.

template<typename T >
SimpleIterator<T> Grappa::util::iterate ( T *  base = nullptr,
size_t  nelem = 0 
)

Easier C++11 iteration over local array.

Similar idea to Addressing::iterate_local().

auto array = new long[N];
for (auto& v : util::iterate(array,N)) {
v++;
}

Definition at line 229 of file Array.hpp.