1 #ifndef LOCARNA_ALPHABET_HH 2 #define LOCARNA_ALPHABET_HH 24 typedef std::vector<T> vec_t;
28 typedef std::map<T,size_type> hash_t;
38 typedef typename elem_vector_type::iterator
iterator;
51 Alphabet(
const elem_type *s,
int len);
54 size_type
size()
const;
57 size_type
idx(
const elem_type &
elem)
const;
69 in(
const elem_type &
elem)
const;
72 const_iterator
begin()
const {
return alph_vec.begin();}
75 const_iterator
end()
const {
return alph_vec.end();}
78 iterator
begin() {
return alph_vec.begin();}
81 iterator
end() {
return alph_vec.end();}
85 void init(
const vec_t &a);
97 std::ostream & operator << (std::ostream &out,Alphabet<T> a);
101 # include "alphabet.icc" 103 #endif // LOCARNA_ALPHABET_HH size_type index_type
type of index
Definition: alphabet.hh:33
elem_vector_type::iterator iterator
iterator over alphabet elements
Definition: alphabet.hh:38
Definition: aligner.cc:17
vec_t::size_type size_type
size type
Definition: alphabet.hh:26
const_iterator begin() const
begin for const iteration over elements
Definition: alphabet.hh:72
T elem_type
type of an alphabet element
Definition: alphabet.hh:34
iterator begin()
begin for iteration over elements
Definition: alphabet.hh:78
Specifies an alphabet.
Definition: alphabet.hh:23
std::vector< T > elem_vector_type
vector of elements
Definition: alphabet.hh:35
size_type size() const
get alphabet size
const elem_type & elem(size_type idx) const
convert index to element
const_iterator end() const
end for const iteration over elements
Definition: alphabet.hh:75
elem_vector_type::const_iterator const_iterator
const iterator over alphabet elements
Definition: alphabet.hh:41
bool in(const elem_type &elem) const
test membership in alphabet
iterator end()
end for iteration over elements
Definition: alphabet.hh:81
Alphabet()
construct empty
size_type idx(const elem_type &elem) const
convert element to index