当前位置: 首页>>代码示例>>C++>>正文


C++ TSIn类代码示例

本文整理汇总了C++中TSIn的典型用法代码示例。如果您正苦于以下问题:C++ TSIn类的具体用法?C++ TSIn怎么用?C++ TSIn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TSIn类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Save

void TSOut::Save(TSIn& SIn, const int& BfL){
  if (BfL==-1){
    while (!SIn.Eof()){Save(SIn.GetCh());}
  } else {
    for (int BfC=0; BfC<BfL; BfC++){Save(SIn.GetCh());}
  }
}
开发者ID:Accio,项目名称:snap,代码行数:7,代码来源:flx.cpp

示例2: Save

void TSOut::Save(TSIn& SIn, const TSize& BfL){
  Fail;
  if (BfL==0){ //J: used to be ==-1
    while (!SIn.Eof()){Save(SIn.GetCh());}
  } else {
    for (TSize BfC=0; BfC<BfL; BfC++){Save(SIn.GetCh());}
  }
}
开发者ID:andrejmuhic,项目名称:qminer,代码行数:8,代码来源:fl.cpp

示例3: LoadCascadesTxt

void TNetInfBs::LoadCascadesTxt(TSIn& SIn, const int& Model, const double& alpha) {
	TStr Line;
	SIn.GetNextLn(Line);
	while (!SIn.Eof() && Line != "") {
		TStrV NIdV; Line.SplitOnAllCh(',', NIdV);
	    AddNodeNm(NIdV[0].GetInt(), TNodeInfo(NIdV[1], 0)); SIn.GetNextLn(Line); }
	printf("All nodes read!\n");
	while (!SIn.Eof()) { SIn.GetNextLn(Line); AddCasc(Line, Model, alpha); }
	printf("All cascades read!\n");
}
开发者ID:blizzardwj,项目名称:ML_netinf,代码行数:10,代码来源:cascinf.cpp

示例4: loadCascadesFromFile

void TGreedyAlg::loadCascadesFromFile(TSIn& SIn) {
    TStr line;
	SIn.GetNextLn(line);
	while (!SIn.Eof() && line != "") {
		TStrV NIdV;
        line.SplitOnAllCh(',', NIdV);
	    addNodeNm(NIdV[0].GetInt(), TNodeInfo(NIdV[1], 0)); SIn.GetNextLn(line);
    }
	printf("All nodes read!\n");
	while (!SIn.Eof()) {
        SIn.GetNextLn(line); addCascade(line);
    }
	printf("All cascades read!\n");
}
开发者ID:hmipakchi,项目名称:FinalYearProject,代码行数:14,代码来源:test_cascade_inference.cpp

示例5: Size

TStrFeatureSpace::TStrFeatureSpace(TSIn& In) {
	TInt Size(In);
	Space.Gen(Size,0);
	for (TStrFSSize i = 0; i < Size; i++) {
		int StrLen;
		In.Load(StrLen);
		char *Bf = new char[StrLen + 1];
		In.GetBf(Bf, StrLen);
		Bf[StrLen] = '\0';
		//printf("%d: [%s]\n", StrLen, Bf);
		int KeyId = ISpace.AddDat(Bf, i);
		Space.Add(ISpace.GetKeyOfs(KeyId));
		delete[] Bf;
	}
}
开发者ID:simp1eton,项目名称:snap-social,代码行数:15,代码来源:strftrspace.cpp

示例6: LoadGroundTruthTxt

void TNetInfBs::LoadGroundTruthTxt(TSIn& SIn) {
	GroundTruth = TNGraph::New(); TStr Line;

	// add nodes
	SIn.GetNextLn(Line);
	while (!SIn.Eof() && Line != "") {
		TStrV NIdV; Line.SplitOnAllCh(',', NIdV);
		GroundTruth->AddNode(NIdV[0].GetInt()); SIn.GetNextLn(Line); }

	// add edges
	while (!SIn.Eof()) {
		SIn.GetNextLn(Line);
		TStrV NIdV; Line.SplitOnAllCh(',', NIdV);
		GroundTruth->AddEdge(NIdV[0].GetInt(), NIdV[1].GetInt());
		Alphas.AddDat(TIntPr(NIdV[0].GetInt(), NIdV[1].GetInt())) = NIdV[2].GetFlt();
	}

	printf("groundtruth nodes:%d edges:%d\n", GroundTruth->GetNodes(), GroundTruth->GetEdges());
}
开发者ID:blizzardwj,项目名称:ML_netinf,代码行数:19,代码来源:cascinf.cpp

示例7: Load

PMd TMdYBayes::Load(TSIn& SIn){
  TStr TypeNm(SIn); 
  IAssert(TypeNm==TTypeNm<TMdYBayes>());
  TYNegDsType YNegDsType=TYNegDsType(int(TInt(SIn)));
  TYPriorType YPriorType=TYPriorType(int(TInt(SIn)));
  PYBs YBs(SIn);
  PYDsBs YDsBs(SIn);
  PYFSelBs YFSelBs(SIn);
  PYInvIx YInvIx(SIn);
  PYWordDs NegWordDs(SIn); SIn.LoadCs();
  PMd Md=PMd(new TMdYBayes(
   YNegDsType, YPriorType, YBs, YDsBs, YFSelBs, YInvIx));
  return Md;
}
开发者ID:mkarlovc,项目名称:gcentralization,代码行数:14,代码来源:yahoodm.cpp

示例8: Load

void TWebPgFetchPersist::Load(TSIn& SIn)
{
	// load PUrls and call FetchUrl on each of them
	int Count = 0;
	while (!SIn.Eof()) {
		try {
			PUrl Url = TUrl::Load(SIn);
			FetchUrl(Url);
			Count++;
		}
		catch (PExcept ex) {
			Notify->OnStatusFmt("TWebPgFetchPersist.Load. Exception while loading url: %s", ex->GetMsgStr().CStr());
		}
		catch (...) {
			Notify->OnStatus("TWebPgFetchPersist.Load. Unrecognized exception while loading a url.");
		}
	}
}
开发者ID:Zala,项目名称:qminer,代码行数:18,代码来源:webpgfetch.cpp

示例9: MxBfL

TBigStrPool::TBigStrPool(TSIn& SIn, bool LoadCompact) : MxBfL(0), BfL(0), GrowBy(0), Bf(0) {
  uint64 Tmp;
  SIn.Load(Tmp); IAssert(Tmp <= uint64(TSizeMx)); MxBfL=TSize(Tmp);
  SIn.Load(Tmp); IAssert(Tmp <= uint64(TSizeMx)); BfL=TSize(Tmp);
  SIn.Load(GrowBy);
  IAssert(MxBfL >= BfL);  IAssert(BfL >= 0);  IAssert(GrowBy >= 0);
  if (LoadCompact) MxBfL = BfL;
  if (MxBfL > 0) { Bf = (char *) malloc(MxBfL); IAssert(Bf); }
  if (BfL > 0) { SIn.LoadBf(Bf, BfL); }
  SIn.LoadCs();
  int NStr=0;  SIn.Load(NStr);
  IdOffV.Gen(NStr, 0);
  for (int i = 0; i < NStr; i++) {
    SIn.Load(Tmp);
    IAssert(Tmp <= uint64(TSizeMx));
    IdOffV.Add(TSize(Tmp));
  }
}
开发者ID:adobekan,项目名称:qminer,代码行数:18,代码来源:hash.cpp

示例10: TSBase

TMIn::TMIn(TSIn& SIn):
  TSBase("Input-Memory"), TSIn("Input-Memory"), Bf(NULL), BfC(0), BfL(0){
  BfL=SIn.Len(); Bf=new char[BfL];
  for (int BfC=0; BfC<BfL; BfC++){Bf[BfC]=SIn.GetCh();}
}
开发者ID:andrejmuhic,项目名称:qminer,代码行数:5,代码来源:fl.cpp


注:本文中的TSIn类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。