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

Function get_non_zero_index

tools/Wires/Inflator/PhantomMeshGenerator.cpp:38–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37 template<typename Derived>
38 VectorI get_non_zero_index(const Eigen::MatrixBase<Derived>& data) {
39 std::list<size_t> indices;
40 const size_t num_entries = data.size();
41 for (size_t i=0; i<num_entries; i++) {
42 if (data(i, 0) != 0) {
43 indices.push_back(i);
44 }
45 }
46
47 const size_t num_non_zero_entries = indices.size();
48 VectorI result(num_non_zero_entries);
49 std::copy(indices.begin(), indices.end(), result.data());
50 return result;
51 }
52
53 void dilate(const MatrixIr& edges, std::vector<bool>& indicator) {
54 const size_t num_edges = edges.rows();

Callers 1

Calls 3

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected