/*! * \file v3.cpp * \brief vv3 part of the exercise. * * \author * Christos Choutouridis AEM:8997 * */ #include #include #include namespace v3 { using index_t = typename matrix::indexType; using value_t = typename matrix::dataType; /*! * A naive triangle counting algorithm * \param A The adjacency matrix * \return The number of triangles */ std::vector triang_v(matrix& A) { std::vector c(A.size()); for (int i=0 ; i& v) { value_t s =0; for (auto& it : v) s += it; return s; } value_t triang_count (matrix& A) { auto v = triang_v(A); return sum(v); } }