Loading [MathJax]/extensions/tex2jax.js
SyTen
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages

◆ regularise()

template<Rank rank, typename Scalar = CDef>
void syten::SparseTensor< rank, Scalar >::regularise ( )
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().

+ Here is the call graph for this function: