| 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(); |
no test coverage detected