Пример #1
0
inline void pairwise_div( cube<T>& a, const cube<T>& b )
{
    ZI_ASSERT(a.n_elem==b.n_elem);
    T* ap = a.memptr();
    const T* bp = b.memptr();

    for ( size_t i = 0; i < a.n_elem; ++i )
        ap[i] /= bp[i];
}
Пример #2
0
inline bool equal(const cube<T>& c1, const cube<T>& c2)
{
    if ( c1.n_elem != c2.n_elem )
    {
        return false;
    }

    return std::equal(c1.memptr(), c1.memptr() + c1.n_elem, c2.memptr());
}
Пример #3
0
inline void fill_indices(cube<T>& c)
{
    T  idx = 0;
    T* mem = c.memptr();

    for ( size_t i = 0; i < c.n_elem; ++i, ++idx )
        mem[i] = idx;
}
Пример #4
0
inline void flip(cube<T>& c)
{
    std::reverse(c.memptr(), c.memptr() + c.n_elem);
}