SparseVector Class Reference

#include <FeatureStats.h>

List of all members.

Public Types

typedef std::map< std::size_t,
typedef std::map< std::string,
std::size_t > 
typedef std::vector< std::string > id2name_t

Public Member Functions

FeatureStatsType get (const std::string &name) const
FeatureStatsType get (std::size_t id) const
void set (const std::string &name, FeatureStatsType value)
void clear ()
std::size_t size () const
void write (std::ostream &out, const std::string &sep=" ") const
SparseVectoroperator-= (const SparseVector &rhs)
std::vector< std::size_t > feats () const

Static Public Member Functions

static std::size_t encode (const std::string &feat)
static std::string decode (std::size_t feat)


bool operator== (SparseVector const &item1, SparseVector const &item2)
std::size_t hash_value (SparseVector const &item)

Detailed Description

Definition at line 20 of file FeatureStats.h.

Member Typedef Documentation

typedef std::map<std::size_t,FeatureStatsType> SparseVector::fvector_t

Definition at line 22 of file FeatureStats.h.

typedef std::vector<std::string> SparseVector::id2name_t

Definition at line 24 of file FeatureStats.h.

typedef std::map<std::string, std::size_t> SparseVector::name2id_t

Definition at line 23 of file FeatureStats.h.

Member Function Documentation

void SparseVector::clear (  ) 

Definition at line 60 of file FeatureStats.cpp.

Referenced by FeatureStats::clear().

Here is the caller graph for this function:

std::string SparseVector::decode ( std::size_t  feat  )  [static]

Definition at line 109 of file FeatureStats.cpp.

Referenced by main().

Here is the caller graph for this function:

std::size_t SparseVector::encode ( const std::string &  feat  )  [static]

Definition at line 96 of file FeatureStats.cpp.

Referenced by main().

Here is the caller graph for this function:

std::vector< std::size_t > SparseVector::feats (  )  const

Definition at line 86 of file FeatureStats.cpp.

Referenced by MiraFeatureVector::MiraFeatureVector().

Here is the caller graph for this function:

FeatureStatsType SparseVector::get ( std::size_t  id  )  const

FeatureStatsType SparseVector::get ( const std::string &  name  )  const

Referenced by MiraFeatureVector::MiraFeatureVector(), and operator-=().

Here is the caller graph for this function:

SparseVector & SparseVector::operator-= ( const SparseVector rhs  ) 

Definition at line 64 of file FeatureStats.cpp.

References get().

Here is the call graph for this function:

void SparseVector::set ( const std::string &  name,
FeatureStatsType  value 

std::size_t SparseVector::size (  )  const [inline]

Definition at line 30 of file FeatureStats.h.

void SparseVector::write ( std::ostream &  out,
const std::string &  sep = " " 
) const

Referenced by operator<<().

Here is the caller graph for this function:

Friends And Related Function Documentation

std::size_t hash_value ( SparseVector const &  item  )  [friend]

Definition at line 117 of file FeatureStats.cpp.

bool operator== ( SparseVector const &  item1,
SparseVector const &  item2 
) [friend]

Definition at line 113 of file FeatureStats.cpp.

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

Generated on Sat Jun 30 00:30:12 2012 for Moses by  doxygen 1.5.9