Sector decomposition
Public Member Functions | Protected Attributes | Friends | List of all members
basic_multi_index Class Reference

#include <multi_index.h>

Inheritance diagram for basic_multi_index:
multi_index_counter multi_index_counter_indv multi_index_ordered

Public Member Functions

 basic_multi_index (void)
 
 basic_multi_index (size_t N, size_t k)
 
 basic_multi_index (size_t N, const std::vector< size_t > &vv)
 
size_t size (void) const
 
bool overflow (void) const
 
size_t operator[] (size_t i) const
 
size_t & operator[] (size_t i)
 
size_t operator() (size_t i) const
 
size_t & operator() (size_t i)
 
virtual basic_multi_indexinit (void)
 
virtual basic_multi_indexoperator++ (int)
 

Protected Attributes

size_t N
 upper limit for all components
 
std::vector< size_t > v
 a vector holding the multi-index
 
bool flag_overflow
 a flag indicating overflow
 

Friends

std::ostream & operator<< (std::ostream &os, const basic_multi_index &v)
 

Detailed Description

basic_multi_index is a base class.

Constructor & Destructor Documentation

◆ basic_multi_index() [1/3]

basic_multi_index ( void  )

Default constructor

◆ basic_multi_index() [2/3]

basic_multi_index ( size_t  NN,
size_t  k 
)
explicit

Construct a multi_index with upper limit N and size k .

◆ basic_multi_index() [3/3]

basic_multi_index ( size_t  NN,
const std::vector< size_t > &  vv 
)
explicit

Construct from a vector.

Member Function Documentation

◆ init()

basic_multi_index & init ( void  )
virtual

Initialize the multi-index to

\[
   (n_1,n_2,n_3,...,n_k) = (0,0,...,0)
\]

Reimplemented in multi_index_ordered, multi_index_counter, and multi_index_counter_indv.

◆ operator()() [1/2]

size_t & operator() ( size_t  i)

Subscription via ()

◆ operator()() [2/2]

size_t operator() ( size_t  i) const

Subscription via ()

◆ operator++()

basic_multi_index & operator++ ( int  )
virtual

◆ operator[]() [1/2]

size_t & operator[] ( size_t  i)

Subscription via []

◆ operator[]() [2/2]

size_t operator[] ( size_t  i) const

Subscription via []

◆ overflow()

bool overflow ( void  ) const

Return the overflow flag.

◆ size()

size_t size ( void  ) const

Returns the size of a multi_index.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const basic_multi_index v 
)
friend

Output operator. A multi_index prints out as basic_multi_index( $n_0,n_1,...$).


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