MCPcopy Create free account
hub / github.com/Niko1221/Strata / fit

Method fit

engine/src/split/src/batch.cpp:91–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89bool BatchDecoder::is_eos(int t) const { return std::find(eos_.begin(), eos_.end(), t) != eos_.end(); }
90
91void BatchDecoder::fit(const std::vector<BatchLane*>& lanes) {
92 if ((int) lanes.size() > MAXT) throw std::runtime_error("batch decoder: more lanes than a window's rows");
93 for (;;) {
94 int rows = 0;
95 BatchLane* most = nullptr;
96 for (BatchLane* L : lanes) {
97 rows += L->rows();
98 if (!most || L->drafts.size() > most->drafts.size()) most = L;
99 }
100 if (rows <= MAXT) return;
101 most->cut(most->rows() - 1);
102 }
103}
104
105int BatchDecoder::draft_one(BatchLane& L, int T, bool from_main, int src_row, const std::vector<int>& toks, int pos0,
106 const std::vector<int>& pen_seq, Dist& q) {

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
rowsMethod · 0.45
cutMethod · 0.45

Tested by

no test coverage detected