MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / filter

Function filter

tools/Wires/Tiler/TilerEngine.cpp:44–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42
43 template <typename T>
44 T filter(const T& data, const std::vector<bool>& mask) {
45 const size_t num_rows = data.rows();
46 size_t valid_rows = 0;
47 for (auto itr : mask) {
48 if (!itr) valid_rows++;
49 }
50
51 T result(valid_rows, data.cols());
52 size_t count = 0;
53 for (size_t i=0; i<num_rows; i++) {
54 if (mask[i]) continue;
55 result.row(count) = data.row(i);
56 count++;
57 }
58
59 return result;
60 }
61}
62
63using namespace TilerEngineHelper;

Callers 4

TEST_FFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.40