1 #ifndef ALGO_COBALT___LINKS__HPP
2 #define ALGO_COBALT___LINKS__HPP
78 : m_NumElements(num_elements),
103 bool IsLink(
int first,
int second)
const;
114 bool IsLink(
const vector<int>&
first,
const vector<int>& second,
159 void x_InitLinkPtrs(
void);
166 bool x_IsLinkPtr(
int first,
int second)
const;
Exceptions for CLinks class.
@ eInvalidNode
Invalid node index.
NCBI_EXCEPTION_DEFAULT(CLinksException, CException)
Set of edges with weights between nodes represented by zero-based positive integers.
double m_MaxWeight
Maximym weight in the list.
CLinks & operator=(const CLinks &links)
Forbid assignment operator.
vector< SLink * > m_LinkPtrs
Pointers to links in m_Links sorted according to node indexes; used for checks whether a link exists.
list< SLink > m_Links
Links.
CLinks(Uint4 num_elements)
Constructor.
Uint4 GetNumElements(void) const
Get number of nodes.
Uint4 m_NumElements
Number of nodes.
bool m_IsSorted
Is list of links sorted.
list< SLink >::const_iterator SLink_CI
SLink_CI begin(void) const
Get iterator pointing to the first link.
SLink_CI end(void) const
Get iterator pointing behind the last link.
bool IsSorted(void) const
Check whether the links are sorted according to weights.
CLinks(const CLinks &links)
Forbid copy constructor.
Uint4 GetNumLinks(void) const
Get number of links.
Uint4 m_NumLinks
Number of links.
double GetMaxWeight(void) const
Get maximum weight over all links.
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
uint32_t Uint4
4-byte (32-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
#define NCBI_COBALT_EXPORT
Compressed bitset (entry point to bm.h)
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
double weight
Edge weight.
SLink(int f, int s, double w)
Constructor.
bool operator<(const SLink &link) const
Less then operator for sorting links by weights.