SNAP Library , Developer Reference
2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <ds.h>
Public Types | |
typedef TVal * | TIter |
Public Member Functions | |
TVec () | |
TVec (const TVec &Vec) | |
TVec (const int &_Vals) | |
TVec (const int &_MxVals, const int &_Vals) | |
TVec (TVal *_ValT, const int &_Vals) | |
~TVec () | |
TVec (TSIn &SIn) | |
void | Load (TSIn &SIn) |
void | Save (TSOut &SOut) const |
void | LoadXml (const PXmlTok &XmlTok, const TStr &Nm="") |
void | SaveXml (TSOut &SOut, const TStr &Nm) const |
TVec< TVal > & | operator= (const TVec< TVal > &Vec) |
TVec< TVal > & | operator+ (const TVal &Val) |
bool | operator== (const TVec< TVal > &Vec) const |
bool | operator< (const TVec< TVal > &Vec) const |
const TVal & | operator[] (const int &ValN) const |
TVal & | operator[] (const int &ValN) |
int | GetMemUsed () const |
int | GetPrimHashCd () const |
int | GetSecHashCd () const |
void | Gen (const int &_Vals) |
void | Gen (const int &_MxVals, const int &_Vals) |
void | GenExt (TVal *_ValT, const int &_Vals) |
bool | IsExt () const |
void | Reserve (const int &_MxVals) |
void | Reserve (const int &_MxVals, const int &_Vals) |
void | Clr (const bool &DoDel=true, const int &NoDelLim=-1) |
void | Trunc (const int &_Vals=-1) |
void | Pack () |
void | MoveFrom (TVec< TVal > &Vec) |
void | Swap (TVec< TVal > &Vec) |
bool | Empty () const |
int | Len () const |
int | Reserved () const |
const TVal & | Last () const |
TVal & | Last () |
int | LastValN () const |
const TVal & | LastLast () const |
TVal & | LastLast () |
TIter | BegI () const |
TIter | EndI () const |
TIter | GetI (const int &ValN) const |
int | Add () |
int | Add (const TVal &Val) |
int | Add (const TVal &Val, const int &ResizeLen) |
int | AddV (const TVec< TVal > &ValV) |
int | AddSorted (const TVal &Val, const bool &Asc=true, const int &_MxVals=-1) |
int | AddBackSorted (const TVal &Val, const bool &Asc) |
int | AddMerged (const TVal &Val) |
int | AddVMerged (const TVec< TVal > &ValV) |
int | AddUnique (const TVal &Val) |
const TVal & | GetVal (const int &ValN) const |
TVal & | GetVal (const int &ValN) |
void | GetSubValV (const int &BValN, const int &EValN, TVec< TVal > &ValV) const |
void | Ins (const int &ValN, const TVal &Val) |
void | Del (const int &ValN) |
void | Del (const int &MnValN, const int &MxValN) |
void | DelLast () |
bool | DelIfIn (const TVal &Val) |
void | DelAll (const TVal &Val) |
void | PutAll (const TVal &Val) |
void | Swap (const int &ValN1, const int &ValN2) |
int | GetPivotValN (const int &LValN, const int &RValN) const |
void | BSort (const int &MnLValN, const int &MxRValN, const bool &Asc) |
void | ISort (const int &MnLValN, const int &MxRValN, const bool &Asc) |
int | Partition (const int &MnLValN, const int &MxRValN, const bool &Asc) |
void | QSort (const int &MnLValN, const int &MxRValN, const bool &Asc) |
void | Sort (const bool &Asc=true) |
bool | IsSorted (const bool &Asc=true) const |
void | Shuffle (TRnd &Rnd) |
void | Reverse () |
void | Reverse (int First, int Last) |
void | Merge () |
bool | NextPerm () |
bool | PrevPerm () |
void | MakeHeap () |
void | PushHeap (const TVal &Val) |
const TVal & | TopHeap () const |
TVal | PopHeap () |
template<class TCmp > | |
void | MakeHeap (const TCmp &Cmp) |
template<class TCmp > | |
void | PushHeap (const TVal &Val, const TCmp &Cmp) |
template<class TCmp > | |
TVal | PopHeap (const TCmp &Cmp) |
template<class TCmp > | |
void | PushHeap (const int &First, int HoleIdx, const int &Top, TVal Val, const TCmp &Cmp) |
template<class TCmp > | |
void | AdjustHeap (const int &First, int HoleIdx, const int &Len, TVal Val, const TCmp &Cmp) |
template<class TCmp > | |
void | MakeHeap (const int &First, const int &Len, const TCmp &Cmp) |
template<class TCmp > | |
void | SortCmp (const TCmp &Cmp) |
template<class TCmp > | |
bool | IsSortedCmp (const TCmp &Cmp) const |
void | Intrs (const TVec< TVal > &ValV) |
void | Union (const TVec< TVal > &ValV) |
void | Diff (const TVec< TVal > &ValV) |
void | Minus (const TVec< TVal > &ValV) |
void | Intrs (const TVec< TVal > &ValV, TVec< TVal > &DstValV) const |
void | Union (const TVec< TVal > &ValV, TVec< TVal > &DstValV) const |
void | Diff (const TVec< TVal > &ValV, TVec< TVal > &DstValV) const |
int | IntrsLen (const TVec< TVal > &ValV) const |
Get the size of the intersection (number of common elements) of two vectors. Method assumes both vectors are sorted in ascending order! | |
void | Minus (const TVec< TVal > &ValV, TVec< TVal > &DstValV) const |
int | Count (const TVal &Val) const |
int | SearchBin (const TVal &Val) const |
int | SearchBin (const TVal &Val, int &InsValN) const |
int | SearchForw (const TVal &Val, const int &BValN=0) const |
int | SearchBack (const TVal &Val) const |
int | SearchVForw (const TVec< TVal > &ValV, const int &BValN=0) const |
bool | IsIn (const TVal &Val) const |
bool | IsIn (const TVal &Val, int &ValN) const |
bool | IsInBin (const TVal &Val) const |
int | GetMxValN () const |
TVal & | GetDat (const TVal &Val) const |
TVal & | GetAddDat (const TVal &Val) |
Static Public Member Functions | |
static void | SwapI (TIter LVal, TIter RVal) |
template<class TCmp > | |
static TIter | GetPivotValNCmp (const TIter &BI, const TIter &EI, const TCmp &Cmp) |
template<class TCmp > | |
static TIter | PartitionCmp (TIter BI, TIter EI, const TVal Pivot, const TCmp &Cmp) |
template<class TCmp > | |
static void | BSortCmp (TIter BI, TIter EI, const TCmp &Cmp) |
template<class TCmp > | |
static void | ISortCmp (TIter BI, TIter EI, const TCmp &Cmp) |
template<class TCmp > | |
static void | QSortCmp (TIter BI, TIter EI, const TCmp &Cmp) |
static TVec< TVal > | GetV (const TVal &Val1) |
static TVec< TVal > | GetV (const TVal &Val1, const TVal &Val2) |
static TVec< TVal > | GetV (const TVal &Val1, const TVal &Val2, const TVal &Val3) |
static TVec< TVal > | GetV (const TVal &Val1, const TVal &Val2, const TVal &Val3, const TVal &Val4) |
static TVec< TVal > | GetV (const TVal &Val1, const TVal &Val2, const TVal &Val3, const TVal &Val4, const TVal &Val5) |
static TVec< TVal > | GetV (const TVal &Val1, const TVal &Val2, const TVal &Val3, const TVal &Val4, const TVal &Val5, const TVal &Val6) |
static TVec< TVal > | GetV (const TVal &Val1, const TVal &Val2, const TVal &Val3, const TVal &Val4, const TVal &Val5, const TVal &Val6, const TVal &Val7) |
static TVec< TVal > | GetV (const TVal &Val1, const TVal &Val2, const TVal &Val3, const TVal &Val4, const TVal &Val5, const TVal &Val6, const TVal &Val7, const TVal &Val8) |
static TVec< TVal > | GetV (const TVal &Val1, const TVal &Val2, const TVal &Val3, const TVal &Val4, const TVal &Val5, const TVal &Val6, const TVal &Val7, const TVal &Val8, const TVal &Val9) |
Protected Member Functions | |
void | Resize (const int &_MxVals=-1) |
TStr | GetXOutOfBoundsErrMsg (const int &ValN) const |
Protected Attributes | |
int | MxVals |
int | Vals |
TVal * | ValT |
Definition at line 481 of file ds.h.
Referenced by TCnCom::Add(), TGStatVec::Add(), TVecElt< TVec< TDat > >::Add(), TUniTrie< TInt >::Add(), TXmlLx::AddArg(), TNetInfBs::AddCasc(), TPp::AddCcVal(), TGnuPlot::AddCmd(), TWChA::AddCStr(), TLocClustStat::AddCut(), TUniChDb::AddDecomposition(), TSimpleGraph::AddEdge(), TGnuPlot::AddErrBar(), TGnuPlot::AddExpFit(), THttpResp::AddFldVal(), TGnuPlot::AddFunc(), THttpResp::AddHdFld(), TGnuPlot::AddLinFit(), TGnuPlot::AddLogFit(), TTree< TVal >::AddNode(), TUndirFFire::AddNodes(), TGnuPlot::AddPlot(), TPp::AddPp(), TGnuPlot::AddPwrFit1(), TGnuPlot::AddPwrFit2(), TGnuPlot::AddPwrFit3(), TSnap::AddSelfEdges(), TBigStrPool::AddStr(), TVecPool< TVal >::AddV(), TUniCaseFolding::AppendVector(), TLocClustStat::BagOfWhiskers(), TLocClustStat::BagOfWhiskers2(), TForestFire::BurnExpFire(), TForestFire::BurnGeoFire(), TUndirFFire::BurnGeoFire(), TCliqueOverlap::CalculateOverlapMtx(), TKroneckerLL::ChainGelmapRubinPlot(), TSnap::TSnapDetail::TCNMQMatrix::CmtyCMN(), TUniChDb::Compose(), TGnuPlot::CreatePlotFile(), TUniCodec::DecodeUtf16FromBytes(), TUniCodec::DecodeUtf16FromWords(), TUniCodec::DecodeUtf8(), TGStatVec::DelAfter(), TGStatVec::DelBefore(), TSnap::DelDegKNodes(), TGStatVec::DelSmallNodes(), TFile::DelWc(), TSnap::DelZeroDegNodes(), TVec< TVal >::Diff(), TSnap::TSnapDetail::TDelSelfEdges< PGraph, IsMultiGraph >::Do(), TSnap::TSnapDetail::TDelSelfEdges< PGraph, true >::Do(), TMAGFitBern::DoEMAlg(), TUniCodec::EncodeUtf16ToBytes(), TUniCodec::EncodeUtf16ToWords(), TUniCodec::EncodeUtf8(), TUniCodec::EncodeUtf8Str(), TSpecFunc::EntropyFracDim(), TSubGraphsEnum::EnumSubGraphs(), TCliqueOverlap::Expand(), TSpecFunc::ExpFit(), TUniChDb::ExtractStarters(), TLocClust::FindBestCut(), TBiConVisitor::FinishNode(), TSccVisitor< PGraph, OnlyCount >::FinishNode(), TKronNoise::FlipEdgeNoise(), TUniCaseFolding::Fold(), TSubGraphsEnum::Gen2Graphs(), TAGM::GenAGM(), TBlobBs::GenBlockLenV(), TKronMtx::GenFastKronecker(), TFfGGen::GenFFGraphs(), TSnap::GenGeoPrefAttach(), TSnap::GenPrefAttach(), TSnap::GenRMat(), TSnap::GenRndDegK(), TSnap::GenRndPowerLaw(), TVec< THKeyDat >::GetAddDat(), TUnicode::GetAllCodecs(), TNetInfBs::GetBestEdge(), TSnap::GetBetweennessCentr(), TSnap::GetBfsEffDiam(), TExp::GetBiDescV(), TLocClustStat::GetBoltzmanCurveStat(), TNetInfBs::GetBound(), TUniChDb::GetCaseConverted(), TSnap::GetClustCf(), TVVec< TVal >::GetCol(), THttpResp::GetCookieKeyValDmPathQuV(), TCliqueOverlap::GetCPMCommunities(), TLocClustStat::GetCurveStat(), THash< TKey, TDat, THashFunc >::GetDatV(), TSparseHash< TKey, TDat, GroupSize >::GetDatV(), TStrHash< TDat, TStringPool, THashFunc >::GetDatV(), TSnap::GetDegCnt(), TSnap::GetDegSeqV(), TSecTm::GetDtTmFromStr(), TTimeNENet::GetEdgeBuckets(), TTimeNENet::GetEdgeTmBuckets(), TTimeNENet::GetEIdByTm(), TNEGraph::GetEIdV(), TNodeEdgeNet< TNodeData, TEdgeData >::GetEIdV(), TSnap::GetEigVec(), TFFile::GetFNmV(), TGraphAnf< PGraph >::GetGraphAnf(), TUrlLx::GetHPath(), TEnv::GetIfArgPrefixIntV(), TEnv::GetIfArgPrefixStrV(), TSnap::GetInDegCnt(), TSnap::GetInvParticipRat(), TGHash< TDat >::GetKeyIdByDat(), TGHash< TDat >::GetKeyIdByGSz(), THash< TKey, TDat, THashFunc >::GetKeyV(), TSparseHash< TKey, TDat, GroupSize >::GetKeyV(), TStrHash< TDat, TStringPool, THashFunc >::GetKeyV(), TSparseSet< TKey, GroupSize >::GetKeyV(), THashSet< TKey, THashFunc >::GetKeyV(), TSnap::GetLen2Paths(), TBPGraph::GetLNIdV(), TILx::GetLnV(), TGraphEnumUtils::GetMinAndGraphIds(), TSnap::GetMxDegNId(), TSnap::GetMxInDegNId(), TSnap::GetMxOutDegNId(), TTimeNet::GetNIdByTm(), TTimeNENet::GetNIdByTm(), TBigNet< TNodeData, IsDir >::GetNIdV(), TNodeNet< TNodeData >::GetNIdV(), TUNGraph::GetNIdV(), TNGraph::GetNIdV(), TNodeEDatNet< TNodeData, TEdgeData >::GetNIdV(), TNEGraph::GetNIdV(), TBPGraph::GetNIdV(), TNodeEdgeNet< TNodeData, TEdgeData >::GetNIdV(), TGraphAnf< PGraph >::GetNodeAnf(), TTimeNet::GetNodeBuckets(), TTimeNENet::GetNodeBuckets(), TTree< TVal >::GetNodeIdV(), TSnap::GetNodeInDegV(), TGHash< TDat >::GetNodeMap(), TAGM::GetNodeMembership(), TSnap::GetNodeOutDegV(), TSnap::GetNodesAtHop(), TSnap::GetNodeWcc(), TSnap::GetOutDegCnt(), TWebPg::GetOutDescUrlStrKdV(), TWebPg::GetOutUrlV(), TCliqueOverlap::GetOverlapCliques(), TGraphEnumUtils::GetPermutations(), TTimeNENet::GetPrefAttach(), TSnap::GetRndESubGraph(), TBreathFS< PGraph >::GetRndPath(), TBPGraph::GetRNIdV(), TVVec< TVal >::GetRow(), TUniChDb::GetSimpleCaseConverted(), TSnap::GetSngVec(), TStr::GetSpaceStr(), TMacro::GetSrcSubstStrV(), TStrHash< TDat, TStringPool, THashFunc >::GetStrIdV(), TVec< TVal >::GetSubValV(), THtmlLx::GetTag(), TXmlTok::GetTagTokV(), TXmlDoc::GetTagTokV(), TXmlTok::GetTagValV(), TTimeNet::GetTmBuckets(), TTimeNENet::GetTmBuckets(), THtmlLx::GetTokStrV(), TSnap::GetTreeSig(), TTimeNENet::GetTriadEdges(), TSnap::GetTriads(), TVec< THKeyDat >::GetV(), TGStatVec::GetValV(), TILx::GetVarBoolV(), TILx::GetVarFltV(), TILx::GetVarIntV(), TMacro::GetVarNmV(), TEnv::GetVarNmV(), TEnv::GetVarNmValV(), TILx::GetVarStrPrV(), TILx::GetVarStrV(), TILx::GetVarStrVV(), TSnap::GetWccs(), TUStr::GetWordUStrV(), TMAGFitBern::GradApxAffMtx(), TKroneckerLL::GradDescent(), TKroneckerLL::GradDescentConvergence(), TNetInfBs::GreedyOpt(), TLocClustStat::ImposeNCP(), TForestFire::InfectAll(), TForestFire::InfectRnd(), TSnap::TSnapDetail::TCNMQMatrix::Init(), TNetInfBs::Init(), TNIBs::Init(), TTmInfo::InitDayOfWeekNmV(), TTmInfo::InitMonthNmV(), TGHash< TDat >::InitPermutations(), TUniChDb::InitWordAndSentenceBoundaryFlags(), TVec< TVal >::Intrs(), TStr::IsWcMatch(), TNIBs::LabelBurstAutomaton(), TSparseSVD::Lanczos(), TSparseSVD::Lanczos2(), TTimeNet::LoadArxiv(), TKeyDatFl< TKey, TDat, THashFunc >::LoadDatV(), TSnap::LoadDyNetGraphV(), TInt::LoadFrugalIntV(), TKeyDatFl< TKey, TDat, THashFunc >::LoadKeyV(), TLAMisc::LoadMatlabTFltVV(), TTimeNet::LoadPatents(), TGnuPlot::LoadTs(), TPpVal::LoadTxt(), TMAGNodeBern::LoadTxt(), TMAGNodeBeta::LoadTxt(), TPp::LoadTxt(), TXmlDoc::LoadTxt(), TUniChDb::LoadTxt_ProcessDecomposition(), TExp::LoadTxtFact(), TSs::LoadTxtFldV(), TExpHelp::LoadXml(), TSpecFunc::LogFit(), TMAGFitBern::MakeCCDF(), TGUtil::MakeExpBins(), TGnuPlot::MakeExpBins(), TLocClustStat::MakeExpBins(), TSnap::MakeUnDir(), McMcGetAvgJ(), TWebPg::New(), TSsParser::Next(), TVec< THKeyDat >::operator+(), TWChA::operator+=(), TSparseSVD::OrtoIterSVD(), TUniChDb::TUcdFileReader::ParseCodePointList(), THttpResp::ParseHttpResp(), PlotAutoCorrelation(), TLocClustStat::PlotBestClustDens(), TNcpGraphsBase::PlotBestWhisker(), TLocClustStat::PlotBoltzmanCurve(), TTimeNet::PlotCCfOverTm(), TLocClust::PlotCutDistr(), TTimeNet::PlotEffDiam(), TTimeNENet::PlotEffDiam(), TFfGGen::PlotFireSize(), TSnap::PlotInvParticipRat(), TTimeNet::PlotMissingPast(), TLocClustStat::PlotNCP(), TNcpGraphsBase::PlotNcpMin(), TLocClustStat::PlotNCPModul(), TLocClustStat::PlotNcpTop10(), TLocClust::PlotPhiDistr(), TNcpGraphsBase::PlotRewBestWhisker(), TNcpGraphsBase::PlotRewNcpMin(), TSnap::PlotShortPathDistr(), TGnuPlot::PlotValCntH(), TGnuPlot::PlotValMomH(), TGnuPlot::PlotValV(), TLocClust::PlotVolDistr(), TSpecFunc::PowerFit(), TSparseSVD::Project(), TVec< THKeyDat >::PushHeap(), THtmlLx::PutArg(), TMBlobBs::PutBlob(), TWChA::PutCStr(), TSubGraphsEnum::RecurBfs(), TSubGraphsEnum::RecurBfs1(), TKronNoise::RemoveEdgeNoise(), TBigNet< TNodeData, IsDir >::Rewire(), TLocClustStat::Run(), TKroneckerLL::RunEStep(), TKroneckerLL::RunKronEM(), THtmlDoc::SaveHtmlToXml(), TNetInfBs::SaveObjInfo(), TMAGNodeSimple::SaveTxt(), TMAGNodeBern::SaveTxt(), TMAGNodeBeta::SaveTxt(), TLocClustStat::SaveTxtInfo(), TNcpGraphsBase::SaveTxtNcpMin(), TKroneckerLL::SetDegPerm(), TKroneckerLL::SetGraph(), TKroneckerLL::SetOrderPerm(), TKroneckerLL::SetRandomEdges(), TTimeNENet::SetRndEdgeTimes(), TKroneckerLL::SetRndPerm(), TQQueue< TInt >::Shuffle(), TSparseSVD::SimpleLanczos(), TTuple< TVal, NVals >::Sort(), TSparseOps< TKey, TDat >::SparseMerge(), TStrUtil::SplitLines(), TStr::SplitOnAllAnyCh(), TStr::SplitOnAllCh(), TStrUtil::SplitOnCh(), TStr::SplitOnNonAlNum(), TStr::SplitOnStr(), TStr::SplitOnWs(), TStrUtil::SplitSentences(), TStrUtil::SplitWords(), TLocClust::SupportSweep(), TGStat::TakeConnComp(), TGraphKey::TakeGraph(), TGraphKey::TakeSig(), TGStat::TakeSpectral(), TGStat::TakeTriadPart(), TBigStrPool::TBigStrPool(), TEnv::TEnv(), TGnuPlot::Test(), TSnap::TestAnf(), TKroneckerLL::TestBicCriterion(), TUniChDb::TestComposition(), TUniCodec::TestDecodeUtf16(), TUniCodec::TestDecodeUtf8(), TUniChDb::TestFindNextWordOrSentenceBoundary(), TKroneckerLL::TestGradDescent(), TKroneckerLL::TestSamplePerm(), TUniCodec::TestUtf16(), TUniCodec::TestUtf8(), TUniChDb::TestWbFindNonIgnored(), TExp::TExp(), TFFile::TFFile(), THtmlDoc::THtmlDoc(), THtmlHldV::THtmlHldV(), TTimeNENet::TimeGrowth(), TMBlobBs::TMBlobBs(), TNcpGraphsBase::TNcpGraphsBase(), TLAMisc::ToSpVec(), T8BitCodec< TEncoding_ISO8859_3 >::ToUnicode(), TPreproc::TPreproc(), TSparseRowMatrix::TSparseRowMatrix(), TVecPool< TVal >::TVecPool(), TVec< TVal >::Union(), TMAGFitBern::UpdateApxPhiMI(), TNIBs::UpdateDiff(), TMAGFitBern::UpdatePhi(), TMAGFitBern::UpdatePhiMI(), and TUniCodec::WordsToBytes().
int TVec< TVal >::AddBackSorted | ( | const TVal & | Val, |
const bool & | Asc | ||
) |
int TVec< TVal >::AddSorted | ( | const TVal & | Val, |
const bool & | Asc = true , |
||
const int & | _MxVals = -1 |
||
) |
Definition at line 889 of file ds.h.
References Assert, and Swap().
Referenced by TUNGraph::AddEdge(), TNGraph::AddEdge(), TNEGraph::AddEdge(), and TNodeEdgeNet< TNodeData, TEdgeData >::AddEdge().
{ Assert(MxVals!=-1); int ValN=Add(Val); if (Asc){ while ((ValN>0)&&(ValT[ValN]<ValT[ValN-1])){ Swap(ValN, ValN-1); ValN--;} } else { while ((ValN>0)&&(ValT[ValN]>ValT[ValN-1])){ Swap(ValN, ValN-1); ValN--;} } if ((_MxVals!=-1)&&(Len()>_MxVals)){Del(_MxVals, Len()-1);} return ValN; }
Definition at line 930 of file ds.h.
References Assert.
Referenced by THitInfo::AddKeyword(), TExpHelp::GetCatNmV(), and TExpHelp::GetObjHdNmV().
{ Assert(MxVals!=-1); int ValN=SearchForw(Val); if (ValN==-1){return Add(Val);} else {GetVal(ValN)=Val; return -1;} }
Definition at line 882 of file ds.h.
References Assert, and TVec< TVal >::Vals.
Referenced by TUniChDb::LoadTxt_ProcessDecomposition(), TUStr::operator+=(), TWChA::operator+=(), TTimeNet::PlotCCfOverTm(), TTimeNet::PlotEffDiam(), TTimeNENet::PlotEffDiam(), TTimeNet::PlotMedianDegOverTm(), TTimeNet::PlotMissingPast(), TUniChDb::TestFindNextWordOrSentenceBoundary(), TTimeNet::TimeGrowth(), and TTimeNENet::TimeGrowth().
int TVec< TVal >::AddVMerged | ( | const TVec< TVal > & | ValV | ) |
void TVec< TVal >::AdjustHeap | ( | const int & | First, |
int | HoleIdx, | ||
const int & | Len, | ||
TVal | Val, | ||
const TCmp & | Cmp | ||
) | [inline] |
Definition at line 544 of file ds.h.
Referenced by TVec< THKeyDat >::MakeHeap(), and TVec< THKeyDat >::PopHeap().
{ const int Top = HoleIdx; int Right = 2*HoleIdx+2; while (Right < Len) { if (Cmp(ValT[First+Right], ValT[First+Right-1])) { Right--; } ValT[First+HoleIdx] = ValT[First+Right]; HoleIdx = Right; Right = 2*(Right+1); } if (Right == Len) { ValT[First+HoleIdx] = ValT[First+Right-1]; HoleIdx = Right-1; } PushHeap(First, HoleIdx, Top, Val, Cmp); }
Definition at line 477 of file ds.h.
Referenced by TPackVec< TVal >::AddV(), TVecPool< TVal >::AddV(), TGraphAnf< PGraph >::AvgLstZero(), THash< TIntPr, TEdgeInfo >::BegI(), TSparseTable< THashKeyDat, GroupSize >::BegI(), THashSet< TInt >::BegI(), TSparseTable< THashKeyDat, GroupSize >::EndI(), TGraphAnf< PGraph >::GetGraphAnf(), TSparseTable< THashKeyDat, GroupSize >::GetI(), TGraphAnf< PGraph >::GetNodeAnf(), TGraphAnf< PGraph >::InitAnfBits(), TVec< THKeyDat >::IsSortedCmp(), TSparseColMatrix::PMultiply(), TSparseColMatrix::PMultiplyT(), TVecPool< TInt >::PutV(), TBigNet< TNodeData, IsDir >::SetInNIdV(), TBigNet< TNodeData, IsDir >::SetOutNIdV(), TVec< THKeyDat >::SortCmp(), TSubGraphEnum< TGraphCounter >::TSVec::TSVec(), and TGraphAnf< PGraph >::Union().
{return ValT;}
void TVec< TVal >::BSort | ( | const int & | MnLValN, |
const int & | MxRValN, | ||
const bool & | Asc | ||
) |
Definition at line 999 of file ds.h.
References Swap().
{ for (int ValN1=MnLValN; ValN1<=MxRValN; ValN1++){ for (int ValN2=MxRValN; ValN2>ValN1; ValN2--){ if (Asc){ if (ValT[ValN2]<ValT[ValN2-1]){Swap(ValN2, ValN2-1);} } else { if (ValT[ValN2]>ValT[ValN2-1]){Swap(ValN2, ValN2-1);} } } } }
void TVec< TVal >::Clr | ( | const bool & | DoDel = true , |
const int & | NoDelLim = -1 |
||
) |
Definition at line 816 of file ds.h.
References IAssert.
Referenced by TGnuPlot::AddPwrFit3(), TLocClustStat::BagOfWhiskers(), TLocClustStat::BagOfWhiskers2(), TForestFire::BurnExpFire(), TForestFire::BurnGeoFire(), TUndirFFire::BurnGeoFire(), TCliqueOverlap::CalculateOverlapMtx(), TUStr::Clr(), TWChA::Clr(), TCnCom::Clr(), TMAGParam< TMAGNodeBern >::Clr(), TGStatVec::Clr(), TLocClustStat::Clr(), TUniTrie< TInt >::Clr(), TUniChDb::Clr(), TVecPool< TInt >::Clr(), TTree< TVal >::Clr(), TXmlLx::ClrArgV(), TSnap::TSnapDetail::CmtyGirvanNewmanStep(), TSnap::CommunityGirvanNewman(), TUniChDb::Compose(), TUniCodec::DecodeUtf16FromBytes(), TUniCodec::DecodeUtf16FromWords(), TUniCodec::DecodeUtf8(), TUniChDb::Decompose(), TUniChDb::DecomposeAndCompose(), TMom::Def(), THitInfo::DelKeywords(), TVec< TVal >::Diff(), TSpecFunc::EntropyFracDim(), TSubGraphsEnum::EnumSubGraphs(), TUniChDb::ExtractStarters(), TLocClust::FindBestCut(), TBlobBs::GenBlockLenV(), TSnap::GenGeoPrefAttach(), TSnap::Get1CnCom(), TSnap::Get1CnComSzCnt(), TUnicode::GetAllCodecs(), TExp::GetBiDescV(), TUniChDb::GetCaseConverted(), TExpHelp::GetCatNmV(), TSnap::GetCmnNbrs(), THttpResp::GetCookieKeyValDmPathQuV(), TCliqueOverlap::GetCPMCommunities(), TLocClustStat::GetCurveStat(), THttpResp::GetFldValV(), TFFile::GetFNmV(), TGraphAnf< PGraph >::GetGraphAnf(), TSnap::GetInvParticipRat(), THashSet< TKey, THashFunc >::GetKeyV(), TSnap::GetLen2Paths(), TILx::GetLnV(), TCliqueOverlap::GetMaxCliques(), TCliqueOverlap::GetMaximalCliques(), TSnap::GetMxDegNId(), TSnap::GetMxInDegNId(), TSnap::GetMxOutDegNId(), TUniChDb::TUcdFileReader::GetNextLine(), TGraphAnf< PGraph >::GetNodeAnf(), TTree< TVal >::GetNodeIdV(), TGHash< TDat >::GetNodeMap(), TSnap::GetNodesAtHop(), TExpHelp::GetObjHdNmV(), TWebPg::GetOutDescUrlStrKdV(), TWebPg::GetOutUrlV(), TBreathFS< PGraph >::GetRndPath(), TUniChDb::GetSimpleCaseConverted(), TSnap::GetSngVec(), THtmlLx::GetSym(), TXmlTok::GetTagTokV(), TXmlDoc::GetTagTokV(), THtmlLx::GetTokStrV(), TTimeNENet::GetTriadEdges(), TSnap::GetTriads(), TVecPool< TInt >::GetV(), TILx::GetVarBoolV(), TILx::GetVarFltV(), TILx::GetVarIntV(), TEnv::GetVarNmV(), TEnv::GetVarNmValV(), TILx::GetVarStrPrV(), TILx::GetVarStrV(), TILx::GetVarStrVV(), TSnap::GetWccs(), TUStr::GetWordUStrV(), TKroneckerLL::GradDescentConvergence(), TNetInfBs::Init(), TNIBs::Init(), TVec< TVal >::Intrs(), TInt::LoadFrugalIntV(), TLAMisc::LoadMatlabTFltVV(), TGnuPlot::LoadTs(), TXmlDoc::LoadTxt(), TSs::LoadTxtFldV(), TGUtil::MakeExpBins(), TGnuPlot::MakeExpBins(), TLocClustStat::MakeExpBins(), TSsParser::Next(), TUniChDb::TUcdFileReader::ParseCodePointList(), TSubGraphsEnum::RecurBfs(), TSubGraphsEnum::RecurBfs1(), TKroneckerLL::RestoreGraph(), TLocClustStat::Run(), TSparseOps< TKey, TDat >::SparseMerge(), TStrUtil::SplitLines(), TStr::SplitOnAllAnyCh(), TStr::SplitOnAllCh(), TStrUtil::SplitOnCh(), TStr::SplitOnNonAlNum(), TStr::SplitOnStr(), TStr::SplitOnWs(), TStrUtil::SplitSentences(), TStrUtil::SplitWords(), TLocClust::SupportSweep(), TUniCodec::TestUtf16(), TUniCodec::TestUtf8(), THtmlHldV::THtmlHldV(), TTimeNENet::TimeGrowth(), TLAMisc::ToSpVec(), T8BitCodec< TEncoding_ISO8859_3 >::ToUnicode(), and TUniCodec::WordsToBytes().
{ if ((DoDel)||((!DoDel)&&(NoDelLim!=-1)&&(MxVals>NoDelLim))){ if ((ValT!=NULL)&&(MxVals!=-1)){delete[] ValT;} MxVals=Vals=0; ValT=NULL; } else { IAssert(MxVals!=-1); Vals=0; } }
Definition at line 957 of file ds.h.
References Assert.
Referenced by TGStatVec::Del(), TUNGraph::DelEdge(), TNGraph::DelEdge(), TBPGraph::DelEdge(), TVec< THKeyDat >::DelLast(), TNodeNet< TNodeData >::DelNode(), TUNGraph::DelNode(), TNGraph::DelNode(), TNodeEDatNet< TNodeData, TEdgeData >::DelNode(), TBPGraph::DelNode(), TSs::DelX(), TSs::DelY(), TSnap::GenGeoPrefAttach(), TSnap::Get1CnCom(), TSnap::Get1CnComSzCnt(), TNetInfBs::GetBestEdge(), TSvd::GetCfV(), TSnap::GetRndESubGraph(), TSnap::GetRndSubGraph(), TKroneckerLL::RestoreGraph(), TSvd::Svd(), and TSvd::Svd1Based().
{ Assert(MxVals!=-1); Assert((0<=ValN)&&(ValN<Vals)); for (int MValN=ValN+1; MValN<Vals; MValN++){ ValT[MValN-1]=ValT[MValN];} ValT[--Vals]=TVal(); }
Definition at line 978 of file ds.h.
References Assert.
Referenced by TNEGraph::DelEdge(), and TNodeEdgeNet< TNodeData, TEdgeData >::DelEdge().
{ Assert(MxVals!=-1); int ValN=SearchForw(Val); if (ValN!=-1){Del(ValN); return true;} else {return false;} }
Definition at line 499 of file ds.h.
Referenced by TGStatVec::DelLast(), TCliqueOverlap::Expand(), TSnap::GetBetweennessCentr(), TKroneckerLL::MetroGibbsSampleNext(), TSsParser::Next(), TVec< THKeyDat >::PopHeap(), TGnuPlot::SaveEps(), TGnuPlot::SavePng(), TStrUtil::SplitOnCh(), and TStrUtil::SplitWords().
Definition at line 1182 of file ds.h.
{ TVec<TVal> DiffVec; Diff(ValV, DiffVec); MoveFrom(DiffVec); }
void TVec< TVal >::Diff | ( | const TVec< TVal > & | ValV, |
TVec< TVal > & | DstValV | ||
) | const |
Definition at line 1258 of file ds.h.
References TVec< TVal >::Add(), TVec< TVal >::Clr(), TVec< TVal >::GetVal(), and TVec< TVal >::Len().
{ DstValV.Clr(); int ValN1=0; int ValN2=0; while (ValN1<Len() && ValN2<ValV.Len()) { const TVal& Val1 = GetVal(ValN1); while (ValN2<ValV.Len() && Val1>ValV.GetVal(ValN2)) ValN2++; if (ValN2<ValV.Len()) { if (Val1!=ValV.GetVal(ValN2)) { DstValV.Add(Val1); } ValN1++; } } for (int RestValN1=ValN1; RestValN1<Len(); RestValN1++){ DstValV.Add(GetVal(RestValN1));} }
Definition at line 464 of file ds.h.
Referenced by TGnuPlot::AddErrBar(), TGnuPlot::AddExpFit(), TGnuPlot::AddLinFit(), TGnuPlot::AddLogFit(), TGnuPlot::AddPlot(), TGnuPlot::AddPwrFit1(), TGnuPlot::AddPwrFit2(), TGnuPlot::AddPwrFit3(), TGStat::AvgGStat(), TLocClustStat::BagOfWhiskers(), TLocClustStat::BagOfWhiskers2(), TForestFire::BurnExpFire(), TForestFire::BurnGeoFire(), TUndirFFire::BurnGeoFire(), TGnuPlot::CreatePlotFile(), TMAGAffMtx::Empty(), TKronMtx::Empty(), TUStr::Empty(), TWChA::Empty(), TCnCom::Empty(), TGStatVec::Empty(), TLocClustStat::FindBestCut(), TSnap::TSnapDetail::TCNMQMatrix::FindMxQEdge(), TSnap::Get1CnCom(), TSnap::Get1CnComSzCnt(), TStr::GetChStr(), TSnap::GetClustCf(), TLocClustStat::TCutInfo::GetFracDegOut(), TEnv::GetIfArgPrefixStrV(), TSnap::GetInvParticipRat(), TMAGAffMtx::GetMtx(), TKronMtx::GetMtx(), TSnap::GetMxBiCon(), TSnap::GetMxDegNId(), TSnap::GetMxInDegNId(), TSnap::GetMxOutDegNId(), TSnap::GetMxScc(), TSnap::GetMxWcc(), TBreathFS< PGraph >::GetRndPath(), TStr::GetStr(), TUStr::GetWordUStrV(), TLocClustStat::ImposeNCP(), TBigNet< TNodeData, IsDir >::IsIsoNode(), TBigNet< TNodeData, IsDir >::IsOk(), TLAMisc::LoadMatlabTFltVV(), TSs::LoadTxt(), TGnuPlot::MakeExpBins(), TLocClustStat::MakeExpBins(), TLinReg::New(), TSvd::New(), TSsParser::Next(), TNcpGraphsBase::PlotBestWhisker(), TTimeNet::PlotEffDiam(), TSnap::PlotEigValDistr(), PlotGrad(), TSnap::PlotInvParticipRat(), TTimeNet::PlotMissingPast(), TLocClustStat::PlotNCP(), TNcpGraphsBase::PlotNcpMin(), TLocClustStat::PlotNCPModul(), TNcpGraphsBase::PlotRewBestWhisker(), TNcpGraphsBase::PlotRewNcpMin(), TSnap::PlotSngValDistr(), PlotTrueAndEst(), TGnuPlot::PlotValMomH(), TVec< THKeyDat >::PopHeap(), TGraphKey::SaveGViz(), TNcpGraphsBase::SaveTxtNcpMin(), TStrUtil::SplitOnCh(), and TStrUtil::SplitWords().
{return Vals==0;}
Definition at line 478 of file ds.h.
Referenced by THash< TIntPr, TEdgeInfo >::BegI(), TSparseTable< THashKeyDat, GroupSize >::BegI(), THashSet< TInt >::BegI(), THash< TIntPr, TEdgeInfo >::EndI(), TSparseTable< THashKeyDat, GroupSize >::EndI(), THashSet< TInt >::EndI(), THash< TIntPr, TEdgeInfo >::GetI(), TSparseTable< THashKeyDat, GroupSize >::GetI(), THashSet< TInt >::GetI(), TVec< THKeyDat >::IsSortedCmp(), and TVec< THKeyDat >::SortCmp().
Definition at line 442 of file ds.h.
Referenced by TLocClustStat::BagOfWhiskers(), TLocClustStat::BagOfWhiskers2(), TForestFire::BurnExpFire(), TForestFire::BurnGeoFire(), TCliqueOverlap::CalculateOverlapMtx(), TSnap::TSnapDetail::TCNMQMatrix::CmtyCMN(), TMAGFitBern::CountAttr(), TMom::Def(), TMAGFitBern::DoEMAlg(), TMAGFitBern::DoEStepApxOneIter(), TMAGFitBern::DoEStepOneIter(), TMAGFitBern::DoMStep(), TSpecFunc::EntropyFracDim(), TSubGraphsEnum::EnumSubGraphs(), TUniChDb::FindSentenceBoundaries(), TUniChDb::FindWordBoundaries(), TKronNoise::FlipEdgeNoise(), THash< TIntPr, TEdgeInfo >::Gen(), THashSet< TInt >::Gen(), TSubGraphsEnum::Gen2Graphs(), TBlobBs::GenFFreeBlobPtV(), TMAGAffMtx::GenMtx(), TKronMtx::GenMtx(), TBlobBs::GetBlockLenV(), TLocClustStat::GetBoltzmanCurveStat(), TSvd::GetCfUncerV(), TStr::GetChStr(), TSnap::GetClustCf(), TVVec< TVal >::GetCol(), THash< TKey, TDat, THashFunc >::GetDatV(), TSparseHash< TKey, TDat, GroupSize >::GetDatV(), TStrHash< TDat, TStringPool, THashFunc >::GetDatV(), TSnap::GetDegCnt(), TSnap::GetDegSeqV(), TMAGParam< TNodeAttr >::GetDimV(), TTimeNENet::GetEdgeBuckets(), TTimeNENet::GetEdgeTmBuckets(), TTimeNENet::GetEIdByTm(), TNEGraph::GetEIdV(), TNodeEdgeNet< TNodeData, TEdgeData >::GetEIdV(), TBlobBs::GetFFreeBlobPtV(), TGraphAnf< PGraph >::GetGraphAnf(), TSnap::GetInDegCnt(), TGraphEnumUtils::GetIsoGraphs(), TGHash< TDat >::GetKeyIdByDat(), TGHash< TDat >::GetKeyIdByGSz(), THash< TKey, TDat, THashFunc >::GetKeyV(), TSparseHash< TKey, TDat, GroupSize >::GetKeyV(), TStrHash< TDat, TStringPool, THashFunc >::GetKeyV(), TSparseSet< TKey, GroupSize >::GetKeyV(), TBPGraph::GetLNIdV(), TComb::GetNext(), TTimeNet::GetNIdByTm(), TTimeNENet::GetNIdByTm(), TUNGraph::GetNIdV(), TNGraph::GetNIdV(), TNEGraph::GetNIdV(), TBPGraph::GetNIdV(), TNodeEdgeNet< TNodeData, TEdgeData >::GetNIdV(), TGraphAnf< PGraph >::GetNodeAnf(), TTimeNet::GetNodeBuckets(), TTimeNENet::GetNodeBuckets(), TSnap::GetNodeWcc(), TSnap::GetOutDegCnt(), TBPGraph::GetRNIdV(), TVVec< TVal >::GetRow(), TSnap::TSnapDetail::GetSphereDev(), TMacro::GetSrcSubstStrV(), TStrHash< TDat, TStringPool, THashFunc >::GetStrIdV(), TVec< TVal >::GetSubValV(), TQQueue< TInt >::GetSubValV(), TTimeNet::GetTmBuckets(), TTimeNENet::GetTmBuckets(), TSnap::GetTreeSig(), TGStatVec::GetValV(), TMacro::GetVarNmV(), TLinReg::GetXV(), TSvd::GetXV(), TMAGFitBern::GradApxAffMtx(), TKroneckerLL::GradDescent(), TForestFire::Infect(), TForestFire::InfectAll(), TForestFire::InfectRnd(), TGraphAnf< PGraph >::InitAnfBits(), TKroneckerLL::InitLL(), TSimpleGraph::Join(), TKeyDatFl< TKey, TDat, THashFunc >::LoadDatV(), TKeyDatFl< TKey, TDat, THashFunc >::LoadKeyV(), TGnuPlot::LoadTs(), TMAGNodeBern::LoadTxt(), TMAGNodeBeta::LoadTxt(), TMAGFitBern::MakeCCDF(), TGnuPlot::MakeExpBins(), TLocClustStat::MakeExpBins(), TMom::NewV(), TSparseSVD::Project(), TWChA::PutCStr(), TKronNoise::RemoveEdgeNoise(), TKronMaxLL::RoundTheta(), TKroneckerLL::RunEStep(), TKroneckerLL::RunKronEM(), TKroneckerLL::SampleGradient(), TMAGNodeSimple::SaveTxt(), TMAGNodeBern::SaveTxt(), TMAGNodeBeta::SaveTxt(), TUniChDb::SbEx_Add(), TKroneckerLL::SetBestDegPerm(), TKroneckerLL::SetDegPerm(), TKroneckerLL::SetGraph(), TKroneckerLL::SetIPerm(), TKroneckerLL::SetOrderPerm(), TMAGAffMtx::SetRndMtx(), TKronMtx::SetRndMtx(), TKroneckerLL::SetRndPerm(), TSparseSVD::SimpleLanczos(), TMAGFitBern::SortAttrOrdering(), TSvd::Svd(), TSvd::Svd1Based(), TGStat::TakeConnComp(), TGStat::TakeDiam(), TGraphKey::TakeGraph(), TGraphKey::TakeSig(), TGStat::TakeSpectral(), TGStat::TakeTriadPart(), TBigStrPool::TBigStrPool(), TUniChDb::TestFindNextWordOrSentenceBoundary(), TKroneckerLL::TestSamplePerm(), TUniCodec::TestUtf16(), TUniCodec::TestUtf8(), TUniChDb::TestWbFindNonIgnored(), TFHash< TKey, TFDat, TVDat >::TFHash(), TGraphKey::TGraphKey(), TMAGFitBern::TMAGFitBern(), TMAGNodeBeta::TMAGNodeBeta(), TLAMisc::ToVec(), TSparseRowMatrix::TSparseRowMatrix(), TSubGraphEnum< TGraphCounter >::TSVec::TSVec(), TVecPool< TVal >::TVecPool(), TVec< TVal >::Union(), TMAGFitBern::UpdateApxPhiMI(), TMAGFitBern::UpdatePhi(), and TMAGFitBern::UpdatePhiMI().
{ IAssert(0<=_Vals); if (ValT!=NULL && MxVals!=-1){delete[] ValT;} MxVals=Vals=_Vals; if (MxVals==0){ValT=NULL;} else {ValT=new TVal[MxVals];}}
Definition at line 450 of file ds.h.
Referenced by TUNGraph::AddNode(), TNGraph::AddNode(), and TVecPool< TInt >::GetV().
Definition at line 675 of file ds.h.
{ Assert(MxVals!=-1); int ValN=SearchForw(Val); if (ValN==-1){Add(Val); return Last();} else {return operator[](ValN);}}
Definition at line 672 of file ds.h.
Referenced by TBPGraph::DelEdge(), TGHash< TDat >::GetNodeMap(), and TNetInfBs::SaveObjInfo().
{ int ValN=SearchForw(Val); return operator[](ValN);}
Definition at line 479 of file ds.h.
Referenced by TSparseTable< THashKeyDat, GroupSize >::GetI().
{return ValT+ValN;}
int TVec< TVal >::GetMemUsed | ( | ) | const [inline] |
Definition at line 436 of file ds.h.
Referenced by TWChA::GetMemUsed(), TFHash< TKey, TFDat, TVDat >::GetMemUsed(), THash< TIntPr, TEdgeInfo >::GetMemUsed(), TSparseTable< THashKeyDat, GroupSize >::GetMemUsed(), THashSet< TInt >::GetMemUsed(), and TTree< TVal >::GetMemUsed().
{ return 2*sizeof(int)+sizeof(TVal*)+MxVals*sizeof(TVal);}
int TVec< TVal >::GetPivotValN | ( | const int & | LValN, |
const int & | RValN | ||
) | const |
Definition at line 1031 of file ds.h.
References TInt::GetRnd().
{ int SubVals=RValN-LValN+1; int ValN1=LValN+TInt::GetRnd(SubVals); int ValN2=LValN+TInt::GetRnd(SubVals); int ValN3=LValN+TInt::GetRnd(SubVals); const TVal& Val1=ValT[ValN1]; const TVal& Val2=ValT[ValN2]; const TVal& Val3=ValT[ValN3]; if (Val1<Val2){ if (Val2<Val3){return ValN2;} else if (Val3<Val1){return ValN1;} else {return ValN3;} } else { if (Val1<Val3){return ValN1;} else if (Val3<Val2){return ValN2;} else {return ValN3;} } }
static TIter TVec< TVal >::GetPivotValNCmp | ( | const TIter & | BI, |
const TIter & | EI, | ||
const TCmp & | Cmp | ||
) | [inline, static] |
Definition at line 566 of file ds.h.
Referenced by TVec< THKeyDat >::QSortCmp().
{ const int SubVals=int(EI-BI); const int ValN1=TInt::GetRnd(SubVals); const int ValN2=TInt::GetRnd(SubVals); const int ValN3=TInt::GetRnd(SubVals); const TVal& Val1 = *(BI+ValN1); const TVal& Val2 = *(BI+ValN2); const TVal& Val3 = *(BI+ValN3); if (Cmp(Val1, Val2)) { if (Cmp(Val2, Val3)) return BI+ValN2; else if (Cmp(Val3, Val1)) return BI+ValN1; else return BI+ValN3; } else { if (Cmp(Val1, Val3)) return BI+ValN1; else if (Cmp(Val3, Val2)) return BI+ValN2; else return BI+ValN3; } }
int TVec< TVal >::GetPrimHashCd | ( | ) | const |
Definition at line 800 of file ds.h.
Referenced by TMAGAffMtx::GetPrimHashCd(), TKronMtx::GetPrimHashCd(), TGraphKey::GetPrimHashCd(), and TTree< TVal >::GetPrimHashCd().
{ int HashCd=0; for (int ValN=0; ValN<Vals; ValN++){ HashCd+=ValT[ValN].GetPrimHashCd();} return abs(HashCd); }
int TVec< TVal >::GetSecHashCd | ( | ) | const |
Definition at line 808 of file ds.h.
Referenced by TMAGAffMtx::GetSecHashCd(), TKronMtx::GetSecHashCd(), TGraphKey::GetSecHashCd(), and TTree< TVal >::GetSecHashCd().
{ int HashCd=0; for (int ValN=0; ValN<Vals; ValN++){ HashCd+=ValT[ValN].GetSecHashCd();} return abs(HashCd); }
void TVec< TVal >::GetSubValV | ( | const int & | BValN, |
const int & | EValN, | ||
TVec< TVal > & | ValV | ||
) | const |
Definition at line 938 of file ds.h.
References TVec< TVal >::Add(), TVec< TVal >::Gen(), TInt::GetInRng(), and TInt::GetMx().
Referenced by TKroneckerLL::ChainGelmapRubinPlot(), TWChA::GetSubWChA(), TWChA::IsPrefix(), TWChA::IsSufix(), TMAGFitBern::NextPermutation(), and TLocClustStat::Run().
{ int BValN=TInt::GetInRng(_BValN, 0, Len()-1); int EValN=TInt::GetInRng(_EValN, 0, Len()-1); int SubVals=TInt::GetMx(0, EValN-BValN+1); SubValV.Gen(SubVals, 0); for (int ValN=BValN; ValN<=EValN; ValN++){ SubValV.Add(GetVal(ValN));} }
Definition at line 682 of file ds.h.
Referenced by TAGM::GVizComGraph(), TBigNet< TNodeData, IsDir >::InvertFromSources(), TLocClust::SavePajek(), TBigNet< TNodeData, IsDir >::SetInNIdV(), and TBigNet< TNodeData, IsDir >::SetOutNIdV().
{ TVec<TVal> V(1, 0); V.Add(Val1); return V;}
static TVec<TVal> TVec< TVal >::GetV | ( | const TVal & | Val1, |
const TVal & | Val2 | ||
) | [inline, static] |
Definition at line 684 of file ds.h.
{ TVec<TVal> V(2, 0); V.Add(Val1); V.Add(Val2); return V;}
static TVec<TVal> TVec< TVal >::GetV | ( | const TVal & | Val1, |
const TVal & | Val2, | ||
const TVal & | Val3 | ||
) | [inline, static] |
Definition at line 686 of file ds.h.
{ TVec<TVal> V(3, 0); V.Add(Val1); V.Add(Val2); V.Add(Val3); return V;}
static TVec<TVal> TVec< TVal >::GetV | ( | const TVal & | Val1, |
const TVal & | Val2, | ||
const TVal & | Val3, | ||
const TVal & | Val4 | ||
) | [inline, static] |
Definition at line 688 of file ds.h.
{ TVec<TVal> V(4, 0); V.Add(Val1); V.Add(Val2); V.Add(Val3); V.Add(Val4); return V;}
static TVec<TVal> TVec< TVal >::GetV | ( | const TVal & | Val1, |
const TVal & | Val2, | ||
const TVal & | Val3, | ||
const TVal & | Val4, | ||
const TVal & | Val5 | ||
) | [inline, static] |
Definition at line 690 of file ds.h.
{ TVec<TVal> V(5, 0); V.Add(Val1); V.Add(Val2); V.Add(Val3); V.Add(Val4); V.Add(Val5); return V;}
static TVec<TVal> TVec< TVal >::GetV | ( | const TVal & | Val1, |
const TVal & | Val2, | ||
const TVal & | Val3, | ||
const TVal & | Val4, | ||
const TVal & | Val5, | ||
const TVal & | Val6 | ||
) | [inline, static] |
Definition at line 692 of file ds.h.
{ TVec<TVal> V(6, 0); V.Add(Val1); V.Add(Val2); V.Add(Val3); V.Add(Val4); V.Add(Val5); V.Add(Val6); return V;}
static TVec<TVal> TVec< TVal >::GetV | ( | const TVal & | Val1, |
const TVal & | Val2, | ||
const TVal & | Val3, | ||
const TVal & | Val4, | ||
const TVal & | Val5, | ||
const TVal & | Val6, | ||
const TVal & | Val7 | ||
) | [inline, static] |
Definition at line 694 of file ds.h.
{ TVec<TVal> V(7, 0); V.Add(Val1); V.Add(Val2); V.Add(Val3); V.Add(Val4); V.Add(Val5); V.Add(Val6); V.Add(Val7); return V;}
static TVec<TVal> TVec< TVal >::GetV | ( | const TVal & | Val1, |
const TVal & | Val2, | ||
const TVal & | Val3, | ||
const TVal & | Val4, | ||
const TVal & | Val5, | ||
const TVal & | Val6, | ||
const TVal & | Val7, | ||
const TVal & | Val8 | ||
) | [inline, static] |
Definition at line 696 of file ds.h.
{ TVec<TVal> V(8, 0); V.Add(Val1); V.Add(Val2); V.Add(Val3); V.Add(Val4); V.Add(Val5); V.Add(Val6); V.Add(Val7); V.Add(Val8); return V;}
static TVec<TVal> TVec< TVal >::GetV | ( | const TVal & | Val1, |
const TVal & | Val2, | ||
const TVal & | Val3, | ||
const TVal & | Val4, | ||
const TVal & | Val5, | ||
const TVal & | Val6, | ||
const TVal & | Val7, | ||
const TVal & | Val8, | ||
const TVal & | Val9 | ||
) | [inline, static] |
Definition at line 698 of file ds.h.
{ TVec<TVal> V(9, 0); V.Add(Val1); V.Add(Val2); V.Add(Val3); V.Add(Val4); V.Add(Val5); V.Add(Val6); V.Add(Val7); V.Add(Val8); V.Add(Val9); return V;}
Definition at line 493 of file ds.h.
Referenced by TVec< TVal >::Diff(), TVec< TVal >::Intrs(), TVec< TVal >::IntrsLen(), TVec< THKeyDat >::Last(), and TVec< TVal >::Union().
{return operator[](ValN);}
Definition at line 494 of file ds.h.
{return operator[](ValN);}
TStr TVec< TVal >::GetXOutOfBoundsErrMsg | ( | const int & | ValN | ) | const [protected] |
Definition at line 733 of file ds.h.
References TInt::GetStr(), and GetTypeNm().
Referenced by TVec< THKeyDat >::LastLast(), and TVec< THKeyDat >::operator[]().
{ return TStr()+ "Index:"+TInt::GetStr(ValN)+ " Vals:"+TInt::GetStr(Vals)+ " MxVals:"+TInt::GetStr(MxVals)+ " Type:"+GetTypeNm(*this); }
Definition at line 1168 of file ds.h.
{ TVec<TVal> IntrsVec; Intrs(ValV, IntrsVec); MoveFrom(IntrsVec); }
void TVec< TVal >::Intrs | ( | const TVec< TVal > & | ValV, |
TVec< TVal > & | DstValV | ||
) | const |
Definition at line 1196 of file ds.h.
References TVec< TVal >::Add(), TVec< TVal >::Clr(), TVec< TVal >::GetVal(), and TVec< TVal >::Len().
{ DstValV.Clr(); int ValN1=0; int ValN2=0; while ((ValN1<Len())&&(ValN2<ValV.Len())){ const TVal& Val1=GetVal(ValN1); while ((ValN2<ValV.Len())&&(Val1>ValV.GetVal(ValN2))){ ValN2++;} if ((ValN2<ValV.Len())&&(Val1==ValV.GetVal(ValN2))){ DstValV.Add(Val1); ValN2++;} ValN1++; } }
Get the size of the intersection (number of common elements) of two vectors. Method assumes both vectors are sorted in ascending order!
Definition at line 1274 of file ds.h.
References TVec< TVal >::GetVal(), and TVec< TVal >::Len().
{ int Cnt=0, ValN1=0; int ValN2=0; while ((ValN1<Len())&&(ValN2<ValV.Len())){ const TVal& Val1=GetVal(ValN1); while ((ValN2<ValV.Len())&&(Val1>ValV.GetVal(ValN2))){ ValN2++;} if ((ValN2<ValV.Len())&&(Val1==ValV.GetVal(ValN2))){ ValN2++; Cnt++;} ValN1++; } return Cnt; }
Definition at line 667 of file ds.h.
Referenced by THtmlLx::IsArg(), TXmlLx::IsArgNm(), TPreproc::IsSubstId(), TSs::LoadTxt(), TNIBs::SaveInferred(), TNIBs::SaveInferredPajek(), and TPreproc::TPreproc().
{return SearchForw(Val)!=-1;}
Definition at line 668 of file ds.h.
{ ValN=SearchForw(Val); return ValN!=-1;}
void TVec< TVal >::ISort | ( | const int & | MnLValN, |
const int & | MxRValN, | ||
const bool & | Asc | ||
) |
Definition at line 1013 of file ds.h.
{ if (MnLValN<MxRValN){ for (int ValN1=MnLValN+1; ValN1<=MxRValN; ValN1++){ TVal Val=ValT[ValN1]; int ValN2=ValN1; if (Asc){ while ((ValN2>MnLValN)&&(ValT[ValN2-1]>Val)){ ValT[ValN2]=ValT[ValN2-1]; ValN2--;} } else { while ((ValN2>MnLValN)&&(ValT[ValN2-1]<Val)){ ValT[ValN2]=ValT[ValN2-1]; ValN2--;} } ValT[ValN2]=Val; } } }
static void TVec< TVal >::ISortCmp | ( | TIter | BI, |
TIter | EI, | ||
const TCmp & | Cmp | ||
) | [inline, static] |
Definition at line 606 of file ds.h.
Referenced by TVec< THKeyDat >::QSortCmp().
{ if (BI + 1 < EI) { for (TIter i = BI, j; i != EI; ++i) { TVal Tmp = *i; j = i; while (j > BI && Cmp(Tmp, *(j-1))) { *j = *(j-1); --j; } *j = Tmp; } } }
Definition at line 1090 of file ds.h.
Referenced by TBigNet< TNodeData, IsDir >::AddNode(), TBigNet< TNodeData, IsDir >::AddUndirNode(), TSnap::GenDegSeq(), TNodeNet< TNodeData >::IsOk(), TUNGraph::IsOk(), TNGraph::IsOk(), TNodeEDatNet< TNodeData, TEdgeData >::IsOk(), TNEGraph::IsOk(), TNodeEdgeNet< TNodeData, TEdgeData >::IsOk(), TStatTest::KsTest(), TGnuPlot::MakeExpBins(), and TBigNet< TNodeData, IsDir >::SortEdgeV().
{ if (Asc){ for (int ValN=0; ValN<Vals-1; ValN++){ if (ValT[ValN]>ValT[ValN+1]){return false;}} } else { for (int ValN=0; ValN<Vals-1; ValN++){ if (ValT[ValN]<ValT[ValN+1]){return false;}} } return true; }
bool TVec< TVal >::IsSortedCmp | ( | const TCmp & | Cmp | ) | const [inline] |
Definition at line 467 of file ds.h.
Referenced by TGStatVec::Add(), THist::Add(), TGnuPlot::AddPwrFit3(), TSnap::TSnapDetail::CalcEffDiam(), TCliqueOverlap::CalculateOverlapMtx(), TMAGFitBern::DoEStep(), TSubGraphsEnum::EnumSubGraphs(), TSccVisitor< PGraph, OnlyCount >::FinishNode(), TBlobBs::GenBlockLenV(), TSnap::GenGeoPrefAttach(), TVec< THKeyDat >::GetAddDat(), TSnap::GetBfsEffDiam(), TCliqueOverlap::GetCPMCommunities(), TSnap::GetEigVec(), TEnv::GetIfArgPrefixStrV(), TComb::GetNext(), TGraphAnf< PGraph >::GetNodeAnf(), TCliqueOverlap::GetOverlapCliques(), TSnap::GetSngVec(), TILx::GetVarStrVV(), TUStr::GetWordUStrV(), TUniChDb::InitSpecialCasing(), TSimpleGraph::Join(), TNIBs::LabelBurstAutomaton(), TGStatVec::Last(), TGnuPlot::MakeExpBins(), TLocClustStat::MakeExpBins(), TKroneckerLL::MetroGibbsSampleNext(), TSsParser::Next(), TSnap::PlotEigValDistr(), TSnap::PlotInvParticipRat(), TSnap::PlotSccDistr(), TSnap::PlotShortPathDistr(), TSnap::PlotSngValDistr(), TSnap::PlotWccDistr(), TVec< THKeyDat >::PopHeap(), THist::SaveStat(), TSparseSVD::SimpleLanczos(), TStrUtil::SplitOnCh(), TStrUtil::SplitWords(), TSnap::TestAnf(), TFFile::TFFile(), and TNcpGraphsBase::TNcpGraphsBase().
Definition at line 470 of file ds.h.
Referenced by TGraphAnf< PGraph >::GetGraphAnf().
Definition at line 465 of file ds.h.
Referenced by TSnap::TSnapDetail::_GirvanNewmanGetModularity(), THist::Add(), TNetInfBs::AddCasc(), TNIBs::AddCasc(), TLocClustStat::AddCut(), TGnuPlot::AddErrBar(), TJsonVal::AddEscapeChAFromStr(), TGnuPlot::AddExpFit(), TGnuPlot::AddFunc(), THashSet< TKey, THashFunc >::AddKeyV(), TGnuPlot::AddLinFit(), TGnuPlot::AddLogFit(), TTree< TVal >::AddNode(), TGnuPlot::AddPlot(), TPp::AddPpV(), TGnuPlot::AddPwrFit1(), TGnuPlot::AddPwrFit2(), TGnuPlot::AddPwrFit3(), TSnap::AddSelfEdges(), TBigStrPool::AddStr(), TLocClustStat::AddToBestCutH(), TPackVec< TVal >::AddV(), TVecPool< TVal >::AddV(), TLinAlg::AddVec(), TUniCaseFolding::AppendVector(), anonymous_namespace{unicode.cpp}::AssertEq(), TLinAlg::AssertOrtogonality(), TSs::At(), TStatTest::AveVar(), TGStat::AvgGStat(), TLocClustStat::BagOfWhiskers(), TLocClustStat::BagOfWhiskers2(), TNIBs::BSG(), TForestFire::BurnExpFire(), TForestFire::BurnGeoFire(), TUndirFFire::BurnGeoFire(), TSnap::TSnapDetail::CalcAvgDiamPdf(), TKroneckerLL::CalcChainR2(), TSnap::TSnapDetail::CalcEffDiam(), TCliqueOverlap::CalculateOverlapMtx(), TKroneckerLL::ChainGelmapRubinPlot(), TStatTest::ChiSquareOne(), TStatTest::ChiSquareTwo(), TSnap::CommunityGirvanNewman(), TUniChDb::Compose(), TMAGFitBern::ComputeJointAdjLL(), TMAGFitBern::ComputeJointOneLL(), TSnap::ConvertESubGraph(), TStrUtil::CountWords(), TGnuPlot::CreatePlotFile(), TUnicode::DecodeUtf16FromBytes(), TUnicode::DecodeUtf16FromWords(), TUniChDb::Decompose(), TUniChDb::DecomposeAndCompose(), TMom::Def(), TMom::DefV(), TSnap::DelDegKNodes(), THash< TIntPr, TEdgeInfo >::DelKeyIdV(), THashSet< TInt >::DelKeyIdV(), TVec< THKeyDat >::DelLast(), TSnap::DelNodes(), TFile::DelWc(), TSnap::DelZeroDegNodes(), TVec< TVal >::Diff(), TSnap::TSnapDetail::TGetSubGraph< PGraph, IsMultiGraph >::Do(), TSnap::TSnapDetail::TGetSubGraph< PGraph, false >::Do(), TSnap::TSnapDetail::TConvertSubGraph< POutGraph, PInGraph, IsMultiGraph >::Do(), TSnap::TSnapDetail::TConvertSubGraph< POutGraph, PInGraph, false >::Do(), TSnap::TSnapDetail::TDelSelfEdges< PGraph, IsMultiGraph >::Do(), TSnap::TSnapDetail::TDelSelfEdges< PGraph, true >::Do(), TLinAlg::DotProduct(), TGHash< TDat >::DrawGViz(), TLocClust::DrawWhiskers(), TMAGAffMtx::Dump(), TCnCom::Dump(), TKronMtx::Dump(), TSimpleGraph::Dump(), TSsParser::DumpStr(), TUnicode::EncodeUtf16ToBytes(), TUnicode::EncodeUtf16ToWords(), TSpecFunc::Entropy(), TSpecFunc::EntropyFracDim(), TSubGraphsEnum::EnumSubGraphs(), TLinAlg::EuclDist2(), TExp::EvalExp(), TSigmoid::EvaluateFit(), TCliqueOverlap::Expand(), TSpecFunc::ExpFit(), TUniChDb::ExtractStarters(), TNIBs::FG(), TLAMisc::FillRnd(), TNIBs::find_C(), TLocClust::FindBestCut(), TLocClustStat::FindBestCut(), TUnicode::FindNextSentenceBoundary(), TUnicode::FindNextWordBoundary(), TUniChDb::FindSentenceBoundaries(), TUnicode::FindSentenceBoundaries(), TUniChDb::FindWordBoundaries(), TUnicode::FindWordBoundaries(), TMBlobBs::FNextBlobPt(), TCodecBase::FromUnicode(), TSubGraphsEnum::Gen2Graphs(), TAGM::GenAGM(), TSnap::GenConfModel(), TSnap::GenDegSeq(), TFfGGen::GenFFGraphs(), TBlobBs::GenFFreeBlobPtV(), TSnap::GenGeoPrefAttach(), TSnap::GenPrefAttach(), TSnap::Get1CnCom(), TSnap::Get1CnComSzCnt(), TTimeNENet::Get1stEdgeNet(), TNetInfBs::GetAllCascProb(), TUnicode::GetAllCodecs(), TBlobBs::GetAllocInfo(), TExp::GetArgExps(), TEnv::GetArgs(), THtmlLx::GetArgs(), TXmlLx::GetArgs(), TMAGAffMtx::GetAvgAbsErr(), TKronMtx::GetAvgAbsErr(), TMAGAffMtx::GetAvgFroErr(), TKronMtx::GetAvgFroErr(), TNetInfBs::GetBestEdge(), TSnap::GetBetweennessCentr(), TSnap::GetBfsEffDiam(), TSnap::GetBiConSzCnt(), TExpBi::GetBiFuncVal(), TBlobBs::GetBlockLenV(), TLocClustStat::GetBoltzmanCurveStat(), TNetInfBs::GetBound(), THist::GetBuckets(), TForestFire::GetBurned(), TNetInfBs::GetCascs(), TExpHelp::GetCatNmV(), TGUtil::GetCCdf(), TPp::GetCcVals(), TGUtil::GetCdf(), TPp::GetChA(), TTree< TVal >::GetChildren(), TSnap::GetClustCf(), TSnap::GetCmnNbrs(), THttpResp::GetCookieKeyValDmPathQuV(), TKCore< PGraph >::GetCoreNodes(), TLocClustStat::GetCurveStat(), TLocClust::GetCutStat(), TUNGraph::TNode::GetDeg(), TBPGraph::TNode::GetDeg(), TBigNet< TNodeData, IsDir >::GetDelEdges(), TUrl::GetDocStrFromUrlStr(), TSnap::GetEDatSubGraph(), TSnap::GetEdgeBridges(), TTimeNENet::GetEdgeBuckets(), TGraphKey::GetEdges(), TSimpleGraph::GetEdges(), TSnap::GetEdgesInOut(), TTimeNENet::GetEdgeTmBuckets(), TNodeEDatNet< TNodeData, TEdgeData >::GetEI(), TTimeNENet::GetEIdByTm(), TSnap::GetEigenVectorCentr(), TSnap::GetEigVals(), TSnap::GetEigVec(), TSnap::GetESubGraph(), TTimeNENet::GetESubGraph(), TBlobBs::GetFFreeBlobPtV(), TForestFire::GetFireTm(), THttpResp::GetFldVal(), TZipIn::GetFLen(), TLocClustStat::TCutInfo::GetFracDegOut(), THtmlTok::GetFullStr(), TUrlEnv::GetFullUrlStr(), TGraphAnf< PGraph >::GetGraphAnf(), TExpHelpObj::GetHdArgNmStr(), TEnv::GetIfArgPrefixIntV(), TEnv::GetIfArgPrefixStrV(), TNodeNet< TNodeData >::TNode::GetInDeg(), TNGraph::TNode::GetInDeg(), TNodeEDatNet< TNodeData, TEdgeData >::TNode::GetInDeg(), TNEGraph::TNode::GetInDeg(), TNodeEdgeNet< TNodeData, TEdgeData >::TNode::GetInDeg(), TGraphEnumUtils::GetIndGraph(), TKronMtx::GetInitMtx(), TSnap::GetInvParticipRat(), TSnap::TSnapDetail::GetInvParticipRat(), TGraphEnumUtils::GetIsoGraphs(), TSnap::GetLen2Paths(), THash< TIntPr, TEdgeInfo >::GetMemUsed(), TGraphEnumUtils::GetMinAndGraphIds(), GetMinMax(), TSnap::GetModularity(), TMAGAffMtx::GetMtx(), TKronMtx::GetMtx(), TSnap::GetMxBiCon(), TSnap::GetMxDegNId(), TSnap::GetMxInDegNId(), THash< TIntPr, TEdgeInfo >::GetMxKeyIds(), TStrHash< TDat, TStringPool, THashFunc >::GetMxKeyIds(), THashSet< TInt >::GetMxKeyIds(), TSnap::GetMxOutDegNId(), TSnap::GetMxScc(), TSnap::GetMxWcc(), TSnap::GetMxWccSz(), TComb::GetNext(), TUniChDb::TUcdFileReader::GetNextLine(), TTimeNet::GetNIdByTm(), TTimeNENet::GetNIdByTm(), TGraphAnf< PGraph >::GetNodeAnf(), TTimeNet::GetNodeBuckets(), TTimeNENet::GetNodeBuckets(), TSnap::GetNodeClustCf(), TGHash< TDat >::GetNodeMap(), TAGM::GetNodeMembership(), TTree< TVal >::GetNodes(), TSnap::GetNodesAtHop(), TSnap::GetNodesAtHops(), TExpHelp::GetObj(), TExpHelp::GetObjHdNmV(), TNodeNet< TNodeData >::TNode::GetOutDeg(), TNGraph::TNode::GetOutDeg(), TNodeEDatNet< TNodeData, TEdgeData >::TNode::GetOutDeg(), TNEGraph::TNode::GetOutDeg(), TNodeEdgeNet< TNodeData, TEdgeData >::TNode::GetOutDeg(), TCliqueOverlap::GetOverlapCliques(), TSnap::GetPageRank(), TGUtil::GetPdf(), TGraphEnumUtils::GetPermutations(), THash< TIntPr, TEdgeInfo >::GetPorts(), TStrHash< TDat, TStringPool, THashFunc >::GetPorts(), THashSet< TInt >::GetPorts(), TSpecFunc::GetPowerCoef(), TPp::GetPpN(), TPp::GetPps(), TTimeNENet::GetPrefAttach(), TSnap::GetRndESubGraph(), TBreathFS< PGraph >::GetRndPath(), TSnap::GetRndSubGraph(), TLocClust::GetRndWalkSup(), TGraphKey::GetSigLen(), TSnap::GetSngVals(), TSnap::GetSngVec(), TStr::GetSpaceStr(), TSnap::TSnapDetail::GetSphereDev(), TWChA::GetStr(), TStr::GetStr(), TSnap::GetSubGraph(), TTimeNet::GetSubGraph(), TTimeNENet::GetSubGraph(), TBigNet< TNodeData, IsDir >::GetSubGraph(), TBigNet< TNodeData, IsDir >::GetSubNGraph(), TXmlTok::GetTagTok(), TXmlTok::GetTagVal(), TXmlDoc::GetTagVal(), TTimeNet::GetTimeNENet(), TTimeNet::GetTmBuckets(), TTimeNENet::GetTmBuckets(), TXmlTok::GetTokVStr(), TUrl::GetTopDownDocNm(), TSnap::GetTreeSig(), TTimeNENet::GetTriadEdges(), TSnap::GetTriads(), TSs::GetVal(), TPpVal::GetValStr(), TVecPool< TInt >::GetVecs(), TStr::GetWcMatch(), TUStr::GetWordUStrV(), TNcpGraphsBase::GetXAtMinY(), TSs::GetXLen(), TNcpGraphsBase::GetXYAtMinY(), TSs::GetYLen(), TGraphEnumUtils::GraphId(), TNetInfBs::GreedyOpt(), TSparseTable< THashKeyDat, GroupSize >::Groups(), TLinAlg::GS(), TAGM::GVizComGraph(), TNcpGraphsBase::Impose(), TUrlLxChDef::InclBoolV(), TNetInfBs::Init(), TNIBs::Init(), TTmInfo::InitDayOfWeekNmV(), TUniChDb::InitDerivedCoreProperties(), TUniChDb::InitLineBreaks(), TKroneckerLL::InitLL(), TTmInfo::InitMonthNmV(), TUniChDb::InitPropList(), TUniChDb::InitSpecialCasing(), TUniChDb::InitWordAndSentenceBoundaryFlags(), TVec< TVal >::Intrs(), TVec< TVal >::IntrsLen(), TLinAlg::InverseSVD(), TSnap::IsAllValVNeg(), TExpEnv::IsFuncOk(), TGraphKey::IsIsomorph(), THash< TIntPr, TEdgeInfo >::IsKeyId(), TStrHash< TDat, TStringPool, THashFunc >::IsKeyId(), THashSet< TInt >::IsKeyId(), TBigNet< TNodeData, IsDir >::IsOk(), TBigNet< TNodeData, IsDir >::IsolateNode(), TGnuPlot::IsSameXCol(), TPreproc::IsSubstId(), TMom::IsUsableV(), TVecPool< TInt >::IsVId(), TStr::IsWcMatch(), TStatTest::KsTest(), TNIBs::LabelBurstAutomaton(), TSparseSVD::LanczosSVD(), TVec< THKeyDat >::Last(), TVec< THKeyDat >::LastValN(), TMAGAffMtx::Len(), TKronMtx::Len(), TUStr::Len(), TWChA::Len(), TCnCom::Len(), TLocClustStat::TNodeSweep::Len(), TGStatVec::Len(), THash< TIntPr, TEdgeInfo >::Len(), TStrHash< TDat, TStringPool, THashFunc >::Len(), THashSet< TInt >::Len(), TLinAlg::LinComb(), TSpecFunc::LinearFit(), TTimeNet::LoadArxiv(), TNetInfBs::LoadGroundTruthTxt(), TNIBs::LoadGroundTruthTxt(), TNIBs::LoadInferredTxt(), TLAMisc::LoadMatlabTFltVV(), TTimeNet::LoadPatents(), TGnuPlot::LoadTs(), TMAGNodeBern::LoadTxt(), TUniChDb::LoadTxt(), TUniChDb::LoadTxt_ProcessDecomposition(), THash< TKey, TDat, THashFunc >::LoadXml(), TExpHelp::LoadXml(), THashSet< TInt >::LoadXml(), TSpecFunc::LogFit(), LogSumExp(), TMAGFitBern::MakeCCDF(), TGUtil::MakeExpBins(), TGnuPlot::MakeExpBins(), TLocClustStat::MakeExpBins(), TVec< THKeyDat >::MakeHeap(), TSnap::MakeUnDir(), McMcGetAvgAvg(), McMcGetAvgJ(), TVec< TVal >::Merge(), TKroneckerLL::MetroGibbsSampleNext(), TLinAlg::Multiply(), TLinAlg::MultiplyScalar(), TLinAlg::MultiplyT(), TJsonVal::NewArr(), TMAGFitBern::NextPermutation(), TLinAlg::Norm2(), TGUtil::Normalize(), TMAGFitBern::NormalizeAffMtxV(), TLinAlg::NormL1(), TLinAlg::NormLinf(), TDGraphCounter::operator()(), TSNodeTest::operator()(), TExpVal::operator<(), TVec< TVal >::operator<(), TPackVec< TVal >::operator=(), TExpVal::operator==(), TVec< TVal >::operator==(), TUniChDb::TUcdFileReader::ParseCodePointList(), PlotAutoCorrelation(), TNcpGraphsBase::PlotAvgNcp(), TNcpGraphsBase::PlotBestWhisker(), TLocClustStat::PlotBoltzmanCurve(), TTimeNet::PlotCCfOverTm(), TKronMtx::PlotCmpGraphs(), TLocClust::PlotCutDistr(), TTimeNet::PlotEffDiam(), TTimeNENet::PlotEffDiam(), TSnap::PlotEigValDistr(), TForestFire::PlotFire(), PlotGrad(), TSnap::PlotInDegDistr(), TSnap::PlotInvParticipRat(), TTimeNet::PlotMedianDegOverTm(), TTimeNet::PlotMissingPast(), TNcpGraphsBase::PlotNcpMin(), TLocClustStat::PlotNCPScatter(), TLocClustStat::PlotNcpTop10(), TSnap::PlotOutDegDistr(), TLocClust::PlotPhiDistr(), TNcpGraphsBase::PlotRewBestWhisker(), TNcpGraphsBase::PlotRewNcpMin(), TSnap::PlotSngValDistr(), TGnuPlot::PlotValCntH(), TGnuPlot::PlotValV(), TLocClust::PlotVolDistr(), TNGraphMtx::PMultiply(), TUNGraphMtx::PMultiply(), TSparseColMatrix::PMultiply(), TSparseRowMatrix::PMultiply(), TFullColMatrix::PMultiply(), TNGraphMtx::PMultiplyT(), TUNGraphMtx::PMultiplyT(), TSparseColMatrix::PMultiplyT(), TSparseRowMatrix::PMultiplyT(), TFullColMatrix::PMultiplyT(), TVec< THKeyDat >::PopHeap(), TSpecFunc::PowerFit(), TLAMisc::PrintTFltV(), TLAMisc::PrintTIntV(), TSparseSVD::Project(), TVec< THKeyDat >::PushHeap(), TMBlobBs::PutBlob(), TBlobBs::PutBlockLenV(), TPp::PutCcValV(), TBlobBs::PutFFreeBlobPtV(), TVecPool< TInt >::PutV(), TSs::PutVal(), TPp::PutVal(), TOLx::PutVarBoolV(), TOLx::PutVarFltV(), TOLx::PutVarIntV(), TOLx::PutVarStrPrV(), TOLx::PutVarStrV(), TOLx::PutVarStrVV(), TSubGraphsEnum::RecurBfs(), TSubGraphsEnum::RecurBfs1(), TUnicode::RegisterCodec(), TKronNoise::RemoveNodeNoise(), TKroneckerLL::RestoreGraph(), TAGM::RndConnectInsideCommunity(), TKronMaxLL::RoundTheta(), TKroneckerLL::RunMStep(), TKroneckerLL::SampleNextPerm(), TBigStrPool::Save(), TNetInfBs::SaveCascades(), TLAMisc::SaveCsvTFltV(), TGHash< TDat >::SaveDetailTxt(), TTimeNENet::SaveEdgeTm(), TInt::SaveFrugalIntV(), TGraphKey::SaveGViz(), THtmlDoc::SaveHtmlToXml(), TNIBs::SaveInferred(), TNIBs::SaveInferredPajek(), TMBlobBs::SaveMain(), TLAMisc::SaveMatlabTFltIntKdV(), TLAMisc::SaveMatlabTFltV(), TLAMisc::SaveMatlabTIntV(), TNetInfBs::SaveObjInfo(), THist::SaveStat(), TGnuPlot::SaveTs(), TSs::SaveTxt(), TExpVal::SaveTxt(), TPpVal::SaveTxt(), TGraphKey::SaveTxt(), TCnCom::SaveTxt(), TWChA::SaveTxt(), TGStatVec::SaveTxt(), TPp::SaveTxt(), TExp::SaveTxt(), TNcpGraphsBase::SaveTxt(), TGHash< TDat >::SaveTxt(), THtmlDoc::SaveTxt(), TLocClustStat::SaveTxtInfo(), TNcpGraphsBase::SaveTxtNcpMin(), TUniChDb::SbEx_AddMulti(), TVec< TVal >::SearchVForw(), TSnap::SetAllInvertSign(), TMAGNodeBeta::SetBetaV(), TKroneckerLL::SetDegPerm(), TBigNet< TNodeData, IsDir >::SetInNIdV(), TKroneckerLL::SetIPerm(), TMAGParam< TMAGNodeBern >::SetMtxV(), TBigNet< TNodeData, IsDir >::SetOutNIdV(), TKroneckerLL::SetRandomEdges(), TTimeNENet::SetRndEdgeTimes(), TMAGAffMtx::SetRndMtx(), TKronMtx::SetRndMtx(), TNIBs::SG(), TQQueue< TInt >::Shuffle(), TSparseSVD::SimpleLanczos(), TSparseSVD::SimpleLanczosSVD(), TMAGFitBern::SortAttrOrdering(), TSparseOps< TKey, TDat >::SparseMerge(), TStrUtil::SplitLines(), TStrUtil::SplitOnCh(), TStrUtil::SplitSentences(), TStrUtil::SplitWords(), TLinAlg::SumVec(), TLAMisc::SumVec(), TGStat::TakeConnComp(), TGStat::TakeDiam(), TGraphKey::TakeSig(), TGStat::TakeSpectral(), TGStat::TakeTriadPart(), TCorr::TCorr(), TD34GraphCounter::TD34GraphCounter(), TUniCaseFolding::Test(), TSnap::TestAnf(), TUniChDb::TestCaseConversion(), TUniChDb::TestComposition(), TUniCodec::TestDecodeUtf16(), TUniCodec::TestDecodeUtf8(), TUniChDb::TestFindNextWordOrSentenceBoundary(), TKroneckerLL::TestSamplePerm(), TUniCodec::TestUtf16(), TUniCodec::TestUtf8(), TUniChDb::TestWbFindNonIgnored(), TFFile::TFFile(), TFullColMatrix::TFullColMatrix(), TGraphKey::TGraphKey(), THashSet< TKey, THashFunc >::THashSet(), THtmlHldV::THtmlHldV(), TTimeNet::TimeGrowth(), TTimeNENet::TimeGrowth(), TKronMtx::TKronMtx(), TMAGAffMtx::TMAGAffMtx(), TMAGNodeBeta::TMAGNodeBeta(), TMom::TMom(), TNcpGraphsBase::TNcpGraphsBase(), TLocClustStat::TNodeSweep::TNodeSweep(), TSsParser::ToLc(), TUrl::ToLcPath(), TLAMisc::ToSpVec(), TCodecBase::ToUnicode(), T8BitCodec< TEncoding_ISO8859_3 >::ToUnicode(), TLAMisc::ToVec(), TPreproc::TPreproc(), TSigmoid::TSigmoid(), TSparseRowMatrix::TSparseRowMatrix(), TStatTest::TTest(), TVec< TVal >::Union(), T8BitCodec< TEncoding_ISO8859_3 >::UniToStr(), TMAGFitBern::UnNormalizeAffMtxV(), TUnicode::UnregisterCodec(), TMAGFitBern::UpdateApxPhiMI(), and TUniCodec::WordsToBytes().
{return Vals;}
Definition at line 749 of file ds.h.
References TSIn::Load().
Referenced by THash< TIntPr, TEdgeInfo >::Load(), TFullColMatrix::Load(), TSparseTable< THashKeyDat, GroupSize >::Load(), TStrHash< TDat, TStringPool, THashFunc >::Load(), THashSet< TInt >::Load(), TUniChDb::Load(), and TVec< THKeyDat >::TVec().
{ if ((ValT!=NULL)&&(MxVals!=-1)){delete[] ValT;} SIn.Load(MxVals); SIn.Load(Vals); MxVals=Vals; if (MxVals==0){ValT=NULL;} else {ValT=new TVal[MxVals];} for (int ValN=0; ValN<Vals; ValN++){ ValT[ValN]=TVal(SIn);} }
Definition at line 103 of file xmlser.h.
References TPt< TRec >::LoadXml(), and XLoadHd.
{ XLoadHd(Nm); int SubToks=XmlTok->GetSubToks(); Gen(SubToks, 0); for (int SubTokN=0; SubTokN<SubToks; SubTokN++){ PXmlTok SubTok=XmlTok->GetSubTok(SubTokN); TVal Val; Val.LoadXml(SubTok, TStr()); Add(Val); } }
Definition at line 526 of file ds.h.
Referenced by TSnap::TSnapDetail::TCNMQMatrix::Init(), and TVec< THKeyDat >::MakeHeap().
{ MakeHeap(TLss<TVal>()); } // build a heap
Definition at line 530 of file ds.h.
Referenced by TVec< THKeyDat >::MakeHeap().
Definition at line 1114 of file ds.h.
References Assert, TVec< TVal >::Len(), and TVec< TVal >::Sort().
Referenced by TUniChDb::InitWordAndSentenceBoundaryFlags().
{ Assert(MxVals!=-1); TVec<TVal> SortedVec(*this); SortedVec.Sort(); Clr(); for (int ValN=0; ValN<SortedVec.Len(); ValN++){ if ((ValN==0)||(SortedVec[ValN-1]!=SortedVec[ValN])){ Add(SortedVec[ValN]);} } }
Definition at line 1189 of file ds.h.
{ TVec<TVal> MinusVec; Minus(ValV, MinusVec); MoveFrom(MinusVec); }
Definition at line 864 of file ds.h.
References TVec< TVal >::MxVals, TVec< TVal >::Vals, and TVec< TVal >::ValT.
Referenced by TSpecFunc::EntropyFracDim(), and TSubGraphsEnum::Gen2Graphs().
{ if (this!=&Vec){ if (ValT!=NULL && MxVals!=-1){delete[] ValT;} MxVals=Vec.MxVals; Vals=Vec.Vals; ValT=Vec.ValT; Vec.MxVals=0; Vec.Vals=0; Vec.ValT=NULL; } }
Definition at line 1125 of file ds.h.
References Swap().
Referenced by TGHash< TDat >::InitPermutations().
{ // start with a sorted sequence to obtain all permutations int First = 0, Last = Len(), Next = Len()-1; if (Last < 2) return false; for(; ; ) { // find rightmost element smaller than successor int Next1 = Next; if (GetVal(--Next) < GetVal(Next1)) { // swap with rightmost element that's smaller, flip suffix int Mid = Last; for (; GetVal(Next) >= GetVal(--Mid); ) { } Swap(Next, Mid); Reverse(Next1, Last); return true; } if (Next == First) { // pure descending, flip all Reverse(); return false; } } }
Definition at line 785 of file ds.h.
References TVec< TVal >::Len(), and TVec< TVal >::ValT.
{ if (this==&Vec){return false;} if (Len()==Vec.Len()){ for (int ValN=0; ValN<Vals; ValN++){ if (ValT[ValN]<Vec.ValT[ValN]){return true;} else if (ValT[ValN]>Vec.ValT[ValN]){return false;} else {} } return false; } else { return Len()<Vec.Len(); } }
Definition at line 765 of file ds.h.
References TVec< TVal >::Vals, and TVec< TVal >::ValT.
Definition at line 776 of file ds.h.
References TVec< TVal >::Len(), and TVec< TVal >::ValT.
{ if (this==&Vec){return true;} if (Len()!=Vec.Len()){return false;} for (int ValN=0; ValN<Vals; ValN++){ if (ValT[ValN]!=Vec.ValT[ValN]){return false;}} return true; }
const TVal& TVec< TVal >::operator[] | ( | const int & | ValN | ) | const [inline] |
Definition at line 430 of file ds.h.
Referenced by TVec< THKeyDat >::GetAddDat(), TVec< THKeyDat >::GetDat(), and TVec< THKeyDat >::GetVal().
{ AssertR((0<=ValN)&&(ValN<Vals), GetXOutOfBoundsErrMsg(ValN)); return ValT[ValN];}
TVal& TVec< TVal >::operator[] | ( | const int & | ValN | ) | [inline] |
Definition at line 849 of file ds.h.
References IAssert.
Referenced by TNodeNet< TNodeData >::Defrag(), TNGraph::Defrag(), TNodeEDatNet< TNodeData, TEdgeData >::Defrag(), TNEGraph::Defrag(), TNodeEdgeNet< TNodeData, TEdgeData >::Defrag(), TCliqueOverlap::Expand(), TGHash< TDat >::InitPermutations(), THash< TIntPr, TEdgeInfo >::Pack(), TStrHash< TDat, TStringPool, THashFunc >::Pack(), THashSet< TInt >::Pack(), TUNGraph::TNode::PackNIdV(), TNGraph::TNode::PackNIdV(), TBPGraph::TNode::PackNIdV(), TUNGraph::TNode::PackOutNIdV(), TNGraph::TNode::PackOutNIdV(), TBPGraph::TNode::PackOutNIdV(), TGraphKey::TakeGraph(), TGraphKey::TakeSig(), and TLAMisc::ToSpVec().
{ IAssert(MxVals!=-1); if (Vals==0){ if (ValT!=NULL){delete[] ValT;} ValT=NULL; } else if (Vals<MxVals){ MxVals=Vals; TVal* NewValT=new TVal[MxVals]; IAssert(NewValT!=NULL); for (int ValN=0; ValN<Vals; ValN++){NewValT[ValN]=ValT[ValN];} delete[] ValT; ValT=NewValT; } }
int TVec< TVal >::Partition | ( | const int & | MnLValN, |
const int & | MxRValN, | ||
const bool & | Asc | ||
) |
Definition at line 1051 of file ds.h.
References forever, and Swap().
{ int PivotValN=GetPivotValN(MnLValN, MxRValN); Swap(PivotValN, MnLValN); TVal PivotVal=ValT[MnLValN]; int LValN=MnLValN-1; int RValN=MxRValN+1; forever { if (Asc){ do {RValN--;} while (ValT[RValN]>PivotVal); do {LValN++;} while (ValT[LValN]<PivotVal); } else { do {RValN--;} while (ValT[RValN]<PivotVal); do {LValN++;} while (ValT[LValN]>PivotVal); } if (LValN<RValN){Swap(LValN, RValN);} else {return RValN;} }; }
Definition at line 529 of file ds.h.
Referenced by TSnap::TSnapDetail::TCNMQMatrix::FindMxQEdge(), and TVec< THKeyDat >::PopHeap().
{ return PopHeap(TLss<TVal>()); } // remove largest element
Definition at line 1147 of file ds.h.
References Swap().
{ int First = 0, Last = Len(), Next = Len()-1; if (Last < 2) return false; for(; ; ) { // find rightmost element not smaller than successor int Next1 = Next; if (GetVal(--Next) >= GetVal(Next1)) { // swap with rightmost element that's not smaller, flip suffix int Mid = Last; for (; GetVal(Next) < GetVal(--Mid); ) { } Swap(Next, Mid); Reverse(Next1, Last); return true; } if (Next == First) { // pure descending, flip all Reverse(); return false; } } }
Definition at line 527 of file ds.h.
Referenced by TVec< THKeyDat >::AdjustHeap(), TSnap::TSnapDetail::TCNMQMatrix::MergeBestQ(), and TVec< THKeyDat >::PushHeap().
{ PushHeap(Val, TLss<TVal>()); } // add element to the heap
Definition at line 994 of file ds.h.
Referenced by TMAGFitBern::ComputeApxAdjLL(), TMAGFitBern::ComputeMI(), TMAGFitBern::CountAttr(), TMAGFitBern::DoEStepApxOneIter(), TMAGFitBern::DoEStepOneIter(), TMAGFitBern::DoMStep(), TLAMisc::FillZero(), TUniChDb::FindSentenceBoundaries(), TUniChDb::FindWordBoundaries(), THash< TIntPr, TEdgeInfo >::Gen(), THashSet< TInt >::Gen(), TKronMtx::GetInitMtx(), TMAGFitBern::GradAffMtx(), TMAGFitBern::GradApxAffMtx(), TKroneckerLL::GradDescentConvergence(), TGraphAnf< PGraph >::InitAnfBits(), TKroneckerLL::InitLL(), TBigNet< TNodeData, IsDir >::IsolateNode(), TMAGAffMtx::PutAllMtx(), TKronMtx::PutAllMtx(), TMAGFitBern::RandomInit(), TKroneckerLL::SampleGradient(), TMAGParam< TMAGNodeBern >::SetMtxAll(), TUniChDb::TestFindNextWordOrSentenceBoundary(), TKroneckerLL::TestKronDescent(), TKroneckerLL::TestSamplePerm(), THash< TKey, TDat, THashFunc >::THash(), THashSet< TKey, THashFunc >::THashSet(), THtmlLxChDef::THtmlLxChDef(), THttpChDef::THttpChDef(), TLxChDef::TLxChDef(), TMAGNodeBern::TMAGNodeBern(), TMAGNodeBeta::TMAGNodeBeta(), TLAMisc::ToVec(), and TStrHash< TDat, TStringPool, THashFunc >::TStrHash().
void TVec< TVal >::QSort | ( | const int & | MnLValN, |
const int & | MxRValN, | ||
const bool & | Asc | ||
) |
Definition at line 1071 of file ds.h.
Referenced by TSnap::GetTreeSig().
{ if (MnLValN<MxRValN){ if (MxRValN-MnLValN<20){ ISort(MnLValN, MxRValN, Asc); } else { int SplitValN=Partition(MnLValN, MxRValN, Asc); QSort(MnLValN, SplitValN, Asc); QSort(SplitValN+1, MxRValN, Asc); } } }
static void TVec< TVal >::QSortCmp | ( | TIter | BI, |
TIter | EI, | ||
const TCmp & | Cmp | ||
) | [inline, static] |
Definition at line 617 of file ds.h.
Referenced by TVec< THKeyDat >::QSortCmp(), and TVec< THKeyDat >::SortCmp().
{ if (BI + 1 < EI) { if (EI - BI < 20) { ISortCmp(BI, EI, Cmp); } else { const TVal Val = *GetPivotValNCmp(BI, EI, Cmp); TIter Split = PartitionCmp(BI, EI, Val, Cmp); QSortCmp(BI, Split, Cmp); QSortCmp(Split, EI, Cmp); } } }
Definition at line 454 of file ds.h.
Referenced by TSs::At(), TNumericalStuff::CholeskyDecomposition(), TNumericalStuff::CholeskySolve(), TSnap::GetCmnNbrs(), TSnap::GetLen2Paths(), TBigNet< TNodeData, IsDir >::GetNIdV(), TNodeNet< TNodeData >::GetNIdV(), TNodeEDatNet< TNodeData, TEdgeData >::GetNIdV(), TSnap::GetNodeInDegV(), TSnap::GetNodeOutDegV(), TSnap::GetTriads(), TSparseSVD::Lanczos(), TSparseSVD::Lanczos2(), TNumericalStuff::LUDecomposition(), TSparseSVD::OrtoIterSVD(), TSs::PutVal(), TUNGraph::ReserveNIdDeg(), TNGraph::ReserveNIdInDeg(), TNGraph::ReserveNIdOutDeg(), TUniCodec::TestUtf16(), and TUniCodec::TestUtf8().
{Resize(_MxVals);}
Definition at line 466 of file ds.h.
Referenced by THash< TIntPr, TEdgeInfo >::GetMemUsed(), THash< TIntPr, TEdgeInfo >::GetReservedKeyIds(), THashSet< TInt >::GetReservedKeyIds(), and TStrHash< TDat, TStringPool, THashFunc >::Reserved().
{return MxVals;}
Definition at line 705 of file ds.h.
References Assert, TStr::CStr(), FailR, TStr::Fmt(), GetTypeNm(), and IAssertR.
Referenced by TVec< THKeyDat >::Add(), and TVec< THKeyDat >::Reserve().
{ IAssertR(MxVals!=-1, TStr::Fmt("Can not resize buffer. %s. [Program failed to allocate more memory. Solution: Get a bigger machine and a 64-bit compiler.]", GetTypeNm(*this).CStr()).CStr()); if (_MxVals==-1){ if (Vals==0){MxVals=16;} else {MxVals*=2;} } else { if (_MxVals<=MxVals){return;} else {MxVals=_MxVals;} } if (ValT==NULL){ try {ValT=new TVal[MxVals];} catch (std::exception Ex){ FailR(TStr::Fmt("TVec::Resize 1: %s, Vals:%d, MxVals:%d, _MxVals:%d, Type:%s [Program failed to allocate more memory. Solution: Get a bigger machine and a 64-bit compiler.]", Ex.what(), Vals, MxVals, _MxVals, GetTypeNm(*this).CStr()).CStr());} } else { //if (Vals > 1000000) { // printf("%s resize %d -> %d\n", GetTypeNm(*this).CStr(), Vals, MxVals); } TVal* NewValT = NULL; try { NewValT=new TVal[MxVals];} catch (std::exception Ex){ FailR(TStr::Fmt("TVec::Resize 2: %s, Vals:%d, MxVals:%d, _MxVals:%d, Type:%s [Program failed to allocate more memory. Solution: Get a bigger machine and a 64-bit compiler.]", Ex.what(), Vals, MxVals, _MxVals, GetTypeNm(*this).CStr()).CStr());} Assert(NewValT!=NULL); for (int ValN=0; ValN<Vals; ValN++){NewValT[ValN]=ValT[ValN];} delete[] ValT; ValT=NewValT; } }
Definition at line 1108 of file ds.h.
References Swap().
Referenced by TSpecFunc::EntropyFracDim(), TBreathFS< PGraph >::GetRndPath(), and TStr::IsWcMatch().
Definition at line 758 of file ds.h.
References TSOut::Save().
Referenced by TBlobBs::PutFFreeBlobPtV(), TGraphKey::Save(), TNodeNet< TNodeData >::TNode::Save(), TPpVal::Save(), TUStr::Save(), TUNGraph::TNode::Save(), TWChA::Save(), THitInfo::Save(), TSparseColMatrix::Save(), TCnCom::Save(), TNetInfBs::Save(), TPp::Save(), TSparseRowMatrix::Save(), TFSet::Save(), THash< TIntPr, TEdgeInfo >::Save(), TFullColMatrix::Save(), TGStatVec::Save(), TNcpGraphsBase::Save(), TNGraph::TNode::Save(), TSparseTable< THashKeyDat, GroupSize >::Save(), TNodeEDatNet< TNodeData, TEdgeData >::TNode::Save(), TNEGraph::TNode::Save(), TStrHash< TDat, TStringPool, THashFunc >::Save(), TBPGraph::TNode::Save(), TNodeEdgeNet< TNodeData, TEdgeData >::TNode::Save(), THashSet< TInt >::Save(), TUniChDb::Save(), TTree< TVal >::Save(), and TFHash< TKey, TFDat, TVDat >::TFHash().
{ if (MxVals!=-1){SOut.Save(MxVals);} else {SOut.Save(Vals);} SOut.Save(Vals); for (int ValN=0; ValN<Vals; ValN++){ValT[ValN].Save(SOut);} }
Definition at line 113 of file xmlser.h.
References TInt::GetStr(), and XSaveHdArg.
{ XSaveHdArg(Nm, "Vals", TInt::GetStr(Vals)); for (int ValN=0; ValN<Vals; ValN++){ValT[ValN].SaveXml(SOut, TStr());} }
int TVec< TVal >::SearchBack | ( | const TVal & | Val | ) | const |
Definition at line 1301 of file ds.h.
Referenced by TUNGraph::DelEdge(), TNGraph::DelEdge(), TBPGraph::DelEdge(), TNodeNet< TNodeData >::DelNode(), TUNGraph::DelNode(), TNGraph::DelNode(), TNodeEDatNet< TNodeData, TEdgeData >::DelNode(), TBPGraph::DelNode(), TVec< THKeyDat >::IsInBin(), TNEGraph::TNode::IsInEId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNode::IsInEId(), TNodeNet< TNodeData >::TNode::IsInNId(), TNGraph::TNode::IsInNId(), TNodeEDatNet< TNodeData, TEdgeData >::TNode::IsInNId(), TGraphKey::IsIsomorph(), TUNGraph::TNode::IsNbrNId(), TBPGraph::TNode::IsNbrNId(), TCnCom::IsNIdIn(), TNEGraph::TNode::IsOutEId(), TNodeEdgeNet< TNodeData, TEdgeData >::TNode::IsOutEId(), TNodeNet< TNodeData >::TNode::IsOutNId(), and TNGraph::TNode::IsOutNId().
{ int LValN=0; int RValN=Len()-1; while (RValN>=LValN){ int ValN=(LValN+RValN)/2; if (Val==ValT[ValN]){return ValN;} if (Val<ValT[ValN]){RValN=ValN-1;} else {LValN=ValN+1;} } return -1; }
int TVec< TVal >::SearchForw | ( | const TVal & | Val, |
const int & | BValN = 0 |
||
) | const |
Definition at line 1323 of file ds.h.
Referenced by TPp::AddCcVal(), TTree< TVal >::DelNode(), TVec< THKeyDat >::GetAddDat(), THtmlLx::GetArg(), TXmlLx::GetArgVal(), TXmlTok::GetBoolArgVal(), TVec< THKeyDat >::GetDat(), TTmInfo::GetDayOfWeekN(), TXmlTok::GetFltArgVal(), TXmlTok::GetIntArgVal(), TTmInfo::GetMonthN(), TXmlTok::GetStrArgVal(), TVec< THKeyDat >::IsIn(), THtmlLx::PutArg(), TPp::PutVal(), TWChA::SearchCh(), and TSs::SearchX().
int TVec< TVal >::SearchVForw | ( | const TVec< TVal > & | ValV, |
const int & | BValN = 0 |
||
) | const |
Definition at line 1337 of file ds.h.
References TVec< TVal >::Len().
Referenced by TWChA::SearchStr().
{ int ValVLen=ValV.Len(); for (int ValN=BValN; ValN<Vals-ValVLen+1; ValN++){ bool Found=true; for (int SubValN=0; SubValN<ValVLen; SubValN++){ if (ValV[SubValN]!=GetVal(ValN+SubValN)){Found=false; break;} } if (Found){return ValN;} } return -1; }
Definition at line 1102 of file ds.h.
References TRnd::GetUniDevInt(), and Swap().
Referenced by TForestFire::BurnGeoFire(), TUndirFFire::BurnGeoFire(), TKronNoise::FlipEdgeNoise(), TSnap::GetBetweennessCentr(), TSnap::GetBfsEffDiam(), TSnap::GetRndESubGraph(), TSnap::GetRndSubGraph(), TSnap::GetTriads(), TSnap::PlotShortPathDistr(), TKronNoise::RemoveEdgeNoise(), TKronNoise::RemoveNodeNoise(), TKroneckerLL::SetRndPerm(), and TQQueue< TInt >::Shuffle().
{ for (int ValN=0; ValN<Vals-1; ValN++){ Swap(ValN, ValN+Rnd.GetUniDevInt(Vals-ValN));} }
Definition at line 1085 of file ds.h.
Referenced by TUNGraph::AddNode(), TNGraph::AddNode(), TGnuPlot::AddPlot(), TLocClustStat::BagOfWhiskers(), TLocClustStat::BagOfWhiskers2(), TMom::Def(), TMAGFitBern::DoEStepOneIter(), TLocClust::DrawWhiskers(), TMAGAffMtx::Dump(), TKronMtx::Dump(), TSubGraphsEnum::EnumSubGraphs(), TBiConVisitor::FinishNode(), TSubGraphsEnum::Gen2Graphs(), TBlobBs::GenBlockLenV(), TMAGAffMtx::GetAvgAbsErr(), TKronMtx::GetAvgAbsErr(), TMAGAffMtx::GetAvgFroErr(), TKronMtx::GetAvgFroErr(), TNetInfBs::GetBestEdge(), TSnap::GetBfsEffDiam(), TSnap::GetBiConSzCnt(), TNetInfBs::GetBound(), TSnap::GetClustCf(), TCliqueOverlap::GetCPMCommunities(), TLocClustStat::GetCurveStat(), TSnap::GetDegCnt(), TTimeNENet::GetEdgeTmBuckets(), TTimeNENet::GetEIdByTm(), TSnap::GetEigVals(), TSnap::GetEigVec(), TSnap::GetInDegCnt(), TSnap::GetInvParticipRat(), TGHash< TDat >::GetKeyIdByDat(), TGHash< TDat >::GetKeyIdByGSz(), TTimeNet::GetNIdByTm(), TTimeNENet::GetNIdByTm(), TSnap::GetNodesAtHops(), TExpHelp::GetObjHdNmV(), TSnap::GetOutDegCnt(), TSnap::GetSccSzCnt(), TSnap::GetSngVals(), TSnap::GetSngVec(), TTimeNet::GetTmBuckets(), TTimeNENet::GetTmBuckets(), TSnap::GetTriadParticip(), TSnap::GetWccs(), TSnap::GetWccSzCnt(), TKroneckerLL::GradDescentConvergence(), TNetInfBs::GreedyOpt(), TUniChDb::InitWordAndSentenceBoundaryFlags(), TBigNet< TNodeData, IsDir >::InvertFromSources(), TNIBs::LabelBurstAutomaton(), TSparseSVD::Lanczos(), TSparseSVD::Lanczos2(), TVec< TVal >::Merge(), TMAGFitBern::NextPermutation(), TNcpGraphsBase::PlotBestWhisker(), TTimeNet::PlotEffDiam(), TTimeNENet::PlotEffDiam(), TSnap::PlotEigValDistr(), TSnap::PlotEigValRank(), TFfGGen::PlotFireSize(), TNcpGraphsBase::PlotNcpMin(), TLocClustStat::PlotNCPModul(), TNcpGraphsBase::PlotRewBestWhisker(), TNcpGraphsBase::PlotRewNcpMin(), TSnap::PlotSngValDistr(), TSnap::PlotSngValRank(), TSnap::PlotSngVec(), TGnuPlot::PlotValMomH(), TSubGraphsEnum::RecurBfs(), TSubGraphsEnum::RecurBfs1(), TLocClustStat::Run(), TGStatVec::SaveTxt(), TNcpGraphsBase::SaveTxtNcpMin(), TKroneckerLL::SetBestDegPerm(), TKroneckerLL::SetDegPerm(), TSparseSVD::SimpleLanczos(), TCnCom::Sort(), TTuple< TVal, NVals >::Sort(), TBigNet< TNodeData, IsDir >::SortEdgeV(), TGraphKey::TakeGraph(), TGraphKey::TakeSig(), TGStat::TakeSpectral(), TUniChDb::TestWbFindNonIgnored(), TSparseRowMatrix::TSparseRowMatrix(), and TMAGFitBern::UnNormalizeAffMtxV().
Definition at line 873 of file ds.h.
References TVec< TVal >::MxVals, Swap(), TVec< TVal >::Vals, and TVec< TVal >::ValT.
Referenced by TGnuPlot::AddPlot(), TGnuPlot::AddPwrFit3(), TForestFire::BurnExpFire(), TForestFire::BurnGeoFire(), TUndirFFire::BurnGeoFire(), TSnap::TSnapDetail::TCNMQMatrix::CmtyCMN(), TSnap::CommunityGirvanNewman(), TGStatVec::DelAfter(), TGStatVec::DelBefore(), TGStatVec::DelSmallNodes(), TLocClustStat::GetBoltzmanCurveStat(), TLocClustStat::GetCurveStat(), TLocClustStat::PlotNCPModul(), TVec< THKeyDat >::Reverse(), TKroneckerLL::SampleNextPerm(), TTimeNENet::SetRndEdgeTimes(), TMAGFitBern::SortAttrOrdering(), TMAGAffMtx::Swap(), TKronMtx::Swap(), TKroneckerLL::SwapNodesLL(), and TKroneckerLL::UpdateGraphDLL().
Definition at line 506 of file ds.h.
Referenced by TVec< THKeyDat >::BSortCmp(), and TVec< THKeyDat >::PartitionCmp().
{ TVal Val=*LVal; *LVal=*RVal; *RVal=Val;}
Definition at line 826 of file ds.h.
References IAssert.
{ IAssert(MxVals!=-1); IAssert((_Vals==-1)||(_Vals>=0)); if ((_Vals!=-1)&&(_Vals>=Vals)){ return; } else if (((_Vals==-1)&&(Vals==0))||(_Vals==0)){ if (ValT!=NULL){delete[] ValT;} MxVals=Vals=0; ValT=NULL; } else { if (_Vals==-1){ if (MxVals==Vals){return;} else {MxVals=Vals;} } else { MxVals=Vals=_Vals; } TVal* NewValT=new TVal[MxVals]; IAssert(NewValT!=NULL); for (int ValN=0; ValN<Vals; ValN++){NewValT[ValN]=ValT[ValN];} delete[] ValT; ValT=NewValT; } }
Definition at line 1175 of file ds.h.
{ TVec<TVal> UnionVec; Union(ValV, UnionVec); MoveFrom(UnionVec); }
void TVec< TVal >::Union | ( | const TVec< TVal > & | ValV, |
TVec< TVal > & | DstValV | ||
) | const |
Definition at line 1210 of file ds.h.
References TVec< TVal >::Add(), TVec< TVal >::Gen(), TInt::GetMx(), TVec< TVal >::GetVal(), and TVec< TVal >::Len().
{ DstValV.Gen(TInt::GetMx(Len(), ValV.Len()), 0); int ValN1=0; int ValN2=0; while ((ValN1<Len())&&(ValN2<ValV.Len())){ const TVal& Val1=GetVal(ValN1); const TVal& Val2=ValV.GetVal(ValN2); if (Val1<Val2){DstValV.Add(Val1); ValN1++;} else if (Val1>Val2){DstValV.Add(Val2); ValN2++;} else {DstValV.Add(Val1); ValN1++; ValN2++;} } for (int RestValN1=ValN1; RestValN1<Len(); RestValN1++){ DstValV.Add(GetVal(RestValN1));} for (int RestValN2=ValN2; RestValN2<ValV.Len(); RestValN2++){ DstValV.Add(ValV.GetVal(RestValN2));} }
Definition at line 403 of file ds.h.
Referenced by TVec< THKeyDat >::Add(), TVec< THKeyDat >::Gen(), TVec< THKeyDat >::GenExt(), TVec< THKeyDat >::GetAddDat(), TVec< THKeyDat >::GetMemUsed(), TVec< THKeyDat >::IsExt(), TVec< TVal >::MoveFrom(), TVec< THKeyDat >::Reserved(), TVec< TVal >::Swap(), TVec< TVal >::TVec(), TVec< THKeyDat >::TVec(), and TVec< THKeyDat >::~TVec().
Definition at line 404 of file ds.h.
Referenced by TVec< THKeyDat >::Add(), TVec< TVal >::AddV(), TVec< TVal >::AddVMerged(), TVec< THKeyDat >::Empty(), TVec< THKeyDat >::EndI(), TVec< THKeyDat >::Gen(), TVec< THKeyDat >::GenExt(), TVec< THKeyDat >::LastLast(), TVec< THKeyDat >::Len(), TVec< TVal >::MoveFrom(), TVec< TVal >::operator=(), TVec< THKeyDat >::operator[](), TVec< THKeyDat >::Reserve(), TVec< TVal >::Swap(), TVec< TVal >::TVec(), and TVec< THKeyDat >::TVec().
Definition at line 405 of file ds.h.
Referenced by TVec< THKeyDat >::Add(), TVec< THKeyDat >::AdjustHeap(), TVec< THKeyDat >::BegI(), TVec< THKeyDat >::EndI(), TVec< THKeyDat >::Gen(), TVec< THKeyDat >::GenExt(), TVec< THKeyDat >::GetI(), TVec< THKeyDat >::LastLast(), TVec< THKeyDat >::MakeHeap(), TVec< TVal >::MoveFrom(), TVec< TVal >::operator<(), TVec< TVal >::operator=(), TPackVec< TVal >::operator=(), TVec< TVal >::operator==(), TVec< THKeyDat >::operator[](), TVec< THKeyDat >::PopHeap(), TVec< THKeyDat >::PushHeap(), TVec< TVal >::Swap(), TVec< THKeyDat >::Swap(), TVec< THKeyDat >::TopHeap(), TVec< TVal >::TVec(), TVec< THKeyDat >::TVec(), and TVec< THKeyDat >::~TVec().