|
inline |
Regularises the tensor, i.e.
~sets ranges of entries which are close to each other to their median.
Suppose we have entries 0.4999, 0.5, 0.75, 0.999, 1.00, 1.0001
, then it is reasonable to assume that 0.4999 = 0.5
and 0.999 = 1.00 = 1.0001
.
References std::vector< T >::begin(), syten::closeThreshold(), syten::SparseTensor< rank, Scalar >::FullData::elements, std::vector< T >::end(), syten::SparseTensor< rank, Scalar >::fullData, std::partition_point(), std::vector< T >::resize(), syten::SparseTensor< rank, Scalar >::singleton, std::vector< T >::size(), std::sort(), SYTEN_SMALL_THRESHOLD, and std::transform().