FST  openfst-1.8.3
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 53 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 60 of file sparse-tuple-weight.h.

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

Definition at line 57 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 58 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 55 of file sparse-tuple-weight.h.

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

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

Constructor & Destructor Documentation

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

Definition at line 64 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 69 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 77 of file sparse-tuple-weight.h.

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

Definition at line 81 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 83 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 91 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 234 of file sparse-tuple-weight.h.

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

Definition at line 160 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 186 of file sparse-tuple-weight.h.

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

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

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

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

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

Definition at line 107 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 129 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 138 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 201 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 206 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 170 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 117 of file sparse-tuple-weight.h.

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

Definition at line 178 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 232 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 224 of file sparse-tuple-weight.h.

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

Definition at line 193 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 216 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 123 of file sparse-tuple-weight.h.

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

Definition at line 102 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 287 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 62 of file sparse-tuple-weight.h.


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