GiNaC 1.8.7
Public Member Functions | Protected Attributes | Friends | List of all members
GiNaC::basic_multi_iterator< T > Class Template Reference

basic_multi_iterator is a base class. More...

#include <utils_multi_iterator.h>

Inheritance diagram for GiNaC::basic_multi_iterator< T >:
GiNaC::multi_iterator_counter< T > GiNaC::multi_iterator_counter_indv< T > GiNaC::multi_iterator_ordered< T > GiNaC::multi_iterator_ordered_eq< T > GiNaC::multi_iterator_ordered_eq_indv< T > GiNaC::multi_iterator_permutation< T > GiNaC::multi_iterator_shuffle< T > GiNaC::multi_iterator_shuffle_prime< T >

Public Member Functions

 basic_multi_iterator (void)
 Default constructor. More...
 
 basic_multi_iterator (T B, T N, size_t k)
 Construct a multi_iterator with upper limit N, lower limit B and size k . More...
 
 basic_multi_iterator (T B, T N, const std::vector< T > &vv)
 Construct from a vector. More...
 
virtual ~basic_multi_iterator ()
 Destructor. More...
 
size_t size (void) const
 Returns the size of a multi_iterator. More...
 
bool overflow (void) const
 Return the overflow flag. More...
 
const std::vector< T > & get_vector (void) const
 Returns a reference to the vector v. More...
 
operator[] (size_t i) const
 Subscription via []. More...
 
T & operator[] (size_t i)
 Subscription via []. More...
 
operator() (size_t i) const
 Subscription via () More...
 
T & operator() (size_t i)
 Subscription via () More...
 
virtual basic_multi_iterator< T > & init (void)
 Initialize the multi-index to. More...
 
virtual basic_multi_iterator< T > & operator++ (int)
 No effect for basic_multi_iterator. More...
 

Protected Attributes

N
 
B
 
std::vector< T > v
 
bool flag_overflow
 

Friends

template<class TT >
std::ostream & operator<< (std::ostream &os, const basic_multi_iterator< TT > &v)
 

Detailed Description

template<class T>
class GiNaC::basic_multi_iterator< T >

basic_multi_iterator is a base class.

The base class itself does not do anything useful. A typical use of a class derived from basic_multi_iterator is

multi_iterator_ordered<int> k(0,4,2);

for( k.init(); !k.overflow(); k++) { std::cout << k << std::endl; }

which prints out

multi_iterator_ordered(0,1) multi_iterator_ordered(0,2) multi_iterator_ordered(0,3) multi_iterator_ordered(1,2) multi_iterator_ordered(1,3) multi_iterator_ordered(2,3)

Individual components of k can be accessed with k[i] or k(i).

All classes derived from basic_multi_iterator follow the same syntax.

Definition at line 97 of file utils_multi_iterator.h.

Constructor & Destructor Documentation

◆ basic_multi_iterator() [1/3]

template<class T >
GiNaC::basic_multi_iterator< T >::basic_multi_iterator ( void  )
inline

Default constructor.

Definition at line 405 of file utils_multi_iterator.h.

◆ basic_multi_iterator() [2/3]

template<class T >
GiNaC::basic_multi_iterator< T >::basic_multi_iterator ( B,
N,
size_t  k 
)
inlineexplicit

Construct a multi_iterator with upper limit N, lower limit B and size k .

Definition at line 413 of file utils_multi_iterator.h.

◆ basic_multi_iterator() [3/3]

template<class T >
GiNaC::basic_multi_iterator< T >::basic_multi_iterator ( B,
N,
const std::vector< T > &  vv 
)
inlineexplicit

Construct from a vector.

Definition at line 421 of file utils_multi_iterator.h.

◆ ~basic_multi_iterator()

template<class T >
GiNaC::basic_multi_iterator< T >::~basic_multi_iterator
inlinevirtual

Destructor.

Definition at line 429 of file utils_multi_iterator.h.

Member Function Documentation

◆ size()

template<class T >
size_t GiNaC::basic_multi_iterator< T >::size ( void  ) const
inline

Returns the size of a multi_iterator.

Definition at line 439 of file utils_multi_iterator.h.

Referenced by GiNaC::operator<<().

◆ overflow()

template<class T >
bool GiNaC::basic_multi_iterator< T >::overflow ( void  ) const
inline

Return the overflow flag.

Definition at line 467 of file utils_multi_iterator.h.

◆ get_vector()

template<class T >
const std::vector< T > & GiNaC::basic_multi_iterator< T >::get_vector ( void  ) const
inline

Returns a reference to the vector v.

Definition at line 477 of file utils_multi_iterator.h.

◆ operator[]() [1/2]

template<class T >
T GiNaC::basic_multi_iterator< T >::operator[] ( size_t  i) const
inline

Subscription via [].

Definition at line 489 of file utils_multi_iterator.h.

◆ operator[]() [2/2]

template<class T >
T & GiNaC::basic_multi_iterator< T >::operator[] ( size_t  i)
inline

Subscription via [].

Definition at line 499 of file utils_multi_iterator.h.

◆ operator()() [1/2]

template<class T >
T GiNaC::basic_multi_iterator< T >::operator() ( size_t  i) const
inline

Subscription via ()

Definition at line 509 of file utils_multi_iterator.h.

◆ operator()() [2/2]

template<class T >
T & GiNaC::basic_multi_iterator< T >::operator() ( size_t  i)
inline

Subscription via ()

Definition at line 519 of file utils_multi_iterator.h.

◆ init()

template<class T >
basic_multi_iterator< T > & GiNaC::basic_multi_iterator< T >::init ( void  )
inlinevirtual

◆ operator++()

template<class T >
basic_multi_iterator< T > & GiNaC::basic_multi_iterator< T >::operator++ ( int  )
inlinevirtual

Friends And Related Function Documentation

◆ operator<<

template<class T >
template<class TT >
std::ostream & operator<< ( std::ostream &  os,
const basic_multi_iterator< TT > &  v 
)
friend

Member Data Documentation

◆ N

template<class T >
T GiNaC::basic_multi_iterator< T >::N
protected

Definition at line 134 of file utils_multi_iterator.h.

◆ B

template<class T >
T GiNaC::basic_multi_iterator< T >::B
protected

◆ v

template<class T >
std::vector<T> GiNaC::basic_multi_iterator< T >::v
protected

◆ flag_overflow

template<class T >
bool GiNaC::basic_multi_iterator< T >::flag_overflow
protected

Definition at line 137 of file utils_multi_iterator.h.


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

This page is part of the GiNaC developer's reference. It was generated automatically by doxygen. For an introduction, see the tutorial.