Exemple #1
0
        /// <summary>
        /// Fold the estimator.
        /// </summary>
        /// <param name="factor">Factor to fold by.</param>
        /// <param name="inPlace">When <c>true</c> the estimator will be replaced by a folded estimator, else <c>false</c>.</param>
        /// <returns></returns>
        public BitMinwiseHashEstimator <TEntity, TId, TCount> Fold(uint factor, bool inPlace = false)
        {
            var res = FullExtract().Fold(factor);

            if (inPlace)
            {
                Rehydrate(res);
                return(this);
            }
            var estimator = new BitMinwiseHashEstimator <TEntity, TId, TCount>(
                _configuration,
                res.BitSize,
                res.HashCount,
                res.Capacity);

            estimator.Rehydrate(res);
            return(estimator);
        }
Exemple #2
0
        /// <summary>
        /// Compress the estimator.
        /// </summary>
        /// <param name="inPlace"></param>
        /// <returns></returns>
        public IBitMinwiseHashEstimator <TEntity, TId, TCount> Compress(bool inPlace = false)
        {
            var res = FullExtract().Compress <TId, int>(_configuration);

            if (inPlace)
            {
                Rehydrate(res);
                return(this);
            }
            var estimatorRes = new BitMinwiseHashEstimator <TEntity, TId, TCount>(
                _configuration,
                _bitSize,
                _hashCount,
                _capacity);

            estimatorRes.Rehydrate(res);
            return(estimatorRes);
        }