BasisIterator

The BasisIterator class is built on top of the BasisU1 class and allows an easy handling of basis states. It is returned by the BasisU1 class and follows standard cpp syntax.

 1 using State = danceq::internal::State<256,4> State;
 2 using Container = danceq::internal::ContainerTable<State>;
 3 using Basis = danceq::internal::BasisU1<Container>;
 4 using BasisIterator = danceq::internal::BasisIterator<Basis>;
 5
 6 /* basis is Basis class instance with L = 164 and n = 4 */
 7 Basis basis(164,4)
 8
 9 /* Using begin() and end() */
10 for(auto it = basis.begin(); it < basis.end(); ++it){
11     std::cout << *it << std::endl;
12 }
13
14 /* Using first() and last() */
15 for(auto it = basis.first(); it <= basis.last(); ++it){
16     std::cout << *it << std::endl;
17 }

The current State can be retrieved with *it.