#pragma once #include #include #include "../Utils/types.h" namespace Distribution { template class Cycle { private: std::vector> Arcs; std::vector wArcs; std::vector attrArcs; std::vector compressedInfo; static bool comparator(std::pair left, std::pair right) { return left.first < right.first; } public: int GetNumArcs() const { return (int)Arcs.size(); } const std::vector>& GetArcs() const { return Arcs; } const std::vector& GetWeigthsArcs() const { return wArcs; } const std::vector& GetAttributesArcs() const { return attrArcs; } void AddArc(const std::pair &newAcr, const wType wArc, const attrType &attrArc, const unsigned info); void AddArc(const std::pair &newAcr, const std::pair ¶mArc, const unsigned info); void AddArc(const vType V1, const vType V2, const std::pair ¶mArc, const unsigned info); void AddArc(const vType V1, const vType V2, const wType wArc, const attrType &attrArc, const unsigned info); wType GetCycleSum() const; void SortArcs(); // sort as maximum bool operator<(const Cycle &right) const; void PrintValue() const; void PrintArcs() const; const std::vector& GetShortInfo() const { return compressedInfo; } unsigned getFullSize() { unsigned fullSize = 0; fullSize += (int)Arcs.capacity() * sizeof(vType) * 2; fullSize += (int)wArcs.capacity() * sizeof(wType); fullSize += (int)attrArcs.capacity() * sizeof(attrArcs); fullSize += (int)compressedInfo.capacity(); return fullSize; } }; }