alpha
Login
or
Join now
urschrei.eurosky.social
/
cvmcount
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Rust implementation of the CVM algorithm for counting distinct elements in a stream
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
Docstring
author
Stephan Hügel
date
2 years ago
(May 24, 2024, 1:45 PM +0100)
commit
ebebe916
ebebe9161b2071621d8399fb763aa32fef53763d
parent
3c43e77d
3c43e77d4644a38cd8555f2c81801a6d331e4724
+2
-1
1 changed file
Expand all
Collapse all
Unified
Split
src
lib.rs
+2
-1
src/lib.rs
Reviewed
···
4
4
use rand::rngs::ThreadRng;
5
5
use rand::Rng;
6
6
7
7
+
/// A counter implementing the CVM algorithm
7
8
pub struct CVM<T: PartialOrd + PartialEq> {
8
9
buf_size: usize,
9
10
buf: Vec<T>,
10
11
probability: f64,
11
12
rng: ThreadRng,
12
13
}
13
13
-
/// A counter implementing the CVM algorithm
14
14
+
14
15
impl<T: PartialOrd + PartialEq> CVM<T> {
15
16
/// Initialise the algorithm
16
17
///