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

#include <multi_index.h>

Inheritance diagram for multi_index_counter_indv:
basic_multi_index

Public Member Functions

 multi_index_counter_indv (void)
 
 multi_index_counter_indv (const std::vector< size_t > &Nv, size_t k)
 
 multi_index_counter_indv (const std::vector< size_t > &Nv, const std::vector< size_t > &vv)
 
basic_multi_indexinit (void)
 
basic_multi_indexoperator++ (int)
 
- Public Member Functions inherited from basic_multi_index
 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

std::vector< size_t > Nv
 upper limit for the individual components
 
- Protected Attributes inherited from basic_multi_index
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 multi_index_counter_indv &v)
 

Detailed Description

The class multi_index_counter_indv defines a multi_index $(n_1,n_2,...,n_k)$, such that

\[
    0 \le n_j < N_j
\]

Constructor & Destructor Documentation

◆ multi_index_counter_indv() [1/3]

Default constructor

◆ multi_index_counter_indv() [2/3]

multi_index_counter_indv ( const std::vector< size_t > &  Nvv,
size_t  k 
)
explicit

Construct a multi_index with upper limit N and size k .

◆ multi_index_counter_indv() [3/3]

multi_index_counter_indv ( const std::vector< size_t > &  Nvv,
const std::vector< size_t > &  v 
)
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 from basic_multi_index.

◆ operator++()

basic_multi_index & operator++ ( int  )
virtual

The postfix increment operator allows to write for a multi-index n++, which will update n to the next configuration.

If n is in the last configuration and the increment operator ++ is applied to n, the overflow flag will be raised.

Reimplemented from basic_multi_index.

Friends And Related Function Documentation

◆ operator<<

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

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


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