Skip to content

Commit

Permalink
Rename the project name.
Browse files Browse the repository at this point in the history
  • Loading branch information
europeanplaice committed Feb 20, 2022
1 parent d96f61c commit aac1b36
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subset_sum"
version = "0.10.0"
version = "0.10.1"
edition = "2018"
authors = ["Tomohiro Endo <europeanplaice@gmail.com>"]
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."
Expand All @@ -19,7 +19,7 @@ rand = "0.8.5"
criterion = "0.3"

[lib]
name = "subset_sum_py"
name = "dpss"
crate-type = ["cdylib"]

[dependencies.pyo3]
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[project]
name = "dpss"

[build-system]
requires = ["maturin>=0.12,<0.13"]
build-backend = "maturin"
18 changes: 10 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Subset Sum
# Subset Sum(dpss)

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.
This is a Rust implementation that calculates subset sum problem using dynamic programming. 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.

`dpss` is short for `dynamic programming subset sum`.

## 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.
Expand Down Expand Up @@ -103,15 +105,15 @@ There are a lot of combinations!
## Use in Python
### installation
```
pip install subset_sum
pip install dpss
```
### Usage
```python
import subset_sum_py
print(subset_sum_py.find_subset([1, 2, 3], 2))
print(subset_sum_py.find_subset_fast_only_positive([1, 2, 3], 2))
print(subset_sum_py.sequence_matcher([1, 2, 3], [1, 2, 3]))
print(subset_sum_py.sequence_matcher_m2m([1, 2, 3], [1, 2, 3]))
import dpss
print(dpss.find_subset([1, 2, 3], 2))
print(dpss.find_subset_fast_only_positive([1, 2, 3], 2))
print(dpss.sequence_matcher([1, 2, 3], [1, 2, 3]))
print(dpss.sequence_matcher_m2m([1, 2, 3], [1, 2, 3]))
```

## Use in Rust
Expand Down
2 changes: 1 addition & 1 deletion src/py_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn sequence_matcher_m2m(mut key: Vec<i32>, mut targets: Vec<i32>) -> PyResult<Ve
}

#[pymodule]
fn subset_sum_py(_py: Python, m: &PyModule) -> PyResult<()> {
fn dpss(_py: Python, m: &PyModule) -> PyResult<()> {
m.add_function(wrap_pyfunction!(find_subset, m)?)?;
m.add_function(wrap_pyfunction!(sequence_matcher, m)?)?;
m.add_function(wrap_pyfunction!(sequence_matcher_m2m, m)?)?;
Expand Down

0 comments on commit aac1b36

Please sign in to comment.