34 void print(std::string
const& matrix_or_vector_name)
const
36 DBUG(
"Stats [{}]: {} elements added to the matrix cache.",
37 matrix_or_vector_name,
39 DBUG(
"Stats [{}]: {} nonzero elements added to the matrix cache.",
40 matrix_or_vector_name,
42 DBUG(
"Stats [{}]: {} elements added to the global matrix.",
43 matrix_or_vector_name,
68template <
typename Data>
70 :
public std::enable_shared_from_this<CumulativeStats<Data>>
72 using Base = std::enable_shared_from_this<CumulativeStats<Data>>;
77 static std::shared_ptr<CumulativeStats<Data>>
create()
79 return std::shared_ptr<CumulativeStats<Data>>(
85 std::shared_ptr<CumulativeStats<Data>>
clone()
87 return std::make_shared<CumulativeStats<Data>>(*this);
104 std::swap(
data, other.data);
116 DBUG(
"Adding cumulative stats to parent.");
126 std::shared_ptr<CumulativeStats<Data>>
parent_;
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
std::shared_ptr< std::mutex > parent_mutex_
static std::shared_ptr< CumulativeStats< Data > > create()
CumulativeStats(CumulativeStats< Data > &other)
CumulativeStats(CumulativeStats< Data > const &other)=delete
std::enable_shared_from_this< CumulativeStats< Data > > Base
std::shared_ptr< CumulativeStats< Data > > parent_
std::shared_ptr< CumulativeStats< Data > > clone()
CumulativeStats(CumulativeStats< Data > &&other)
MultiStats & operator+=(MultiStats const &other)
std::size_t count_nonzero
Stats & operator+=(Stats const &other)
void print(std::string const &matrix_or_vector_name) const