osgEarth 2.1.1
Public Types | Public Member Functions | Protected Attributes

seamless::multi_array_ref< ElementType, Store, N > Class Template Reference

Inheritance diagram for seamless::multi_array_ref< ElementType, Store, N >:
Collaboration diagram for seamless::multi_array_ref< ElementType, Store, N >:

List of all members.

Public Types

typedef Reference< ElementType,
Store, N > 
super_type
typedef
super_type::simple_reference 
simple_reference

Public Member Functions

 multi_array_ref (Store &store, unsigned dimension, int base=0)
 multi_array_ref (Store &store, int *strides, int *shape, int base)
 multi_array_ref (const multi_array_ref &rhs)
simple_reference operator[] (int index)
int shape (int n) const
int indexBase (int n) const
int stride (int n) const

Protected Attributes

Store & _store
int _shape [N]
int _indexBase [N]
int _strides [N]

Detailed Description

template<typename ElementType, typename Store, unsigned N>
class seamless::multi_array_ref< ElementType, Store, N >

Definition at line 138 of file MultiArray.


Member Typedef Documentation

template<typename ElementType, typename Store, unsigned N>
typedef super_type::simple_reference seamless::multi_array_ref< ElementType, Store, N >::simple_reference

Reimplemented from seamless::Reference< ElementType, Store, N >.

Definition at line 142 of file MultiArray.

template<typename ElementType, typename Store, unsigned N>
typedef Reference<ElementType, Store, N> seamless::multi_array_ref< ElementType, Store, N >::super_type

Reimplemented in seamless::vector_ref< ElementType, Store >.

Definition at line 141 of file MultiArray.


Constructor & Destructor Documentation

template<typename ElementType, typename Store, unsigned N>
seamless::multi_array_ref< ElementType, Store, N >::multi_array_ref ( Store &  store,
unsigned  dimension,
int  base = 0 
) [inline]

Definition at line 143 of file MultiArray.

        : _store(store), super_type(base)
    {
        std::fill_n(&_shape[0], N, dimension);
        std::fill_n(&_indexBase[0], N, 0);
        _strides[N - 1] = 1;
        for (int i = N - 2; i >= 0; --i)
        {
            _strides[i] = dimension * _strides[i + 1];
        }
    }
template<typename ElementType, typename Store, unsigned N>
seamless::multi_array_ref< ElementType, Store, N >::multi_array_ref ( Store &  store,
int *  strides,
int *  shape,
int  base 
) [inline]

Definition at line 155 of file MultiArray.

        : _store(store), super_type(base)
    {
        std::copy(&shape[0], &shape[N], &_shape[0]);
        std::fill_n(&_indexBase[0], N, 0);
        std::copy(&strides[0], &strides[N], &_strides[0]);
        
    }
template<typename ElementType, typename Store, unsigned N>
seamless::multi_array_ref< ElementType, Store, N >::multi_array_ref ( const multi_array_ref< ElementType, Store, N > &  rhs) [inline]

Definition at line 164 of file MultiArray.

        : super_type(rhs), _store(rhs._store)
    {
        std::copy(&rhs._shape[0], &rhs._shape[N], &_shape[0]);
        std::copy(&rhs._indexBase[0], &rhs._indexBase[N], &_indexBase[0]);
        std::copy(&rhs._strides[0], &rhs._strides[N], &_strides[0]);
    }

Member Function Documentation

template<typename ElementType, typename Store, unsigned N>
int seamless::multi_array_ref< ElementType, Store, N >::indexBase ( int  n) const [inline]

Definition at line 178 of file MultiArray.

{ return _indexBase[n]; }
template<typename ElementType, typename Store, unsigned N>
simple_reference seamless::multi_array_ref< ElementType, Store, N >::operator[] ( int  index) [inline]

Definition at line 172 of file MultiArray.

    {
        return super_type::access(index, _store, _strides);
    }
template<typename ElementType, typename Store, unsigned N>
int seamless::multi_array_ref< ElementType, Store, N >::shape ( int  n) const [inline]

Definition at line 177 of file MultiArray.

{ return _shape[n]; }
template<typename ElementType, typename Store, unsigned N>
int seamless::multi_array_ref< ElementType, Store, N >::stride ( int  n) const [inline]

Definition at line 179 of file MultiArray.

{ return _strides[n]; }

Member Data Documentation

template<typename ElementType, typename Store, unsigned N>
int seamless::multi_array_ref< ElementType, Store, N >::_indexBase[N] [protected]

Definition at line 183 of file MultiArray.

template<typename ElementType, typename Store, unsigned N>
int seamless::multi_array_ref< ElementType, Store, N >::_shape[N] [protected]

Definition at line 182 of file MultiArray.

template<typename ElementType, typename Store, unsigned N>
Store& seamless::multi_array_ref< ElementType, Store, N >::_store [protected]

Definition at line 181 of file MultiArray.

template<typename ElementType, typename Store, unsigned N>
int seamless::multi_array_ref< ElementType, Store, N >::_strides[N] [protected]

Definition at line 184 of file MultiArray.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines