64 std::map<unsigned,unsigned> local_cell_id_location_index_map;
66 unsigned local_cell_id = 0;
68 cell_iter != pCellPopulation->
End();
74 assert(local_cell_id == num_cells);
77 std::vector<double> adjacency_matrix(num_cells*num_cells);
78 for (
unsigned i=0; i<num_cells*num_cells; i++)
80 adjacency_matrix[i] = 0;
84 cell_iter != pCellPopulation->
End();
88 bool cell_is_labelled = cell_iter->template HasCellProperty<CellLabel>();
97 if (!neighbour_indices.empty())
99 unsigned local_cell_index = local_cell_id_location_index_map[index];
101 for (std::set<unsigned>::iterator neighbour_iter = neighbour_indices.begin();
102 neighbour_iter != neighbour_indices.end();
106 unsigned type_of_link = 1;
110 bool neighbour_is_labelled = p_neighbour_cell->template HasCellProperty<CellLabel>();
112 if (cell_is_labelled != neighbour_is_labelled)
117 else if (cell_is_labelled)
123 unsigned local_neighbour_index = local_cell_id_location_index_map[*neighbour_iter];
124 adjacency_matrix[local_cell_index + num_cells*local_neighbour_index] = type_of_link;
125 adjacency_matrix[num_cells*local_cell_index + local_neighbour_index] = type_of_link;
131 *this->mpOutStream << num_cells <<
"\t";
132 for (
unsigned i=0; i<num_cells*num_cells; i++)
134 *this->mpOutStream << adjacency_matrix[i] <<
"\t";
143 pCellPopulation->
Update();
148 std::map<unsigned,unsigned> local_cell_id_location_index_map;
150 unsigned local_cell_id = 0;
152 cell_iter != pCellPopulation->
End();
158 assert(local_cell_id == num_cells);
161 std::vector<double> adjacency_matrix(num_cells*num_cells);
162 for (
unsigned i=0; i<num_cells*num_cells; i++)
164 adjacency_matrix[i] = 0;
168 cell_iter != pCellPopulation->
End();
172 bool cell_is_labelled = cell_iter->template HasCellProperty<CellLabel>();
181 if (!neighbour_indices.empty())
183 unsigned local_cell_index = local_cell_id_location_index_map[index];
185 for (std::set<unsigned>::iterator neighbour_iter = neighbour_indices.begin();
186 neighbour_iter != neighbour_indices.end();
190 unsigned type_of_link = 1;
194 bool neighbour_is_labelled = p_neighbour_cell->template HasCellProperty<CellLabel>();
196 if (cell_is_labelled != neighbour_is_labelled)
201 else if (cell_is_labelled)
207 unsigned local_neighbour_index = local_cell_id_location_index_map[*neighbour_iter];
208 adjacency_matrix[local_cell_index + num_cells*local_neighbour_index] = type_of_link;
209 adjacency_matrix[num_cells*local_cell_index + local_neighbour_index] = type_of_link;
215 *this->mpOutStream << num_cells <<
"\t";
216 for (
unsigned i=0; i<num_cells*num_cells; i++)
218 *this->mpOutStream << adjacency_matrix[i] <<
"\t";