Skip to content

Commit

Permalink
remove specialization and have a non-simd fallback for stable
Browse files Browse the repository at this point in the history
  • Loading branch information
alecmocatta committed Jul 10, 2020
1 parent b586347 commit 58ed461
Show file tree
Hide file tree
Showing 7 changed files with 229 additions and 162 deletions.
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ edition = "2018"
azure-devops = { project = "alecmocatta/streaming_algorithms", pipeline = "tests", build = "16" }
maintenance = { status = "actively-developed" }

[features]
nightly = ["packed_simd"]

[dependencies]
twox-hash = "1.1"
serde = { version = "1.0", features = ["derive"] }
rand = { version = "0.7", features = ["small_rng"] }
packed_simd = { version = "0.3", features = ["into_bits"] }
packed_simd = { version = "0.3", features = ["into_bits"], optional = true }
7 changes: 4 additions & 3 deletions src/count_min.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

use super::f64_to_usize;
use crate::traits::{Intersect, IntersectPlusUnionIsPlus, New, UnionAssign};
use serde::{Deserialize, Serialize};
use std::{
borrow::Borrow, cmp::max, convert::TryFrom, fmt, hash::{Hash, Hasher}, marker::PhantomData, ops
};
use twox_hash::XxHash;

use super::f64_to_usize;
use crate::traits::{Intersect, IntersectPlusUnionIsPlus, New, UnionAssign};

/// An implementation of a [count-min sketch](https://en.wikipedia.org/wiki/Count–min_sketch) data structure with *conservative updating* for increased accuracy.
///
/// This data structure is also known as a [counting Bloom filter](https://en.wikipedia.org/wiki/Bloom_filter#Counting_filters).
Expand Down Expand Up @@ -75,7 +76,7 @@ where
where
Q: Hash,
K: Borrow<Q>,
C: for<'a> ops::AddAssign<&'a V>,
C: for<'a> ops::AddAssign<&'a V> + IntersectPlusUnionIsPlus,
{
if !<C as IntersectPlusUnionIsPlus>::VAL {
let offsets = self.offsets(key);
Expand Down
Loading

0 comments on commit 58ed461

Please sign in to comment.