MCPcopy Create free account
hub / github.com/catboost/catboost / ReadLine

Method ReadLine

catboost/private/libs/data_util/line_data_reader.cpp:52–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 }
51
52 bool TBlocksSubsetLineDataReader::ReadLine(TString* line, ui64* lineIdx) {
53 while (true) {
54 if (CurrentSubsetBlock >= SubsetBlocks.size()) {
55 return false;
56 }
57 if (EnclosingLineIdx < SubsetBlocks[CurrentSubsetBlock].End) {
58 bool enclosingReadResult = LineDataReader->ReadLine(&LineBuffer);
59 Y_ASSERT(enclosingReadResult);
60
61 if (EnclosingLineIdx >= SubsetBlocks[CurrentSubsetBlock].Begin) {
62 // in a subset
63 *line = std::move(LineBuffer);
64 if (lineIdx) {
65 *lineIdx = LineIdx;
66 }
67 ++LineIdx;
68 ++EnclosingLineIdx;
69 return true;
70 } else {
71 ++EnclosingLineIdx;
72 }
73 } else {
74 ++CurrentSubsetBlock;
75 }
76 }
77 }
78
79
80 TIndexedSubsetLineDataReader::TIndexedSubsetLineDataReader(THolder<ILineDataReader>&& lineDataReader, TVector<ui64>&& subsetIndices)

Callers 8

AreFilesDifferentFunction · 0.45
mainFunction · 0.45
ParseEvalResultFunction · 0.45
LoadInMatrixnetFormatFunction · 0.45
CountLinesFunction · 0.45
Y_UNIT_TESTFunction · 0.45
RunBostonTestMethod · 0.45

Calls 4

moveFunction · 0.50
sizeMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by 1

RunBostonTestMethod · 0.36