NCBI C++ ToolKit
|
Search Toolkit Book for CScoreVector
#include <algo/text/vector.hpp>
Public Types | |
typedef Key | key_type |
typedef Score | score_type |
typedef map< Key, Score > | TVector |
typedef TVector::value_type | value_type |
typedef TVector::iterator | iterator |
typedef TVector::const_iterator | const_iterator |
![]() | |
enum | EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern } |
Control filling of newly allocated memory. More... | |
typedef CObjectCounterLocker | TLockerType |
Default locker type for CRef. More... | |
typedef atomic< Uint8 > | TCounter |
Counter type is CAtomiCounter. More... | |
typedef Uint8 | TCount |
Alias for value type of counter. More... | |
Public Member Functions | |
CScoreVector () | |
virtual | ~CScoreVector () |
CScoreVector (const CScoreVector< Key, Score > &other) | |
CScoreVector (const CRawScoreVector< Key, Score > &other) | |
CScoreVector & | operator= (const CScoreVector< Key, Score > &other) |
CScoreVector & | operator= (const CRawScoreVector< Key, Score > &other) |
virtual void | Swap (CScoreVector< Key, Score > &other) |
key_type | GetId () const |
setup functions More... | |
void | SetId (key_type uid) |
size_t | GetSize () const |
Score | Get (Key idx) const |
void | Set (Key idx, Score weight) |
void | Add (Key idx, Score weight=Score(1)) |
void | TrimLength (float trim_pct) |
void | TrimCount (size_t max_words) |
void | TrimThresh (Score min_score) |
void | SubtractMissing (const CScoreVector< Key, Score > &other) |
void | AddScores (const CScoreVector< Key, Score > &other) |
float | Length2 () const |
math functions More... | |
float | Length () const |
void | Normalize () |
void | ProbNormalize () |
CScoreVector< Key, Score > & | operator+= (const CScoreVector< Key, Score > &other) |
CScoreVector< Key, Score > & | operator-= (const CScoreVector< Key, Score > &other) |
CScoreVector< Key, Score > & | operator*= (Score val) |
CScoreVector< Key, Score > & | operator/= (Score val) |
TVector & | Set () |
const TVector & | Get () const |
STL-ish functions | |
void | clear () |
bool | empty () const |
size_t | size () const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
iterator | find (const Key &key) |
const_iterator | find (const Key &key) const |
pair< iterator, bool > | insert (const value_type &val) |
iterator | insert (iterator hint, const value_type &val) |
void | erase (iterator it) |
void | erase (const key_type &v) |
template<typename OtherIterator > | |
void | insert (OtherIterator it_begin, OtherIterator it_end) |
![]() | |
CObject (void) | |
Constructor. More... | |
CObject (const CObject &src) | |
Copy constructor. More... | |
virtual | ~CObject (void) |
Destructor. More... | |
CObject & | operator= (const CObject &src) THROWS_NONE |
Assignment operator. More... | |
bool | CanBeDeleted (void) const THROWS_NONE |
Check if object can be deleted. More... | |
bool | IsAllocatedInPool (void) const THROWS_NONE |
Check if object is allocated in memory pool (not system heap) More... | |
bool | Referenced (void) const THROWS_NONE |
Check if object is referenced. More... | |
bool | ReferencedOnlyOnce (void) const THROWS_NONE |
Check if object is referenced only once. More... | |
void | AddReference (void) const |
Add reference to object. More... | |
void | RemoveReference (void) const |
Remove reference to object. More... | |
void | ReleaseReference (void) const |
Remove reference without deleting object. More... | |
virtual void | DoNotDeleteThisObject (void) |
Mark this object as not allocated in heap – do not delete this object. More... | |
virtual void | DoDeleteThisObject (void) |
Mark this object as allocated in heap – object can be deleted. More... | |
void * | operator new (size_t size) |
Define new operator for memory allocation. More... | |
void * | operator new[] (size_t size) |
Define new[] operator for 'array' memory allocation. More... | |
void | operator delete (void *ptr) |
Define delete operator for memory deallocation. More... | |
void | operator delete[] (void *ptr) |
Define delete[] operator for memory deallocation. More... | |
void * | operator new (size_t size, void *place) |
Define new operator. More... | |
void | operator delete (void *ptr, void *place) |
Define delete operator. More... | |
void * | operator new (size_t size, CObjectMemoryPool *place) |
Define new operator using memory pool. More... | |
void | operator delete (void *ptr, CObjectMemoryPool *place) |
Define delete operator. More... | |
virtual void | DebugDump (CDebugDumpContext ddc, unsigned int depth) const |
Define method for dumping debug information. More... | |
![]() | |
CDebugDumpable (void) | |
virtual | ~CDebugDumpable (void) |
void | DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const |
void | DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const |
void | DumpToConsole (void) const |
Protected Attributes | |
key_type | m_Uid |
UID for this set. More... | |
TVector | m_Data |
the data for this document More... | |
Additional Inherited Members | |
![]() | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (void) |
Define method to throw null pointer exception. More... | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (const type_info &type) |
static EAllocFillMode | GetAllocFillMode (void) |
static void | SetAllocFillMode (EAllocFillMode mode) |
static void | SetAllocFillMode (const string &value) |
Set mode from configuration parameter value. More... | |
![]() | |
static void | EnableDebugDump (bool on) |
![]() | |
static const TCount | eCounterBitsCanBeDeleted = 1 << 0 |
Define possible object states. More... | |
static const TCount | eCounterBitsInPlainHeap = 1 << 1 |
Heap signature was found. More... | |
static const TCount | eCounterBitsPlaceMask |
Mask for 'in heap' state flags. More... | |
static const int | eCounterStep = 1 << 2 |
Skip over the "in heap" bits. More... | |
static const TCount | eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2) |
Minimal value for valid objects (reference counter is zero) Must be a single bit value. More... | |
static const TCount | eCounterStateMask |
Valid object, and object in heap. More... | |
![]() | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Definition at line 146 of file vector.hpp.
typedef TVector::const_iterator CScoreVector< Key, Score >::const_iterator |
Definition at line 154 of file vector.hpp.
typedef TVector::iterator CScoreVector< Key, Score >::iterator |
Definition at line 153 of file vector.hpp.
typedef Key CScoreVector< Key, Score >::key_type |
Definition at line 149 of file vector.hpp.
typedef Score CScoreVector< Key, Score >::score_type |
Definition at line 150 of file vector.hpp.
typedef map<Key, Score> CScoreVector< Key, Score >::TVector |
Definition at line 151 of file vector.hpp.
typedef TVector::value_type CScoreVector< Key, Score >::value_type |
Definition at line 152 of file vector.hpp.
|
inline |
Definition at line 658 of file vector_impl.hpp.
References InitialValue(), and CScoreVector< Key, Score >::m_Uid.
|
inlinevirtual |
Definition at line 157 of file vector.hpp.
|
inline |
Definition at line 667 of file vector_impl.hpp.
|
inline |
Definition at line 676 of file vector_impl.hpp.
|
inline |
Definition at line 909 of file vector_impl.hpp.
References weight.
Referenced by CTextUtil::AddWordFrequencies(), CTextUtil::GetWordFrequencies(), and s_NumericToFreq().
|
inline |
Definition at line 1156 of file vector_impl.hpp.
References CScoreVector< Key, Score >::begin(), and CScoreVector< Key, Score >::end().
|
inline |
Definition at line 735 of file vector_impl.hpp.
Referenced by CScoreVector< Key, Score >::AddScores(), CScoreVector< Key, Score >::operator+=(), CScoreVector< Key, Score >::SubtractMissing(), and CTextUtil::TrimStopWords().
|
inline |
Definition at line 751 of file vector_impl.hpp.
|
inline |
Definition at line 803 of file vector_impl.hpp.
References InitialValue().
Referenced by Deserialize< string, float >(), and CScoreVector< Key, Score >::operator=().
|
inline |
Definition at line 828 of file vector_impl.hpp.
|
inline |
Definition at line 743 of file vector_impl.hpp.
Referenced by CScoreVector< Key, Score >::AddScores(), Deserialize< string, float >(), CTextUtil::GetStemFrequencies(), CScoreVector< Key, Score >::operator+=(), CTextUtil::SplitWordFrequencies(), CScoreVector< Key, Score >::SubtractMissing(), and CTextUtil::TrimStopWords().
|
inline |
Definition at line 759 of file vector_impl.hpp.
|
inline |
Definition at line 820 of file vector_impl.hpp.
References ncbi::grid::netcache::search::fields::key.
|
inline |
Definition at line 812 of file vector_impl.hpp.
Referenced by CTextUtil::TrimStopWords().
|
inline |
Definition at line 777 of file vector_impl.hpp.
References ncbi::grid::netcache::search::fields::key.
Referenced by CTextUtil::GetStemFrequencies().
|
inline |
Definition at line 768 of file vector_impl.hpp.
References ncbi::grid::netcache::search::fields::key.
|
inline |
Definition at line 221 of file vector.hpp.
References CScoreVector< Key, Score >::m_Data.
|
inline |
Definition at line 847 of file vector_impl.hpp.
References map_checker< Container >::find().
|
inline |
setup functions
Definition at line 711 of file vector_impl.hpp.
Referenced by CRawScoreVector< Key, Score >::operator=().
|
inline |
Definition at line 195 of file vector.hpp.
References CScoreVector< Key, Score >::m_Data, and map_checker< Container >::size().
|
inline |
Definition at line 795 of file vector_impl.hpp.
Referenced by Deserialize< string, float >(), CTextUtil::GetStemFrequencies(), and CTextUtil::SplitWordFrequencies().
|
inline |
Definition at line 786 of file vector_impl.hpp.
|
inline |
Definition at line 183 of file vector.hpp.
References map_checker< Container >::insert(), and CScoreVector< Key, Score >::m_Data.
|
inline |
Definition at line 939 of file vector_impl.hpp.
|
inline |
|
inline |
Definition at line 873 of file vector_impl.hpp.
References ITERATE, and NON_CONST_ITERATE.
|
inline |
Definition at line 947 of file vector_impl.hpp.
References NON_CONST_ITERATE, and val.
|
inline |
Definition at line 970 of file vector_impl.hpp.
References CScoreVector< Key, Score >::begin(), and CScoreVector< Key, Score >::end().
|
inline |
Definition at line 1003 of file vector_impl.hpp.
References map_checker< Container >::begin(), map_checker< Container >::end(), CScoreVector< Key, Score >::m_Data, and val.
|
inline |
Definition at line 958 of file vector_impl.hpp.
References NON_CONST_ITERATE, and val.
|
inline |
Definition at line 697 of file vector_impl.hpp.
References CScoreVector< Key, Score >::clear(), CRawScoreVector< Key, Score >::GetId(), and ITERATE.
|
inline |
Definition at line 685 of file vector_impl.hpp.
References CScoreVector< Key, Score >::m_Data, and CScoreVector< Key, Score >::m_Uid.
|
inline |
Definition at line 891 of file vector_impl.hpp.
References NON_CONST_ITERATE.
|
inline |
Definition at line 220 of file vector.hpp.
References CScoreVector< Key, Score >::m_Data.
|
inline |
Definition at line 860 of file vector_impl.hpp.
References map_checker< Container >::find(), and weight.
|
inline |
Definition at line 719 of file vector_impl.hpp.
|
inline |
Definition at line 727 of file vector_impl.hpp.
Referenced by CRawScoreVector< Key, Score >::operator=().
|
inline |
Definition at line 1122 of file vector_impl.hpp.
References CScoreVector< Key, Score >::begin(), and CScoreVector< Key, Score >::end().
|
inlinevirtual |
Definition at line 836 of file vector_impl.hpp.
References CScoreVector< Key, Score >::m_Data, CScoreVector< Key, Score >::m_Uid, and swap().
|
inline |
Definition at line 1077 of file vector_impl.hpp.
References Get(), NON_CONST_ITERATE, prev(), ncbi::grid::netcache::search::fields::size, and ct::sort().
|
inline |
Definition at line 1037 of file vector_impl.hpp.
References Get(), NON_CONST_ITERATE, prev(), ncbi::grid::netcache::search::fields::size, and ct::sort().
|
inline |
Definition at line 1105 of file vector_impl.hpp.
|
protected |
the data for this document
Definition at line 228 of file vector.hpp.
Referenced by CScoreVector< Key, Score >::Get(), CScoreVector< Key, Score >::GetSize(), CScoreVector< Key, Score >::insert(), CScoreVector< Key, Score >::operator-=(), CScoreVector< Key, Score >::operator=(), CScoreVector< Key, Score >::Set(), and CScoreVector< Key, Score >::Swap().
|
protected |
UID for this set.
Definition at line 225 of file vector.hpp.
Referenced by CScoreVector< Key, Score >::CScoreVector(), CScoreVector< Key, Score >::operator=(), and CScoreVector< Key, Score >::Swap().