public static T Sum <T>(this IMatrix <T> matrix) { return(matrix.Aggregate((a, b) => (dynamic)a + b)); }