yat  0.11.3pre
Public Types | Public Member Functions | List of all members
theplu::yat::utility::Index Class Reference

Class for storing indices of, e.g., a MatrixLookup. More...

#include <yat/utility/Index.h>

Public Types

typedef std::vector< size_t >
::const_iterator 
const_iterator
 

Public Member Functions

 Index (void)
 
 Index (size_t n)
 
 Index (const Index &a, const Index &b)
 
 Index (const SmartPtr< const std::vector< size_t > > &vec)
 Constructor.
 
 Index (const std::vector< size_t > &vec)
 Constructor.
 
const_iterator begin (void) const
 
const_iterator end (void) const
 
const size_t & operator[] (size_t) const
 access operator
 
size_t size (void) const
 number of elements
 
const std::vector< size_t > & vector (void) const
 

Detailed Description

Class for storing indices of, e.g., a MatrixLookup.

This class is basically a wrapper around std::vector<size_t>. The major differences are that the class is constant and copying is performed in constant time (shallow copy).

Member Typedef Documentation

Read only iterator

Since
New in yat 0.5

Constructor & Destructor Documentation

theplu::yat::utility::Index::Index ( void  )

Creates an empty Index

theplu::yat::utility::Index::Index ( size_t  n)
explicit

Created Index will satisfy a[i] = i.

Parameters
nsize of created Index
theplu::yat::utility::Index::Index ( const Index a,
const Index b 
)

Constructed Index c will satisfy c[i]=a[b[i]]

theplu::yat::utility::Index::Index ( const std::vector< size_t > &  vec)
explicit

Constructor.

vec is copied

Member Function Documentation

const_iterator theplu::yat::utility::Index::begin ( void  ) const
Returns
iterator pointing to first element of Index
Since
New in yat 0.5
const_iterator theplu::yat::utility::Index::end ( void  ) const
Returns
iterator pointing to element one passed last Index
Since
New in yat 0.5
const std::vector<size_t>& theplu::yat::utility::Index::vector ( void  ) const
Returns
underlying vector

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

Generated on Sat May 24 2014 03:33:06 for yat by  doxygen 1.8.2