mean
| 326 | |
| 327 | /// mean |
| 328 | double mean(const Matrix& matrix) { |
| 329 | double avg = 0; |
| 330 | size_t N = matrix.size1() * matrix.size2(); |
| 331 | if (N > 0) { |
| 332 | avg = sum(matrix) / N; |
| 333 | } |
| 334 | return avg; |
| 335 | } |
| 336 | |
| 337 | /// get the connected components from an NxN adjacency matrix (1.0 for i-j connected, 0.0 for i-j not connected) |
| 338 | std::vector<std::vector<unsigned>> findConnectedComponents(const Matrix& matrix) { |