BWAPI
Public Member Functions | Protected Attributes
Alternation_counter< NT > Class Template Reference

Count the number of alternations in a sequence of NTs. More...

#include <Alternation_counter.h>

List of all members.

Public Member Functions

 Alternation_counter ()
void push_back (const NT &i)
 Add the next element in the sequence.
std::size_t number_of_alternations () const
 The number of alternations found.
bool is_uncertain () const
 Return true if an interval with unknown sign could have changed the number of alternations.
bool parity_uncertain () const
 Return true if an interval with unknown sign could have changed the parity of the alternations.

Protected Attributes

std::size_t num_alternations_
Extended_sign last_sign_
bool count_uncertain_
bool parity_uncertain_
bool last_was_uncertain_

Detailed Description

template<class NT>
class Alternation_counter< NT >

Count the number of alternations in a sequence of NTs.

The extended_sign function is used to support interval arithmetic (where the sign can be uncertain).


Constructor & Destructor Documentation

template<class NT >
Alternation_counter< NT >::Alternation_counter ( ) [inline]

Member Function Documentation

template<class NT >
bool Alternation_counter< NT >::is_uncertain ( ) const [inline]

Return true if an interval with unknown sign could have changed the number of alternations.

template<class NT >
std::size_t Alternation_counter< NT >::number_of_alternations ( ) const [inline]

The number of alternations found.

Note, this may not be correct (if intervals are used). It is the number found.

template<class NT >
bool Alternation_counter< NT >::parity_uncertain ( ) const [inline]

Return true if an interval with unknown sign could have changed the parity of the alternations.

template<class NT >
void Alternation_counter< NT >::push_back ( const NT &  i) [inline]

Add the next element in the sequence.

Here is the call graph for this function:


Member Data Documentation

template<class NT >
bool Alternation_counter< NT >::count_uncertain_ [protected]
template<class NT >
Extended_sign Alternation_counter< NT >::last_sign_ [protected]
template<class NT >
bool Alternation_counter< NT >::last_was_uncertain_ [protected]
template<class NT >
std::size_t Alternation_counter< NT >::num_alternations_ [protected]
template<class NT >
bool Alternation_counter< NT >::parity_uncertain_ [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines