From 59ba6f92b34c0fa411443b340576c02d670b8c61 Mon Sep 17 00:00:00 2001 From: europeanplaice Date: Wed, 16 Feb 2022 07:01:28 +0900 Subject: [PATCH] Improve documentation --- Cargo.lock | 2 +- Cargo.toml | 4 ++-- readme.md | 2 +- src/dp_module.rs | 5 +---- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1301aac..bdba82a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -498,7 +498,7 @@ dependencies = [ [[package]] name = "subset_sum" -version = "0.8.0" +version = "0.8.1" dependencies = [ "criterion", "rand", diff --git a/Cargo.toml b/Cargo.toml index 2812308..6be4aad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "subset_sum" -version = "0.8.0" +version = "0.8.1" edition = "2018" authors = ["Tomohiro Endo "] -description = "Solves subset sum problem and return a set of decomposed integers." +description = "Solves subset sum problem and returns a set of decomposed integers. It also can match corresponding numbers from two vectors and be used for Account reconciliation." repository = "https://github.com/europeanplaice/subset_sum" readme = "readme.md" license = "MIT" diff --git a/readme.md b/readme.md index 297cdf4..c08aaad 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ # Subset Sum -This is a Rust implementation that calculates subset sum problem. It returns sets of integers that sum up to a target value. +This is a Rust implementation that calculates subset sum problem. It solves subset sum problem and returns a set of decomposed integers. It also can match corresponding numbers from two vectors and be used for Account reconciliation. ## Installation Binary files are provided on the [Releases](https://github.com/europeanplaice/subset_sum/releases) page. When you download one of these, please add it to your PATH manually. diff --git a/src/dp_module.rs b/src/dp_module.rs index c77a3af..8cb2d35 100644 --- a/src/dp_module.rs +++ b/src/dp_module.rs @@ -333,13 +333,12 @@ pub mod dp { n_max: usize ) -> Vec, VecDeque)>>{ - use rand::thread_rng; use rand::seq::SliceRandom; let mut group: Vec<(VecDeque, VecDeque)> = Vec::new(); let mut answer: Vec, VecDeque)>> = Vec::new(); let mut rng: rand::rngs::StdRng = rand::SeedableRng::from_seed([13; 32]); - for i in 0..n_max { + for _i in 0..n_max { sequence_matcher_core_m2m(key, targets, &mut group, &mut answer, 1, key.len(), &mut key.clone(), rng.clone()); key.shuffle(&mut rng); } @@ -354,9 +353,7 @@ pub mod dp { n_key: usize, len_key: usize, key_orig: &mut Vec, mut rng: rand::rngs::StdRng ){ - use rand::thread_rng; use rand::seq::SliceRandom; - use rand::{Rng, SeedableRng}; // if n_key == len_key{ // println!("finish n_key");