Skip to content

num::accu

Defined in header <linear/matrix_utils.hpp>

real accu(const mat<real> &A);  // (1)

real accu(const vec<real> &v);  // (2)

(1) Sum the entries of a matrix: \(\sum_{ij} a_{ij}\).

(2) Sum the entries of a vector: \(\sum_i v_i\).