Commit graph

13 commits

Author SHA1 Message Date
Alex Vanin
58a8ce4e47
Added weighted HRW sorting (#5)
* Added weighted HRW sorting

This commit proposes renaming of old `SortByWeight` functions to `Sort`
and implementation of `SortByWeight` function with explicit weights in
arguments. `SortByWeight` function calculates normalized hashes of
nodes and normalized input weights. Then multiplies these values to
obtain node's actual weight for later sorting.

- renamed `SortByWeight` function to `Sort`
- added `SortByWeight`, `SortSliceByWeightValue` and
  `SortSliceBeWeightIndex` functions
- moved code with reflection processing into `prepareRule` function
- added tests and benchmarks for new weighted functions
- added benchmark results into README

* Fixed comments
2019-05-27 10:45:29 +03:00
Evgeniy Kulikov
d32f396204
✌️ Fixed in SortSliceByValue issue when weight calculated twice (#4)
- fixes for SortSliceByValue
- fixes for tests
2019-05-24 12:51:39 +03:00
Evgeniy Kulikov
9a6fcdb1f8
🐌 hot fix types 2019-04-12 14:19:18 +03:00
Evgeniy Kulikov
e06640668d
🐿 Extend SortSliceByValue with more types 2019-04-12 14:09:49 +03:00
Evgeniy Kulikov
7462e26df6
Update to release version after [this issue](https://github.com/spaolacci/murmur3/issues/24) (#3) 2019-03-18 14:49:34 +03:00
Evgeniy Kulikov
e8ba64d915
Small refactoring (#2)
- Use val.Index(0).Interface().(type) in switch-case of SortSliceByValue
- add go1.12 to TravisCI
2019-03-14 15:48:58 +03:00
Evgeniy Kulikov
29dac15c96
Move repo to NSPCC (#1) 2019-02-01 14:30:34 +03:00
Alex Vanin
098fd24704 Support for int32 slices (#4) 2019-02-01 12:57:05 +03:00
Evgeniy Kulikov
e5d4b47881
Work around Hashing and tests (#2)
* Work around Hashing and tests

* fixes

* add TravisCI

* fix lint

* so slow

* add badges

* work on README

* Improved tests and get rid of fnv (#3)
2019-01-31 12:54:02 +03:00
Alex Vanin
cf9a7e5b89 Removed redundant m64 variable and tweaked uniform distribution test. (#1) 2019-01-30 12:32:34 +03:00
Evgeniy Kulikov
9b6321f99c
remove binaries from repo 2019-01-30 02:01:54 +03:00
Evgeniy Kulikov
01e85efd7e
Base HRW implementation in golang 2019-01-30 01:58:30 +03:00
Evgeniy Kulikov
ca071432c4
Initial commit 2019-01-29 22:43:14 +03:00