lapcpp 1.0.0__tar.gz → 1.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.
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/workflows/benchmark_batch.yaml +1 -1
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/workflows/benchmark_single.yaml +1 -1
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/workflows/benchmark_tracking.yaml +1 -1
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/workflows/integration.yaml +2 -2
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/workflows/native.yaml +1 -1
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/workflows/prepublish.yaml +3 -3
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/workflows/publish.yaml +2 -2
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/workflows/tests.yaml +3 -2
- {lapcpp-1.0.0 → lapcpp-1.1.1}/CHANGELOG.md +20 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/CONTRIBUTING.md +1 -1
- {lapcpp-1.0.0/lapcpp.egg-info → lapcpp-1.1.1}/PKG-INFO +19 -6
- {lapcpp-1.0.0 → lapcpp-1.1.1}/README.md +18 -5
- {lapcpp-1.0.0 → lapcpp-1.1.1}/docs/api.md +12 -6
- {lapcpp-1.0.0 → lapcpp-1.1.1}/lapcpp/__init__.py +1 -1
- {lapcpp-1.0.0 → lapcpp-1.1.1}/lapcpp/_lapjv.pyi +8 -1
- {lapcpp-1.0.0 → lapcpp-1.1.1/lapcpp.egg-info}/PKG-INFO +19 -6
- {lapcpp-1.0.0 → lapcpp-1.1.1}/lapcpp.egg-info/SOURCES.txt +1 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/src/_lapjv/_lapjv.cpp +216 -216
- {lapcpp-1.0.0 → lapcpp-1.1.1}/src/_lapjv/_lapjv.pyx +10 -6
- {lapcpp-1.0.0 → lapcpp-1.1.1}/src/_lapjv/solver.cpp +94 -46
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/README.md +16 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/native/test_solver.cpp +56 -0
- lapcpp-1.1.1/tests/test_float32_working_precision.py +325 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/test_lapjv.py +110 -41
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/constraints/numpy-armv7-build.txt +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/tests/README.md +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/tests/check_dist.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/tests/check_wheel.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/tests/conftest.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/tests/install_numpy_compat.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/tests/pytest.ini +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/tests/requirements.txt +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/tests/test_benchmarks.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/tests/test_editable_install.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/.github/tests/test_setup.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/LICENSE +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/MANIFEST.in +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/NOTICE +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/benchmarks/README.md +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/benchmarks/_common.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/benchmarks/benchmark_batch.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/benchmarks/benchmark_single.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/benchmarks/benchmark_tracking.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/benchmarks/ci_run.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/examples/basic.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/lapcpp/__init__.pyi +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/lapcpp/py.typed +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/lapcpp.egg-info/dependency_links.txt +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/lapcpp.egg-info/requires.txt +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/lapcpp.egg-info/top_level.txt +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/pyproject.toml +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/setup.cfg +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/setup.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/src/_lapjv/LICENSE +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/src/_lapjv/completion.cpp +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/src/_lapjv/lapjv.h +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/LICENSE +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/assignment_checks.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/check_native_errors.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/check_scipy_free.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/conftest.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/cost_eps.csv.gz +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/lapjv_cases.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/native/CMakeLists.txt +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/native/faults.h +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/regression_cases.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/test_batch_paths.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/test_core.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/test_cross_package.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/test_edge_cases.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/test_package.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/test_regressions.py +0 -0
- {lapcpp-1.0.0 → lapcpp-1.1.1}/tests/typing/return_types.py +0 -0
|
@@ -23,7 +23,7 @@ jobs:
|
|
|
23
23
|
strategy:
|
|
24
24
|
fail-fast: false
|
|
25
25
|
matrix:
|
|
26
|
-
os: [ubuntu-
|
|
26
|
+
os: [ubuntu-24.04, windows-latest, macos-latest]
|
|
27
27
|
python: ['3.9', '3.15']
|
|
28
28
|
runs-on: ${{ matrix.os }}
|
|
29
29
|
steps:
|
|
@@ -69,7 +69,7 @@ jobs:
|
|
|
69
69
|
strategy:
|
|
70
70
|
fail-fast: false
|
|
71
71
|
matrix:
|
|
72
|
-
os: [ubuntu-
|
|
72
|
+
os: [ubuntu-24.04, windows-latest, macos-latest]
|
|
73
73
|
python: ['3.9', '3.15']
|
|
74
74
|
runs-on: ${{ matrix.os }}
|
|
75
75
|
steps:
|
|
@@ -13,7 +13,7 @@ jobs:
|
|
|
13
13
|
strategy:
|
|
14
14
|
fail-fast: false
|
|
15
15
|
matrix:
|
|
16
|
-
os: [ubuntu-
|
|
16
|
+
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-15-intel, macos-latest]
|
|
17
17
|
runs-on: ${{ matrix.os }}
|
|
18
18
|
timeout-minutes: 20
|
|
19
19
|
steps:
|
|
@@ -36,11 +36,11 @@ jobs:
|
|
|
36
36
|
platform: win_arm64
|
|
37
37
|
msvc_arch: arm64
|
|
38
38
|
- name: manylinux-x86_64
|
|
39
|
-
os: ubuntu-
|
|
39
|
+
os: ubuntu-24.04
|
|
40
40
|
arch: x86_64
|
|
41
41
|
platform: manylinux_x86_64
|
|
42
42
|
- name: musllinux-x86_64
|
|
43
|
-
os: ubuntu-
|
|
43
|
+
os: ubuntu-24.04
|
|
44
44
|
arch: x86_64
|
|
45
45
|
platform: musllinux_x86_64
|
|
46
46
|
- name: manylinux-aarch64
|
|
@@ -117,7 +117,7 @@ jobs:
|
|
|
117
117
|
if-no-files-found: error
|
|
118
118
|
compression-level: 0
|
|
119
119
|
sdist:
|
|
120
|
-
runs-on: ubuntu-
|
|
120
|
+
runs-on: ubuntu-24.04
|
|
121
121
|
steps:
|
|
122
122
|
- uses: actions/checkout@v7
|
|
123
123
|
- uses: actions/setup-python@v7
|
|
@@ -6,7 +6,7 @@ permissions:
|
|
|
6
6
|
contents: read
|
|
7
7
|
jobs:
|
|
8
8
|
version:
|
|
9
|
-
runs-on: ubuntu-
|
|
9
|
+
runs-on: ubuntu-24.04
|
|
10
10
|
steps:
|
|
11
11
|
- uses: actions/checkout@v7
|
|
12
12
|
- uses: actions/setup-python@v7
|
|
@@ -26,7 +26,7 @@ jobs:
|
|
|
26
26
|
# Integration, native and sanitizer suites run on PRs or manual dispatch.
|
|
27
27
|
publish:
|
|
28
28
|
needs: build
|
|
29
|
-
runs-on: ubuntu-
|
|
29
|
+
runs-on: ubuntu-24.04
|
|
30
30
|
environment:
|
|
31
31
|
name: pypi
|
|
32
32
|
url: https://pypi.org/p/lapcpp
|
|
@@ -13,7 +13,8 @@ jobs:
|
|
|
13
13
|
strategy:
|
|
14
14
|
fail-fast: false
|
|
15
15
|
matrix:
|
|
16
|
-
|
|
16
|
+
# Pin Ubuntu 24.04 so Python 3.9 remains available as runner defaults change.
|
|
17
|
+
os: [ubuntu-24.04, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-15-intel, macos-latest]
|
|
17
18
|
python: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14', '3.15']
|
|
18
19
|
exclude:
|
|
19
20
|
- os: windows-11-arm
|
|
@@ -56,7 +57,7 @@ jobs:
|
|
|
56
57
|
build/build-results.xml
|
|
57
58
|
numpy_compat:
|
|
58
59
|
name: NumPy ${{ matrix.numpy }} / Python ${{ matrix.python }}
|
|
59
|
-
runs-on: ubuntu-
|
|
60
|
+
runs-on: ubuntu-24.04
|
|
60
61
|
strategy:
|
|
61
62
|
fail-fast: false
|
|
62
63
|
matrix:
|
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.1 - 2026-10-28
|
|
4
|
+
|
|
5
|
+
- Use float64 potentials, distances and reduced-cost arithmetic for float32
|
|
6
|
+
rectangular and finite-limit assignments. Matrix storage stays float32;
|
|
7
|
+
required square assignments already used float64 working arithmetic.
|
|
8
|
+
- Preserve cost conversion, represented half-limit rounding, original-input
|
|
9
|
+
totals, APIs and initialization policies. Float64 working arithmetic improves
|
|
10
|
+
numerical robustness without guaranteeing exactness for arbitrary cost ranges.
|
|
11
|
+
- Add exact-objective regressions for small differences beside large costs,
|
|
12
|
+
including augmenting search and represented finite-limit rounding.
|
|
13
|
+
|
|
14
|
+
## 1.1.0 - 2026-10-26
|
|
15
|
+
|
|
16
|
+
- Bound row-reduction initialization on large rectangular required and finite-limit
|
|
17
|
+
assignments to reduce congestion overhead.
|
|
18
|
+
- Use exact inline finite checks and stabilize minimum-scan code placement in
|
|
19
|
+
native MSVC x64 builds.
|
|
20
|
+
- Preserve public APIs, precision options, and rejection semantics. Performance
|
|
21
|
+
changes depend on the workload.
|
|
22
|
+
|
|
3
23
|
## 1.0.0 - 2026-10-23
|
|
4
24
|
|
|
5
25
|
First stable release.
|
|
@@ -78,7 +78,7 @@ solver families. Preserve the LAPX and original upstream attribution in `NOTICE`
|
|
|
78
78
|
manual runs of the five-candidate comparison, with JSON artifacts.
|
|
79
79
|
|
|
80
80
|
Set up the PyPI Trusted Publisher for this repository, `publish.yaml`, environment
|
|
81
|
-
`pypi`, before publishing. Tag `v1.
|
|
81
|
+
`pypi`, before publishing. Tag `v1.1.1` only when releasing version 1.1.1. The
|
|
82
82
|
manual prepublish workflow creates artifacts without uploading them to PyPI.
|
|
83
83
|
Benchmark workflows accept counterpart and LAPX repository refs. LAPX defaults
|
|
84
84
|
to the `v0.11.1` release; record all
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lapcpp
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: Native C++ linear assignment solvers with implicit rejection and batch solving
|
|
5
5
|
Home-page: https://github.com/rathaROG/lapcpp
|
|
6
6
|
Author: Ratha SIV
|
|
@@ -125,21 +125,34 @@ lapjv_batch(costs, extend_cost=False, cost_limit=np.inf, return_cost=True,
|
|
|
125
125
|
| --- | --- |
|
|
126
126
|
| `cost` / `costs` | Real numeric arrays with shape `(N, M)` / `(B, N, M)`. |
|
|
127
127
|
| `extend_cost=True` | Allows rectangular inputs when the limit is infinite; no square padding is used. |
|
|
128
|
-
| `cost_limit` | A finite value permits unmatched endpoints
|
|
128
|
+
| `cost_limit` | A finite value permits unmatched endpoints, each charged `cost_limit / 2` rounded to the selected cost dtype. Finite limits also permit rectangles and apply to square inputs. |
|
|
129
129
|
| `return_cost` | Defaults to `True`; totals sum selected original costs in float64 and exclude rejection penalties. `False` omits totals and skips the sum. |
|
|
130
130
|
| `precision` | `"native"` preserves float32/float64; other real numeric inputs use float64. Explicit `"float32"` / `"float64"` select working costs. |
|
|
131
131
|
| `output` | `"indices"` returns aligned row/column arrays; `"pairs"` returns `(K, 2)` arrays. |
|
|
132
132
|
| `n_threads` | Batch only. `0` / `None` selects automatically; negative values use one worker; positive values are capped by batch size. |
|
|
133
133
|
|
|
134
|
+
All solver paths use float64 potentials, distances and reduced-cost arithmetic,
|
|
135
|
+
while matrix storage follows `precision`. Finite-limit half-penalties retain
|
|
136
|
+
rounding in that selected cost dtype before search. This reduces cancellation
|
|
137
|
+
with float32 costs without widening the whole matrix. Extreme cost ranges and
|
|
138
|
+
cost conversion can still obscure small objective differences; this is not an
|
|
139
|
+
arbitrary-range exactness guarantee.
|
|
140
|
+
|
|
134
141
|
Rows are sorted and all returned indices are int64. They identify the selected
|
|
135
142
|
pairs; unmatched items are absent. Batch results contain lists because each
|
|
136
143
|
problem may select a different number of pairs. Equal-cost optima may return
|
|
137
144
|
different assignments across solvers or precisions.
|
|
138
145
|
|
|
139
|
-
With a finite limit `L`,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
146
|
+
With a finite limit `L`, define `h = cost_dtype(L/2)`, where `cost_dtype` is
|
|
147
|
+
the cost storage dtype selected by `precision`. The optimized objective is
|
|
148
|
+
`sum(selected represented costs) + (N + M - 2*K) * h`, where `N` and `M`
|
|
149
|
+
are the input dimensions and `K` is the number of selected pairs.
|
|
150
|
+
Represented costs are the input values after conversion to that cost dtype.
|
|
151
|
+
|
|
152
|
+
The reported `total` separately sums the selected **original-input values** in
|
|
153
|
+
float64 and excludes rejection penalties. It can differ from the represented-cost
|
|
154
|
+
sum when conversion rounds input values. Joint rejection is different from
|
|
155
|
+
solving a full assignment and then filtering high-cost pairs.
|
|
143
156
|
See [API details](docs/api.md) for numerical and memory behavior.
|
|
144
157
|
|
|
145
158
|
## Development and checks
|
|
@@ -59,21 +59,34 @@ lapjv_batch(costs, extend_cost=False, cost_limit=np.inf, return_cost=True,
|
|
|
59
59
|
| --- | --- |
|
|
60
60
|
| `cost` / `costs` | Real numeric arrays with shape `(N, M)` / `(B, N, M)`. |
|
|
61
61
|
| `extend_cost=True` | Allows rectangular inputs when the limit is infinite; no square padding is used. |
|
|
62
|
-
| `cost_limit` | A finite value permits unmatched endpoints
|
|
62
|
+
| `cost_limit` | A finite value permits unmatched endpoints, each charged `cost_limit / 2` rounded to the selected cost dtype. Finite limits also permit rectangles and apply to square inputs. |
|
|
63
63
|
| `return_cost` | Defaults to `True`; totals sum selected original costs in float64 and exclude rejection penalties. `False` omits totals and skips the sum. |
|
|
64
64
|
| `precision` | `"native"` preserves float32/float64; other real numeric inputs use float64. Explicit `"float32"` / `"float64"` select working costs. |
|
|
65
65
|
| `output` | `"indices"` returns aligned row/column arrays; `"pairs"` returns `(K, 2)` arrays. |
|
|
66
66
|
| `n_threads` | Batch only. `0` / `None` selects automatically; negative values use one worker; positive values are capped by batch size. |
|
|
67
67
|
|
|
68
|
+
All solver paths use float64 potentials, distances and reduced-cost arithmetic,
|
|
69
|
+
while matrix storage follows `precision`. Finite-limit half-penalties retain
|
|
70
|
+
rounding in that selected cost dtype before search. This reduces cancellation
|
|
71
|
+
with float32 costs without widening the whole matrix. Extreme cost ranges and
|
|
72
|
+
cost conversion can still obscure small objective differences; this is not an
|
|
73
|
+
arbitrary-range exactness guarantee.
|
|
74
|
+
|
|
68
75
|
Rows are sorted and all returned indices are int64. They identify the selected
|
|
69
76
|
pairs; unmatched items are absent. Batch results contain lists because each
|
|
70
77
|
problem may select a different number of pairs. Equal-cost optima may return
|
|
71
78
|
different assignments across solvers or precisions.
|
|
72
79
|
|
|
73
|
-
With a finite limit `L`,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
With a finite limit `L`, define `h = cost_dtype(L/2)`, where `cost_dtype` is
|
|
81
|
+
the cost storage dtype selected by `precision`. The optimized objective is
|
|
82
|
+
`sum(selected represented costs) + (N + M - 2*K) * h`, where `N` and `M`
|
|
83
|
+
are the input dimensions and `K` is the number of selected pairs.
|
|
84
|
+
Represented costs are the input values after conversion to that cost dtype.
|
|
85
|
+
|
|
86
|
+
The reported `total` separately sums the selected **original-input values** in
|
|
87
|
+
float64 and excludes rejection penalties. It can differ from the represented-cost
|
|
88
|
+
sum when conversion rounds input values. Joint rejection is different from
|
|
89
|
+
solving a full assignment and then filtering high-cost pairs.
|
|
77
90
|
See [API details](docs/api.md) for numerical and memory behavior.
|
|
78
91
|
|
|
79
92
|
## Development and checks
|
|
@@ -44,12 +44,18 @@ are converted to float64. Explicit conversion to float32 rejects finite values
|
|
|
44
44
|
or limits outside the float32 range. Integer inputs are converted to float64,
|
|
45
45
|
so integers outside its exact range can lose precision.
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
the rounded working
|
|
47
|
+
All paths keep potentials, distances and reduced-cost arithmetic in float64,
|
|
48
|
+
while matrix storage follows the selected cost precision. For finite limits,
|
|
49
|
+
each half-penalty is rounded in that cost dtype; the represented halves are
|
|
50
|
+
combined there before search uses float64. The returned total always sums the
|
|
51
|
+
original selected costs in float64 before any requested float32 conversion.
|
|
52
|
+
Changing precision can change the optimal assignment of the rounded working
|
|
53
|
+
problem.
|
|
54
|
+
|
|
55
|
+
Float64 working arithmetic reduces cancellation with float32 costs without
|
|
56
|
+
widening the whole matrix. It cannot restore costs rounded by conversion, and
|
|
57
|
+
sufficiently extreme magnitude differences can still obscure small objective
|
|
58
|
+
differences. It is not an arbitrary-range exactness guarantee.
|
|
53
59
|
|
|
54
60
|
Suitable aligned, contiguous, native-endian arrays are borrowed. Layout,
|
|
55
61
|
endianness or dtype conversion can require an input copy. Native rectangles
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Native C++ linear assignment solvers with implicit rejection and batch solving."""
|
|
2
2
|
from ._lapjv import lapjv, lapjv_batch
|
|
3
3
|
|
|
4
|
-
__version__ = "1.
|
|
4
|
+
__version__ = "1.1.1"
|
|
5
5
|
__author__ = 'Ratha SIV'
|
|
6
6
|
__description__ = 'Native C++ linear assignment solvers with implicit rejection and batch solving.'
|
|
7
7
|
__homepage__ = 'https://github.com/rathaROG/lapcpp'
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# Copyright (c) 2026 Ratha SIV | MIT License
|
|
2
2
|
|
|
3
|
-
"""Static signatures and documentation for the lapcpp entry points.
|
|
3
|
+
"""Static signatures and documentation for the lapcpp entry points.
|
|
4
|
+
|
|
5
|
+
Precision selects cost storage/conversion. All paths use float64 working
|
|
6
|
+
potentials, distances, and reduced-cost arithmetic. Finite half-limits remain
|
|
7
|
+
rounded in the selected cost dtype; returned totals use original input costs.
|
|
8
|
+
Widening does not restore converted-away distinctions or guarantee exactness
|
|
9
|
+
for arbitrary cost ranges.
|
|
10
|
+
"""
|
|
4
11
|
|
|
5
12
|
from typing import Any, List, Optional, Tuple, Union, overload
|
|
6
13
|
from typing import Literal, Protocol
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lapcpp
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: Native C++ linear assignment solvers with implicit rejection and batch solving
|
|
5
5
|
Home-page: https://github.com/rathaROG/lapcpp
|
|
6
6
|
Author: Ratha SIV
|
|
@@ -125,21 +125,34 @@ lapjv_batch(costs, extend_cost=False, cost_limit=np.inf, return_cost=True,
|
|
|
125
125
|
| --- | --- |
|
|
126
126
|
| `cost` / `costs` | Real numeric arrays with shape `(N, M)` / `(B, N, M)`. |
|
|
127
127
|
| `extend_cost=True` | Allows rectangular inputs when the limit is infinite; no square padding is used. |
|
|
128
|
-
| `cost_limit` | A finite value permits unmatched endpoints
|
|
128
|
+
| `cost_limit` | A finite value permits unmatched endpoints, each charged `cost_limit / 2` rounded to the selected cost dtype. Finite limits also permit rectangles and apply to square inputs. |
|
|
129
129
|
| `return_cost` | Defaults to `True`; totals sum selected original costs in float64 and exclude rejection penalties. `False` omits totals and skips the sum. |
|
|
130
130
|
| `precision` | `"native"` preserves float32/float64; other real numeric inputs use float64. Explicit `"float32"` / `"float64"` select working costs. |
|
|
131
131
|
| `output` | `"indices"` returns aligned row/column arrays; `"pairs"` returns `(K, 2)` arrays. |
|
|
132
132
|
| `n_threads` | Batch only. `0` / `None` selects automatically; negative values use one worker; positive values are capped by batch size. |
|
|
133
133
|
|
|
134
|
+
All solver paths use float64 potentials, distances and reduced-cost arithmetic,
|
|
135
|
+
while matrix storage follows `precision`. Finite-limit half-penalties retain
|
|
136
|
+
rounding in that selected cost dtype before search. This reduces cancellation
|
|
137
|
+
with float32 costs without widening the whole matrix. Extreme cost ranges and
|
|
138
|
+
cost conversion can still obscure small objective differences; this is not an
|
|
139
|
+
arbitrary-range exactness guarantee.
|
|
140
|
+
|
|
134
141
|
Rows are sorted and all returned indices are int64. They identify the selected
|
|
135
142
|
pairs; unmatched items are absent. Batch results contain lists because each
|
|
136
143
|
problem may select a different number of pairs. Equal-cost optima may return
|
|
137
144
|
different assignments across solvers or precisions.
|
|
138
145
|
|
|
139
|
-
With a finite limit `L`,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
146
|
+
With a finite limit `L`, define `h = cost_dtype(L/2)`, where `cost_dtype` is
|
|
147
|
+
the cost storage dtype selected by `precision`. The optimized objective is
|
|
148
|
+
`sum(selected represented costs) + (N + M - 2*K) * h`, where `N` and `M`
|
|
149
|
+
are the input dimensions and `K` is the number of selected pairs.
|
|
150
|
+
Represented costs are the input values after conversion to that cost dtype.
|
|
151
|
+
|
|
152
|
+
The reported `total` separately sums the selected **original-input values** in
|
|
153
|
+
float64 and excludes rejection penalties. It can differ from the represented-cost
|
|
154
|
+
sum when conversion rounds input values. Joint rejection is different from
|
|
155
|
+
solving a full assignment and then filtering high-cost pairs.
|
|
143
156
|
See [API details](docs/api.md) for numerical and memory behavior.
|
|
144
157
|
|
|
145
158
|
## Development and checks
|