LocARNA-2.0.0
Public Types | Public Member Functions | List of all members
LocARNA::Alphabet< T, N > Class Template Reference

Specifies an alphabet of static size. More...

#include <alphabet.hh>

Inheritance diagram for LocARNA::Alphabet< T, N >:
Inheritance graph
[legend]
Collaboration diagram for LocARNA::Alphabet< T, N >:
Collaboration graph
[legend]

Public Types

using value_type = T
 type of an alphabet element
 
using size_type = typename std::array< T, N >::size_type
 inherited size_type
 

Public Member Functions

 Alphabet ()
 construct empty
 
 Alphabet (const std::array< T, N > &a)
 construct from array of alphabet elements
 
 Alphabet (const std::vector< T > &v)
 construct from vector
 
 Alphabet (const std::string &s)
 construct from string (only T=char)
 
Alphabet< T, N > & operator= (const std::array< T, N > &a)
 
size_type idx (const value_type &x) const
 index of alphabet element More...
 
bool in (const value_type &x) const
 test alphabet element membership More...
 

Detailed Description

template<class T, std::size_t N>
class LocARNA::Alphabet< T, N >

Specifies an alphabet of static size.

maintain an alphabet and offer efficient transformation between elements of alphabet and their indices

Member Function Documentation

◆ idx()

template<class T , std::size_t N>
size_type LocARNA::Alphabet< T, N >::idx ( const value_type x) const

index of alphabet element

Parameters
xelement of the alphabet
Returns
index
Note
the result is undefined if !in(x)

◆ in()

template<class T , std::size_t N>
bool LocARNA::Alphabet< T, N >::in ( const value_type x) const

test alphabet element membership

Parameters
xelement of the alphabet
Returns
true, if x is element of the alphabet

The documentation for this class was generated from the following file: