Combination
what it is
combination is a lib to do math jobs like permutate and combinate data from vec.
example
extern crate combination;
use *;
API
combine
Get combination data from a vec
- for example
extern crate combination;
use *;
let val = combine_vec;
for item in val
- and will get:
[10, 20]
[10, 30]
[10, 40]
[20, 30]
[20, 40]
[30, 40]
permutate
Get permutation data from a vec
- for example
extern crate combination;
use _;
let val = permutate_vec;
for item in val
- and will get:
[30, 10, 40, 20]
[30, 10, 20, 40]
[40, 10, 30, 20]
[10, 40, 30, 20]
[10, 30, 40, 20]
[10, 30, 20, 40]
[40, 10, 20, 30]
[10, 40, 20, 30]
[10, 20, 40, 30]
[10, 20, 30, 40]
[40, 30, 20, 10]
[30, 40, 20, 10]
[30, 20, 40, 10]
[30, 20, 10, 40]
[40, 20, 30, 10]
[20, 40, 30, 10]
[20, 30, 40, 10]
[20, 30, 10, 40]
[40, 20, 10, 30]
[20, 40, 10, 30]
[20, 10, 40, 30]
[20, 10, 30, 40]