FST  openfst-1.7.1
OpenFst Library
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
fst::SparseTupleWeight< W, K > Class Template Reference

#include <sparse-tuple-weight.h>

Inheritance diagram for fst::SparseTupleWeight< W, K >:
Inheritance graph
[legend]
Collaboration diagram for fst::SparseTupleWeight< W, K >:
Collaboration graph
[legend]

Public Types

using ReverseWeight = SparseTupleWeight< typename W::ReverseWeight, K >
 
using Iterator = SparseTupleWeightIterator< W, K >
 
using Pair = std::pair< K, W >
 
using Weight = W
 
using Index = K
 

Public Member Functions

 SparseTupleWeight ()
 
 ~SparseTupleWeight () noexcept=default
 
template<class Iterator >
 SparseTupleWeight (Iterator begin, Iterator end)
 
 SparseTupleWeight (const K &key, const W &weight, const W &default_weight)
 
 SparseTupleWeight (const W &weight)
 
 SparseTupleWeight (const SparseTupleWeight &weight)
 
 SparseTupleWeight (SparseTupleWeight &&weight) noexcept
 
std::istream & Read (std::istream &strm)
 
std::ostream & Write (std::ostream &strm) const
 
SparseTupleWeightoperator= (const SparseTupleWeight &weight)
 
SparseTupleWeightoperator= (SparseTupleWeight &&weight) noexcept
 
bool Member () const
 
size_t Hash () const
 
SparseTupleWeight Quantize (float delta=kDelta) const
 
ReverseWeight Reverse () const
 
void Init (const W &default_value=W::Zero())
 
size_t Size () const
 
void PushBack (const K &key, const W &weight, bool default_value_check=true)
 
void PushBack (const Pair &pair, bool default_value_check=true)
 
const W & Value (const K &key) const
 
void SetValue (const K &key, const W &w)
 
void SetDefaultValue (const W &value)
 
const W & DefaultValue () const
 

Static Public Member Functions

static const SparseTupleWeightZero ()
 
static const SparseTupleWeightOne ()
 
static const SparseTupleWeightNoWeight ()
 

Static Public Attributes

static constexpr K kNoKey = -1
 

Friends

class SparseTupleWeightIterator< W, K >
 

Detailed Description

template<class W, class K = int>
class fst::SparseTupleWeight< W, K >

Definition at line 37 of file sparse-tuple-weight.h.

Member Typedef Documentation

template<class W, class K = int>
using fst::SparseTupleWeight< W, K >::Index = K

Definition at line 44 of file sparse-tuple-weight.h.

template<class W, class K = int>
using fst::SparseTupleWeight< W, K >::Iterator = SparseTupleWeightIterator<W, K>

Definition at line 41 of file sparse-tuple-weight.h.

template<class W, class K = int>
using fst::SparseTupleWeight< W, K >::Pair = std::pair<K, W>

Definition at line 42 of file sparse-tuple-weight.h.

template<class W, class K = int>
using fst::SparseTupleWeight< W, K >::ReverseWeight = SparseTupleWeight<typename W::ReverseWeight, K>

Definition at line 39 of file sparse-tuple-weight.h.

template<class W, class K = int>
using fst::SparseTupleWeight< W, K >::Weight = W

Definition at line 43 of file sparse-tuple-weight.h.

Constructor & Destructor Documentation

template<class W, class K = int>
fst::SparseTupleWeight< W, K >::SparseTupleWeight ( )
inline

Definition at line 48 of file sparse-tuple-weight.h.

template<class W, class K = int>
fst::SparseTupleWeight< W, K >::~SparseTupleWeight ( )
defaultnoexcept
template<class W, class K = int>
template<class Iterator >
fst::SparseTupleWeight< W, K >::SparseTupleWeight ( Iterator  begin,
Iterator  end 
)
inline

Definition at line 53 of file sparse-tuple-weight.h.

template<class W, class K = int>
fst::SparseTupleWeight< W, K >::SparseTupleWeight ( const K &  key,
const W &  weight,
const W &  default_weight 
)
inline

Definition at line 61 of file sparse-tuple-weight.h.

template<class W, class K = int>
fst::SparseTupleWeight< W, K >::SparseTupleWeight ( const W &  weight)
inlineexplicit

Definition at line 65 of file sparse-tuple-weight.h.

template<class W, class K = int>
fst::SparseTupleWeight< W, K >::SparseTupleWeight ( const SparseTupleWeight< W, K > &  weight)
inline

Definition at line 67 of file sparse-tuple-weight.h.

template<class W, class K = int>
fst::SparseTupleWeight< W, K >::SparseTupleWeight ( SparseTupleWeight< W, K > &&  weight)
inlinenoexcept

Definition at line 75 of file sparse-tuple-weight.h.

Member Function Documentation

template<class W, class K = int>
const W& fst::SparseTupleWeight< W, K >::DefaultValue ( ) const
inline

Definition at line 218 of file sparse-tuple-weight.h.

template<class W, class K = int>
size_t fst::SparseTupleWeight< W, K >::Hash ( ) const
inline

Definition at line 144 of file sparse-tuple-weight.h.

template<class W, class K = int>
void fst::SparseTupleWeight< W, K >::Init ( const W &  default_value = W::Zero())
inline

Definition at line 170 of file sparse-tuple-weight.h.

template<class W, class K = int>
bool fst::SparseTupleWeight< W, K >::Member ( ) const
inline

Definition at line 135 of file sparse-tuple-weight.h.

template<class W, class K = int>
static const SparseTupleWeight& fst::SparseTupleWeight< W, K >::NoWeight ( )
inlinestatic

Definition at line 96 of file sparse-tuple-weight.h.

template<class W, class K = int>
static const SparseTupleWeight& fst::SparseTupleWeight< W, K >::One ( )
inlinestatic

Definition at line 91 of file sparse-tuple-weight.h.

template<class W, class K = int>
SparseTupleWeight& fst::SparseTupleWeight< W, K >::operator= ( const SparseTupleWeight< W, K > &  weight)
inline

Definition at line 113 of file sparse-tuple-weight.h.

template<class W, class K = int>
SparseTupleWeight& fst::SparseTupleWeight< W, K >::operator= ( SparseTupleWeight< W, K > &&  weight)
inlinenoexcept

Definition at line 122 of file sparse-tuple-weight.h.

template<class W, class K = int>
void fst::SparseTupleWeight< W, K >::PushBack ( const K &  key,
const W &  weight,
bool  default_value_check = true 
)
inline

Definition at line 185 of file sparse-tuple-weight.h.

template<class W, class K = int>
void fst::SparseTupleWeight< W, K >::PushBack ( const Pair pair,
bool  default_value_check = true 
)
inline

Definition at line 190 of file sparse-tuple-weight.h.

template<class W, class K = int>
SparseTupleWeight fst::SparseTupleWeight< W, K >::Quantize ( float  delta = kDelta) const
inline

Definition at line 154 of file sparse-tuple-weight.h.

template<class W, class K = int>
std::istream& fst::SparseTupleWeight< W, K >::Read ( std::istream &  strm)
inline

Definition at line 101 of file sparse-tuple-weight.h.

template<class W, class K = int>
ReverseWeight fst::SparseTupleWeight< W, K >::Reverse ( ) const
inline

Definition at line 162 of file sparse-tuple-weight.h.

template<class W, class K = int>
void fst::SparseTupleWeight< W, K >::SetDefaultValue ( const W &  value)
inline

Definition at line 216 of file sparse-tuple-weight.h.

template<class W, class K = int>
void fst::SparseTupleWeight< W, K >::SetValue ( const K &  key,
const W &  w 
)
inline

Definition at line 208 of file sparse-tuple-weight.h.

template<class W, class K = int>
size_t fst::SparseTupleWeight< W, K >::Size ( ) const
inline

Definition at line 177 of file sparse-tuple-weight.h.

template<class W, class K = int>
const W& fst::SparseTupleWeight< W, K >::Value ( const K &  key) const
inline

Definition at line 200 of file sparse-tuple-weight.h.

template<class W, class K = int>
std::ostream& fst::SparseTupleWeight< W, K >::Write ( std::ostream &  strm) const
inline

Definition at line 107 of file sparse-tuple-weight.h.

template<class W, class K = int>
static const SparseTupleWeight& fst::SparseTupleWeight< W, K >::Zero ( )
inlinestatic

Definition at line 86 of file sparse-tuple-weight.h.

Friends And Related Function Documentation

template<class W, class K = int>
friend class SparseTupleWeightIterator< W, K >
friend

Definition at line 271 of file sparse-tuple-weight.h.

Member Data Documentation

template<class W, class K = int>
constexpr K fst::SparseTupleWeight< W, K >::kNoKey = -1
static

Definition at line 46 of file sparse-tuple-weight.h.


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