47 const int s = rhs.size();
49 for(
int i = rhs.head_; i < s; i++)
50 out << rhs.ring_[i] <<
" ";
53 for (
int i = 0; i < rhs.head_; i++)
54 out << rhs.ring_[i] <<
" ";
63inline Type& AbaRing<Type>::operator[](
int i)
70inline const Type& AbaRing<Type>::operator[](
int i)
const
77void AbaRing<Type>::insert(Type
elem)
81 if (++head_ ==
size()) {
82 if (!filled_) filled_ =
true;
89inline void AbaRing<Type>::clear()
97inline int AbaRing<Type>::size()
const
104inline int AbaRing<Type>::number()
const
114inline Type AbaRing<Type>::oldest()
const
116 if(filled_)
return ring_[head_];
117 else return ring_[0];
122inline int AbaRing<Type>::oldestIndex()
const
124 if(filled_)
return head_;
130inline Type AbaRing<Type>::newest()
const
132 if (head_)
return ring_[head_ - 1];
133 else return ring_[
size() - 1];
138inline int AbaRing<Type>::newestIndex()
const
140 if (head_)
return head_ - 1;
141 else return size() - 1;
146int AbaRing<Type>::previous(
int i, Type &p)
const
148 int j = head_ - 1 - i;
155 p = ring_[
size() +
j];
163inline bool AbaRing<Type>::empty()
const
165 return !(head_ || filled_);
170inline bool AbaRing<Type>::filled()
const
177void AbaRing<Type>::realloc(
int newSize)
179 Array<Type>
tmp = ring_;
195 for(i = 0; i <
oldHead; i++) ring_[head_++] =
tmp[i];
206 for (head_ =
size() - 1, i =
oldHead - 1; head_ >= 0; head_--, i--) {
208 ring_[head_] =
tmp[i];
213 for (head_ =
size() - 1, i =
oldHead - 1; head_ >= 0; --head_, --i)
214 ring_[head_] =
tmp[i];
AbaRing(int size)
The constructor.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
std::ostream & operator<<(std::ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.