sym-ildl  1.2
Incomplete LDL' factorizations of indefinite symmetric and skew-symmetric matrices.
lilc_matrix_find_level_set.h
1 // -*- mode: c++ -*-
2 #ifndef _LILC_MATRIX_FIND_LEVEL_SET_H_
3 #define _LILC_MATRIX_FIND_LEVEL_SET_H_
4 
5 template<class el_type>
6 inline bool lilc_matrix<el_type> :: find_level_set(vector<int>& lvl_set, vector<bool>& visited) {
7  vector<int> new_set;
8  for (idx_it node_it = lvl_set.begin(); node_it != lvl_set.end(); node_it++) {
9 
10  for (idx_it it = list[*node_it].begin(); it != list[*node_it].end(); it++) {
11  if (!visited[*it]) {
12  visited[*it] = true;
13  new_set.push_back(*it);
14  }
15  }
16 
17  for (idx_it it = m_idx[*node_it].begin(); it != m_idx[*node_it].end(); it++) {
18  if (!visited[*it]) {
19  visited[*it] = true;
20  new_set.push_back(*it);
21  }
22  }
23  }
24 
25  if (new_set.empty()) return false;
26 
27  lvl_set.swap(new_set);
28  return true;
29 }
30 
31 #endif
bool find_level_set(vector< int > &lvl_set, vector< bool > &visited)
Returns the next level set given the current level set of A. This is essentially all neighbours of th...
Definition: lilc_matrix_find_level_set.h:6