fastlap 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fastlap-0.1.1/.github/CHANGELOG.md +16 -0
- fastlap-0.1.1/.github/workflows/CI.yml +54 -0
- fastlap-0.1.1/.gitignore +84 -0
- fastlap-0.1.1/Cargo.lock +387 -0
- fastlap-0.1.1/Cargo.toml +14 -0
- fastlap-0.1.1/LICENSE +21 -0
- fastlap-0.1.1/PKG-INFO +82 -0
- fastlap-0.1.1/README.md +60 -0
- fastlap-0.1.1/fastlap/__init__.py +0 -0
- fastlap-0.1.1/fastlap/examples.py +66 -0
- fastlap-0.1.1/pyproject.toml +33 -0
- fastlap-0.1.1/src/lap.rs +343 -0
- fastlap-0.1.1/src/lib.rs +32 -0
- fastlap-0.1.1/src/matrix.rs +78 -0
- fastlap-0.1.1/tests/conftest.py +32 -0
- fastlap-0.1.1/tests/test_correctness.py +63 -0
- fastlap-0.1.1/tests/test_performance.py +42 -0
- fastlap-0.1.1/uv.lock +823 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
runs-on: ${{ matrix.os }}
|
|
8
|
+
strategy:
|
|
9
|
+
matrix:
|
|
10
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v3
|
|
14
|
+
|
|
15
|
+
- name: Set up Python
|
|
16
|
+
uses: actions/setup-python@v4
|
|
17
|
+
with:
|
|
18
|
+
python-version: '3.10'
|
|
19
|
+
|
|
20
|
+
- name: Install Rust
|
|
21
|
+
uses: actions-rs/toolchain@v1
|
|
22
|
+
with:
|
|
23
|
+
toolchain: stable
|
|
24
|
+
profile: minimal
|
|
25
|
+
override: true
|
|
26
|
+
|
|
27
|
+
- name: Install maturin
|
|
28
|
+
run: pip install maturin
|
|
29
|
+
|
|
30
|
+
- name: Build wheels
|
|
31
|
+
run: maturin build --release --out dist --features=pyo3/extension-module
|
|
32
|
+
env:
|
|
33
|
+
MATURIN_PYTHON: python3.10
|
|
34
|
+
|
|
35
|
+
- name: Upload wheels
|
|
36
|
+
uses: actions/upload-artifact@v3
|
|
37
|
+
with:
|
|
38
|
+
name: wheels
|
|
39
|
+
path: target/wheels/*.whl
|
|
40
|
+
|
|
41
|
+
publish:
|
|
42
|
+
needs: build
|
|
43
|
+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/download-artifact@v3
|
|
47
|
+
with:
|
|
48
|
+
name: wheels
|
|
49
|
+
path: dist
|
|
50
|
+
|
|
51
|
+
- name: Publish to PyPI
|
|
52
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
53
|
+
with:
|
|
54
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
fastlap-0.1.1/.gitignore
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Generated by Cargo
|
|
2
|
+
# will have compiled files and executables
|
|
3
|
+
debug/
|
|
4
|
+
target/
|
|
5
|
+
|
|
6
|
+
# These are backup files generated by rustfmt
|
|
7
|
+
**/*.rs.bk
|
|
8
|
+
|
|
9
|
+
# MSVC Windows builds of rustc generate these, which store debugging information
|
|
10
|
+
*.pdb
|
|
11
|
+
|
|
12
|
+
# Generated by cargo mutants
|
|
13
|
+
# Contains mutation testing data
|
|
14
|
+
**/mutants.out*/
|
|
15
|
+
|
|
16
|
+
# RustRover
|
|
17
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
18
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
19
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
20
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
21
|
+
#.idea/
|
|
22
|
+
|
|
23
|
+
# Python
|
|
24
|
+
__pycache__/
|
|
25
|
+
*.py[cod]
|
|
26
|
+
*$py.class
|
|
27
|
+
*.so
|
|
28
|
+
.Python
|
|
29
|
+
build/
|
|
30
|
+
develop-eggs/
|
|
31
|
+
dist/
|
|
32
|
+
downloads/
|
|
33
|
+
eggs/
|
|
34
|
+
.eggs/
|
|
35
|
+
lib/
|
|
36
|
+
lib64/
|
|
37
|
+
parts/
|
|
38
|
+
sdist/
|
|
39
|
+
var/
|
|
40
|
+
wheels/
|
|
41
|
+
*.egg-info/
|
|
42
|
+
.installed.cfg
|
|
43
|
+
*.egg
|
|
44
|
+
|
|
45
|
+
# Virtual Environment
|
|
46
|
+
venv/
|
|
47
|
+
env/
|
|
48
|
+
ENV/
|
|
49
|
+
|
|
50
|
+
# IDE specific files
|
|
51
|
+
.vscode/
|
|
52
|
+
*.swp
|
|
53
|
+
*.swo
|
|
54
|
+
|
|
55
|
+
# Jupyter Notebook
|
|
56
|
+
.ipynb_checkpoints
|
|
57
|
+
*/.ipynb_checkpoints/*
|
|
58
|
+
|
|
59
|
+
# mypy
|
|
60
|
+
.mypy_cache/
|
|
61
|
+
.dmypy.json
|
|
62
|
+
dmypy.json
|
|
63
|
+
|
|
64
|
+
# Pyre type checker
|
|
65
|
+
.pyre/
|
|
66
|
+
|
|
67
|
+
# pytest
|
|
68
|
+
.pytest_cache/
|
|
69
|
+
.coverage
|
|
70
|
+
htmlcov/
|
|
71
|
+
|
|
72
|
+
# Environment variables
|
|
73
|
+
.env
|
|
74
|
+
.venv
|
|
75
|
+
env/
|
|
76
|
+
venv/
|
|
77
|
+
ENV/
|
|
78
|
+
|
|
79
|
+
# Distribution / packaging
|
|
80
|
+
.Python
|
|
81
|
+
build/
|
|
82
|
+
*.pyc
|
|
83
|
+
|
|
84
|
+
.ruff_cache
|
fastlap-0.1.1/Cargo.lock
ADDED
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "alga"
|
|
7
|
+
version = "0.9.3"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "4f823d037a7ec6ea2197046bafd4ae150e6bc36f9ca347404f46a46823fa84f2"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"approx",
|
|
12
|
+
"num-complex 0.2.4",
|
|
13
|
+
"num-traits",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
[[package]]
|
|
17
|
+
name = "anyhow"
|
|
18
|
+
version = "1.0.98"
|
|
19
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
20
|
+
checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
|
|
21
|
+
|
|
22
|
+
[[package]]
|
|
23
|
+
name = "approx"
|
|
24
|
+
version = "0.3.2"
|
|
25
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
26
|
+
checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3"
|
|
27
|
+
dependencies = [
|
|
28
|
+
"num-traits",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
[[package]]
|
|
32
|
+
name = "autocfg"
|
|
33
|
+
version = "1.5.0"
|
|
34
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
35
|
+
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
|
|
36
|
+
|
|
37
|
+
[[package]]
|
|
38
|
+
name = "crossbeam-deque"
|
|
39
|
+
version = "0.8.6"
|
|
40
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
41
|
+
checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51"
|
|
42
|
+
dependencies = [
|
|
43
|
+
"crossbeam-epoch",
|
|
44
|
+
"crossbeam-utils",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[[package]]
|
|
48
|
+
name = "crossbeam-epoch"
|
|
49
|
+
version = "0.9.18"
|
|
50
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
51
|
+
checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
|
|
52
|
+
dependencies = [
|
|
53
|
+
"crossbeam-utils",
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
[[package]]
|
|
57
|
+
name = "crossbeam-utils"
|
|
58
|
+
version = "0.8.21"
|
|
59
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
60
|
+
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
|
|
61
|
+
|
|
62
|
+
[[package]]
|
|
63
|
+
name = "either"
|
|
64
|
+
version = "1.15.0"
|
|
65
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
66
|
+
checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
|
|
67
|
+
|
|
68
|
+
[[package]]
|
|
69
|
+
name = "fastlap"
|
|
70
|
+
version = "0.1.1"
|
|
71
|
+
dependencies = [
|
|
72
|
+
"numpy",
|
|
73
|
+
"pyo3",
|
|
74
|
+
"sprs",
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
[[package]]
|
|
78
|
+
name = "heck"
|
|
79
|
+
version = "0.5.0"
|
|
80
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
81
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
82
|
+
|
|
83
|
+
[[package]]
|
|
84
|
+
name = "hermit-abi"
|
|
85
|
+
version = "0.5.2"
|
|
86
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
87
|
+
checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
|
|
88
|
+
|
|
89
|
+
[[package]]
|
|
90
|
+
name = "indoc"
|
|
91
|
+
version = "2.0.6"
|
|
92
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
93
|
+
checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd"
|
|
94
|
+
|
|
95
|
+
[[package]]
|
|
96
|
+
name = "libc"
|
|
97
|
+
version = "0.2.174"
|
|
98
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
99
|
+
checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
|
|
100
|
+
|
|
101
|
+
[[package]]
|
|
102
|
+
name = "libm"
|
|
103
|
+
version = "0.2.15"
|
|
104
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
105
|
+
checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
|
|
106
|
+
|
|
107
|
+
[[package]]
|
|
108
|
+
name = "matrixmultiply"
|
|
109
|
+
version = "0.3.10"
|
|
110
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
111
|
+
checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08"
|
|
112
|
+
dependencies = [
|
|
113
|
+
"autocfg",
|
|
114
|
+
"rawpointer",
|
|
115
|
+
]
|
|
116
|
+
|
|
117
|
+
[[package]]
|
|
118
|
+
name = "memoffset"
|
|
119
|
+
version = "0.9.1"
|
|
120
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
121
|
+
checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
|
|
122
|
+
dependencies = [
|
|
123
|
+
"autocfg",
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
[[package]]
|
|
127
|
+
name = "ndarray"
|
|
128
|
+
version = "0.16.1"
|
|
129
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
130
|
+
checksum = "882ed72dce9365842bf196bdeedf5055305f11fc8c03dee7bb0194a6cad34841"
|
|
131
|
+
dependencies = [
|
|
132
|
+
"matrixmultiply",
|
|
133
|
+
"num-complex 0.4.6",
|
|
134
|
+
"num-integer",
|
|
135
|
+
"num-traits",
|
|
136
|
+
"portable-atomic",
|
|
137
|
+
"portable-atomic-util",
|
|
138
|
+
"rawpointer",
|
|
139
|
+
]
|
|
140
|
+
|
|
141
|
+
[[package]]
|
|
142
|
+
name = "num-complex"
|
|
143
|
+
version = "0.2.4"
|
|
144
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
145
|
+
checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95"
|
|
146
|
+
dependencies = [
|
|
147
|
+
"autocfg",
|
|
148
|
+
"num-traits",
|
|
149
|
+
]
|
|
150
|
+
|
|
151
|
+
[[package]]
|
|
152
|
+
name = "num-complex"
|
|
153
|
+
version = "0.4.6"
|
|
154
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
155
|
+
checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
|
|
156
|
+
dependencies = [
|
|
157
|
+
"num-traits",
|
|
158
|
+
]
|
|
159
|
+
|
|
160
|
+
[[package]]
|
|
161
|
+
name = "num-integer"
|
|
162
|
+
version = "0.1.46"
|
|
163
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
164
|
+
checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
|
|
165
|
+
dependencies = [
|
|
166
|
+
"num-traits",
|
|
167
|
+
]
|
|
168
|
+
|
|
169
|
+
[[package]]
|
|
170
|
+
name = "num-traits"
|
|
171
|
+
version = "0.2.19"
|
|
172
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
173
|
+
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
|
|
174
|
+
dependencies = [
|
|
175
|
+
"autocfg",
|
|
176
|
+
"libm",
|
|
177
|
+
]
|
|
178
|
+
|
|
179
|
+
[[package]]
|
|
180
|
+
name = "num_cpus"
|
|
181
|
+
version = "1.17.0"
|
|
182
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
183
|
+
checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b"
|
|
184
|
+
dependencies = [
|
|
185
|
+
"hermit-abi",
|
|
186
|
+
"libc",
|
|
187
|
+
]
|
|
188
|
+
|
|
189
|
+
[[package]]
|
|
190
|
+
name = "numpy"
|
|
191
|
+
version = "0.25.0"
|
|
192
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
193
|
+
checksum = "29f1dee9aa8d3f6f8e8b9af3803006101bb3653866ef056d530d53ae68587191"
|
|
194
|
+
dependencies = [
|
|
195
|
+
"libc",
|
|
196
|
+
"ndarray",
|
|
197
|
+
"num-complex 0.4.6",
|
|
198
|
+
"num-integer",
|
|
199
|
+
"num-traits",
|
|
200
|
+
"pyo3",
|
|
201
|
+
"pyo3-build-config",
|
|
202
|
+
"rustc-hash",
|
|
203
|
+
]
|
|
204
|
+
|
|
205
|
+
[[package]]
|
|
206
|
+
name = "once_cell"
|
|
207
|
+
version = "1.21.3"
|
|
208
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
209
|
+
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
|
|
210
|
+
|
|
211
|
+
[[package]]
|
|
212
|
+
name = "portable-atomic"
|
|
213
|
+
version = "1.11.1"
|
|
214
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
215
|
+
checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
|
|
216
|
+
|
|
217
|
+
[[package]]
|
|
218
|
+
name = "portable-atomic-util"
|
|
219
|
+
version = "0.2.4"
|
|
220
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
221
|
+
checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507"
|
|
222
|
+
dependencies = [
|
|
223
|
+
"portable-atomic",
|
|
224
|
+
]
|
|
225
|
+
|
|
226
|
+
[[package]]
|
|
227
|
+
name = "proc-macro2"
|
|
228
|
+
version = "1.0.95"
|
|
229
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
230
|
+
checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
|
|
231
|
+
dependencies = [
|
|
232
|
+
"unicode-ident",
|
|
233
|
+
]
|
|
234
|
+
|
|
235
|
+
[[package]]
|
|
236
|
+
name = "pyo3"
|
|
237
|
+
version = "0.25.1"
|
|
238
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
239
|
+
checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a"
|
|
240
|
+
dependencies = [
|
|
241
|
+
"anyhow",
|
|
242
|
+
"indoc",
|
|
243
|
+
"libc",
|
|
244
|
+
"memoffset",
|
|
245
|
+
"once_cell",
|
|
246
|
+
"portable-atomic",
|
|
247
|
+
"pyo3-build-config",
|
|
248
|
+
"pyo3-ffi",
|
|
249
|
+
"pyo3-macros",
|
|
250
|
+
"unindent",
|
|
251
|
+
]
|
|
252
|
+
|
|
253
|
+
[[package]]
|
|
254
|
+
name = "pyo3-build-config"
|
|
255
|
+
version = "0.25.1"
|
|
256
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
257
|
+
checksum = "458eb0c55e7ece017adeba38f2248ff3ac615e53660d7c71a238d7d2a01c7598"
|
|
258
|
+
dependencies = [
|
|
259
|
+
"once_cell",
|
|
260
|
+
"target-lexicon",
|
|
261
|
+
]
|
|
262
|
+
|
|
263
|
+
[[package]]
|
|
264
|
+
name = "pyo3-ffi"
|
|
265
|
+
version = "0.25.1"
|
|
266
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
267
|
+
checksum = "7114fe5457c61b276ab77c5055f206295b812608083644a5c5b2640c3102565c"
|
|
268
|
+
dependencies = [
|
|
269
|
+
"libc",
|
|
270
|
+
"pyo3-build-config",
|
|
271
|
+
]
|
|
272
|
+
|
|
273
|
+
[[package]]
|
|
274
|
+
name = "pyo3-macros"
|
|
275
|
+
version = "0.25.1"
|
|
276
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
277
|
+
checksum = "a8725c0a622b374d6cb051d11a0983786448f7785336139c3c94f5aa6bef7e50"
|
|
278
|
+
dependencies = [
|
|
279
|
+
"proc-macro2",
|
|
280
|
+
"pyo3-macros-backend",
|
|
281
|
+
"quote",
|
|
282
|
+
"syn",
|
|
283
|
+
]
|
|
284
|
+
|
|
285
|
+
[[package]]
|
|
286
|
+
name = "pyo3-macros-backend"
|
|
287
|
+
version = "0.25.1"
|
|
288
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
289
|
+
checksum = "4109984c22491085343c05b0dbc54ddc405c3cf7b4374fc533f5c3313a572ccc"
|
|
290
|
+
dependencies = [
|
|
291
|
+
"heck",
|
|
292
|
+
"proc-macro2",
|
|
293
|
+
"pyo3-build-config",
|
|
294
|
+
"quote",
|
|
295
|
+
"syn",
|
|
296
|
+
]
|
|
297
|
+
|
|
298
|
+
[[package]]
|
|
299
|
+
name = "quote"
|
|
300
|
+
version = "1.0.40"
|
|
301
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
302
|
+
checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
|
|
303
|
+
dependencies = [
|
|
304
|
+
"proc-macro2",
|
|
305
|
+
]
|
|
306
|
+
|
|
307
|
+
[[package]]
|
|
308
|
+
name = "rawpointer"
|
|
309
|
+
version = "0.2.1"
|
|
310
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
311
|
+
checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
|
|
312
|
+
|
|
313
|
+
[[package]]
|
|
314
|
+
name = "rayon"
|
|
315
|
+
version = "1.10.0"
|
|
316
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
317
|
+
checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa"
|
|
318
|
+
dependencies = [
|
|
319
|
+
"either",
|
|
320
|
+
"rayon-core",
|
|
321
|
+
]
|
|
322
|
+
|
|
323
|
+
[[package]]
|
|
324
|
+
name = "rayon-core"
|
|
325
|
+
version = "1.12.1"
|
|
326
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
327
|
+
checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
|
|
328
|
+
dependencies = [
|
|
329
|
+
"crossbeam-deque",
|
|
330
|
+
"crossbeam-utils",
|
|
331
|
+
]
|
|
332
|
+
|
|
333
|
+
[[package]]
|
|
334
|
+
name = "rustc-hash"
|
|
335
|
+
version = "2.1.1"
|
|
336
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
337
|
+
checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
|
|
338
|
+
|
|
339
|
+
[[package]]
|
|
340
|
+
name = "smallvec"
|
|
341
|
+
version = "1.15.1"
|
|
342
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
343
|
+
checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
|
|
344
|
+
|
|
345
|
+
[[package]]
|
|
346
|
+
name = "sprs"
|
|
347
|
+
version = "0.11.3"
|
|
348
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
349
|
+
checksum = "8bff8419009a08f6cb7519a602c5590241fbff1446bcc823c07af15386eb801b"
|
|
350
|
+
dependencies = [
|
|
351
|
+
"alga",
|
|
352
|
+
"ndarray",
|
|
353
|
+
"num-complex 0.4.6",
|
|
354
|
+
"num-traits",
|
|
355
|
+
"num_cpus",
|
|
356
|
+
"rayon",
|
|
357
|
+
"smallvec",
|
|
358
|
+
]
|
|
359
|
+
|
|
360
|
+
[[package]]
|
|
361
|
+
name = "syn"
|
|
362
|
+
version = "2.0.104"
|
|
363
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
364
|
+
checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40"
|
|
365
|
+
dependencies = [
|
|
366
|
+
"proc-macro2",
|
|
367
|
+
"quote",
|
|
368
|
+
"unicode-ident",
|
|
369
|
+
]
|
|
370
|
+
|
|
371
|
+
[[package]]
|
|
372
|
+
name = "target-lexicon"
|
|
373
|
+
version = "0.13.2"
|
|
374
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
375
|
+
checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a"
|
|
376
|
+
|
|
377
|
+
[[package]]
|
|
378
|
+
name = "unicode-ident"
|
|
379
|
+
version = "1.0.18"
|
|
380
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
381
|
+
checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
|
|
382
|
+
|
|
383
|
+
[[package]]
|
|
384
|
+
name = "unindent"
|
|
385
|
+
version = "0.2.4"
|
|
386
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
387
|
+
checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
|
fastlap-0.1.1/Cargo.toml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "fastlap"
|
|
3
|
+
version = "0.1.1"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
|
|
6
|
+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
7
|
+
[lib]
|
|
8
|
+
name = "fastlap"
|
|
9
|
+
crate-type = ["cdylib"]
|
|
10
|
+
|
|
11
|
+
[dependencies]
|
|
12
|
+
pyo3 = { version = "0.25.0", features = ["extension-module", "anyhow", "auto-initialize"] }
|
|
13
|
+
numpy = "0.25"
|
|
14
|
+
sprs = "0.11"
|
fastlap-0.1.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 octoopt
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
fastlap-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fastlap
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
|
+
Requires-Dist: lap>=0.4.0
|
|
8
|
+
Requires-Dist: maturin[patchelf]>=1.8.7
|
|
9
|
+
Requires-Dist: numpy>=1.20,<2.0
|
|
10
|
+
Requires-Dist: pytest>=7.0
|
|
11
|
+
Requires-Dist: scipy>=1.8
|
|
12
|
+
Requires-Dist: twine>=6.1.0
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Summary: Python’s LAP (Linear Assignment Problem) solver — written in Rust for performance
|
|
15
|
+
Keywords: lap,linear assignment problem,hungarian,lapjv,lapmod
|
|
16
|
+
Author: Le Duc Minh
|
|
17
|
+
Author-email: minh.leduc.0210@gmail.com
|
|
18
|
+
Maintainer-email: Le Duc Minh <minh.leduc.0210@gmail.com>
|
|
19
|
+
Requires-Python: >=3.8
|
|
20
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
21
|
+
|
|
22
|
+
# **fastlap**
|
|
23
|
+
|
|
24
|
+
**Python’s LAP (Linear Assignment Problem) solver — written in Rust for performance.**
|
|
25
|
+
|
|
26
|
+
`fastlap` delivers a blazing-fast implementation of popular assignment algorithms, including:
|
|
27
|
+
|
|
28
|
+
* **Jonker–Volgenant (LAPJV)**
|
|
29
|
+
* **Hungarian (a.k.a. Munkres)**
|
|
30
|
+
* **LAPMOD**
|
|
31
|
+
|
|
32
|
+
Built with [Rust](https://www.rust-lang.org/) and exposed to Python via [PyO3](https://pyo3.rs), `fastlap` combines performance and interoperability in a single lightweight package.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## 📖 Algorithms
|
|
36
|
+
|
|
37
|
+
* **LAPJV** — Efficient dual-based shortest augmenting path algorithm
|
|
38
|
+
*(Jonker & Volgenant, 1987)*
|
|
39
|
+
* **Hungarian Algorithm** — Classic method using row/column reduction and assignment phases
|
|
40
|
+
* **LAPMOD** — A modified variant for better performance under specific conditions
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## 🚀 Usage
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
import fastlap
|
|
47
|
+
|
|
48
|
+
# Example cost matrix
|
|
49
|
+
matrix = [
|
|
50
|
+
[1, 2, 3],
|
|
51
|
+
[4, 5, 6],
|
|
52
|
+
[7, 8, 9]
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
# Solve the LAP using LAPJV algorithm
|
|
56
|
+
cost, row_assign, col_assign = fastlap.solve_lap(matrix, method="lapjv")
|
|
57
|
+
|
|
58
|
+
print("Total cost:", cost)
|
|
59
|
+
print("Row assignments:", row_assign)
|
|
60
|
+
print("Column assignments:", col_assign)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
## 📄 Citation
|
|
65
|
+
|
|
66
|
+
If you use `fastlap` in your research or project, please cite the following:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
@misc{fastlap2025,
|
|
70
|
+
author = {Le Duc Minh},
|
|
71
|
+
title = {fastlap: A Python LAP solver powered by Rust},
|
|
72
|
+
year = {2025},
|
|
73
|
+
howpublished = {\url{https://github.com/8Opt/fastlap}},
|
|
74
|
+
note = {Python-Rust LAP solver implementing LAPJV, Hungarian, and LAPMOD}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## 📃 License
|
|
80
|
+
|
|
81
|
+
**MIT License** © 2025 — use it freely in commercial or open-source projects.
|
|
82
|
+
|