Sector decomposition
Public Member Functions | Friends | List of all members
multi_index_ordered Class Reference

#include <multi_index.h>

Inheritance diagram for multi_index_ordered:
basic_multi_index

Public Member Functions

 multi_index_ordered (void)
 
 multi_index_ordered (size_t N, size_t k)
 
 multi_index_ordered (size_t N, 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)
 

Friends

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

Additional Inherited Members

- 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
 

Detailed Description

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

\[
    0 \le n_j < N
\]

and

\[
    n_j < n_{j+1}.
\]

It is assumed that $k>0$ and $ N \ge k $.

Constructor & Destructor Documentation

◆ multi_index_ordered() [1/3]

multi_index_ordered ( void  )

Default constructor

◆ multi_index_ordered() [2/3]

multi_index_ordered ( size_t  N,
size_t  k 
)
explicit

Construct a multi_index with upper limit N and size k .

◆ multi_index_ordered() [3/3]

multi_index_ordered ( size_t  N,
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,1,2,...,k-1)
\]

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_ordered v 
)
friend

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


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