template<typename T, typename CountT>
vt::util::adt::detail::Centroid struct

A centroid in the histogram with a value and count.

Public types

using CountType = CountT

Constructors, destructors, conversion operators

Centroid() defaulted
Centroid(T in_value, CountType in_count)
Construct a new centroid.

Public functions

auto getValue() const -> T
Get the value.
auto getCount() const -> CountType
Get the count.
void setValue(T in_value)
Set the value.
void setCount(CountType in_count)
Set the count.
void addCount(CountType in_add)
Add to the count.
void merge(Centroid<T, CountT> const& in)
Merge in another centroid.
auto isExact() const -> bool
Return if this centroid is exact or approximated.
template<typename SerializerT>
void serialize(SerializerT& s)

Friends

auto operator<(Centroid<T, CountT> const& c1, double val) -> bool
Compare a centroid to a double using the value.

Function documentation

template<typename T, typename CountT>
vt::util::adt::detail::Centroid<T, CountT>::Centroid(T in_value, CountType in_count)

Construct a new centroid.

Parameters
in_value in the value (p)
in_count in the count (m)

template<typename T, typename CountT>
T vt::util::adt::detail::Centroid<T, CountT>::getValue() const

Get the value.

Returns the value (p)

template<typename T, typename CountT>
CountType vt::util::adt::detail::Centroid<T, CountT>::getCount() const

Get the count.

Returns the value (m)

template<typename T, typename CountT>
void vt::util::adt::detail::Centroid<T, CountT>::setValue(T in_value)

Set the value.

Parameters
in_value in the value

template<typename T, typename CountT>
void vt::util::adt::detail::Centroid<T, CountT>::setCount(CountType in_count)

Set the count.

Parameters
in_count in the count

template<typename T, typename CountT>
void vt::util::adt::detail::Centroid<T, CountT>::addCount(CountType in_add)

Add to the count.

Parameters
in_add in amount to add

template<typename T, typename CountT>
void vt::util::adt::detail::Centroid<T, CountT>::merge(Centroid<T, CountT> const& in)

Merge in another centroid.

Parameters
in in the other centroid to merge

template<typename T, typename CountT>
bool vt::util::adt::detail::Centroid<T, CountT>::isExact() const

Return if this centroid is exact or approximated.

Returns whether it is exact

template<typename T, typename CountT>
bool operator<(Centroid<T, CountT> const& c1, double val)

Compare a centroid to a double using the value.

Parameters
c1 in the centroid
val in the value (a double) to compare
Returns whether it is less than the value