sparse_array< I, T > Class Template Reference

#include <sparse_array.h>

Inheritance diagram for sparse_array< I, T >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef std::map< I, T > container_type
typedef container_type::size_type size_type

Public Member Functions

operator[] (size_type index) const
 Index into the map for a value.
T & operator[] (size_type index)
 Index into the vector for a value.
sparse_arrayoperator+= (sparse_array const &rhs)
 vectorized += operator
sparse_arrayoperator-= (sparse_array const &rhs)
 vectorized -= operator, overflow shouldn't occur during substraction (iow: for each components lhs[i] >= rhs[i]
size_type size () const
 return the maximum index of the array + 1 or 0 if the array is empty.
bool zero () const
 return true if all elements have the default constructed value

template<typename I, typename T>
class sparse_array< I, T >


Member Typedef Documentation

template<typename I, typename T>
typedef std::map<I, T> sparse_array< I, T >::container_type
template<typename I, typename T>
typedef container_type::size_type sparse_array< I, T >::size_type

Member Function Documentation

template<typename I, typename T>
sparse_array& sparse_array< I, T >::operator+= ( sparse_array< I, T > const &  rhs  )  [inline]

vectorized += operator

template<typename I, typename T>
sparse_array& sparse_array< I, T >::operator-= ( sparse_array< I, T > const &  rhs  )  [inline]

vectorized -= operator, overflow shouldn't occur during substraction (iow: for each components lhs[i] >= rhs[i]

template<typename I, typename T>
T& sparse_array< I, T >::operator[] ( size_type  index  )  [inline]

Index into the vector for a value.

If the index is larger than the current max index, a new array entry is created.

template<typename I, typename T>
T sparse_array< I, T >::operator[] ( size_type  index  )  const [inline]

Index into the map for a value.

NOTE: since std::map does/can not have a const member function for operator[], this const member function simply returns 0 for profile classes that aren't represented in the map. This member function will only be invoked for queries of the sparse array.

template<typename I, typename T>
size_type sparse_array< I, T >::size (  )  const [inline]

return the maximum index of the array + 1 or 0 if the array is empty.

template<typename I, typename T>
bool sparse_array< I, T >::zero (  )  const [inline]

return true if all elements have the default constructed value


The documentation for this class was generated from the following file:

Generated on 29 Jul 2013 for oprofile by  doxygen 1.6.1