Example #1
0
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;
}
Example #2
0
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));
  }
}