Iterators

We provide iterators supporting standard cpp syntax:

/* basis is Basis class instance */

/* Using begin() and end() */
for(auto it = basis.begin(); it < basis.end(); ++it){
    std::cout << *it << std::endl;
}

/* Using first() and last() */
for(auto it = basis.first(); it <= basis.last(); ++it){
    std::cout << *it << std::endl;
}

Warning

The iterator initiated by end() does not point to a physical state.

BasisIterator<BasisU1> danceq::internal::BasisU1::begin(void)

Returns BasisIterator pointing to the first element.

Returns a BasisIterator instance pointing to the first element.

for(auto it = B.begin(); it < B.end(); ++it){
    std::cout << *it << std::endl;
}

Returns:

Iterator pointing to the first element

BasisIterator<BasisU1> danceq::internal::BasisU1::end(void)

Returns BasisIterator pointing to the end.

Returns a BasisIterator instance pointing to the end which is not a physical state.

for(auto it = B.begin(); it < B.end(); ++it){
    std::cout << *it << std::endl;
}

Returns:

Iterator pointing to the end

BasisIterator<BasisU1> danceq::internal::BasisU1::first(void)

Returns BasisIterator pointing to the first element.

Returns a BasisIterator instance pointing to the first element.

for(auto it = B.first(); it <= B.last(); ++it){
    std::cout << *it << std::endl;
}

Returns:

Iterator pointing to the first element

BasisIterator<BasisU1> danceq::internal::BasisU1::last(void)

Returns BasisIterator pointing to the last element.

Returns a BasisIterator instance pointing to the last element.

for(auto it = B.first(); it <= B.last(); ++it){
    std::cout << *it << std::endl;
}

Returns:

Iterator pointing to the last element