File: line-lengths.patch

package info (click to toggle)
python-lap 0.5.12-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,696 kB
  • sloc: python: 1,408; cpp: 872; sh: 24; makefile: 3
file content (104 lines) | stat: -rw-r--r-- 7,399 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
Description: Reduce line length in source files.
Author: Pieter Lenaerts
Forwarded: https://github.com/gatagat/lap/pull/67
Last-Update: 2025-08-20
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/README.md
+++ b/README.md
@@ -5,11 +5,21 @@
 
 # lap: Linear Assignment Problem Solver
 
-[`lap`](https://github.com/gatagat/lap) is a [linear assignment problem](https://en.wikipedia.org/wiki/Assignment_problem) solver using Jonker-Volgenant algorithm for dense LAPJV¹ or sparse LAPMOD² matrices. Both algorithms are implemented from scratch based solely on the papers¹˒² and the public domain Pascal implementation provided by A. Volgenant³. The LAPMOD implementation seems to be faster than the LAPJV implementation for matrices with a side of more than ~5000 and with less than 50% finite coefficients.
-
-<sup>¹ R. Jonker and A. Volgenant, "A Shortest Augmenting Path Algorithm for Dense and Sparse Linear Assignment Problems", Computing 38, 325-340 (1987) </sup><br>
-<sup>² A. Volgenant, "Linear and Semi-Assignment Problems: A Core Oriented Approach", Computer Ops Res. 23, 917-932 (1996) </sup><br>
-<sup>³ http://www.assignmentproblems.com/LAPJV.htm | [[archive.org](https://web.archive.org/web/20220221010749/http://www.assignmentproblems.com/LAPJV.htm)] </sup><br>
+[`lap`](https://github.com/gatagat/lap) is a [linear assignment
+problem](https://en.wikipedia.org/wiki/Assignment_problem) solver using
+Jonker-Volgenant algorithm for dense LAPJV¹ or sparse LAPMOD² matrices. Both
+algorithms are implemented from scratch based solely on the papers¹˒² and the
+public domain Pascal implementation provided by A. Volgenant³. The LAPMOD
+implementation seems to be faster than the LAPJV implementation for matrices
+with a side of more than ~5000 and with less than 50% finite coefficients.
+
+<sup>¹ R. Jonker and A. Volgenant, "A Shortest Augmenting Path Algorithm for
+Dense and Sparse Linear Assignment Problems", Computing 38, 325-340 (1987)
+</sup><br> <sup>² A. Volgenant, "Linear and Semi-Assignment Problems: A Core
+Oriented Approach", Computer Ops Res. 23, 917-932 (1996) </sup><br> <sup>³
+http://www.assignmentproblems.com/LAPJV.htm |
+[[archive.org](https://web.archive.org/web/20220221010749/http://www.assignmentproblems.com/LAPJV.htm)]
+</sup><br>
 
 ## 💽 Installation
 
@@ -65,13 +75,21 @@
 
 ### `cost, x, y = lap.lapjv(C)`
 
-The function `lapjv(C)` returns the assignment cost `cost` and two arrays `x` and `y`. If cost matrix `C` has shape NxM, then `x` is a size-N array specifying to which column each row is assigned, and `y` is a size-M array specifying to which row each column is assigned. For example, an output of `x = [1, 0]` indicates that row 0 is assigned to column 1 and row 1 is assigned to column 0. Similarly, an output of `x = [2, 1, 0]` indicates that row 0 is assigned to column 2, row 1 is assigned to column 1, and row 2 is assigned to column 0.
-
-Note that this function *does not* return the assignment matrix (as done by scipy's [`linear_sum_assignment`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.linear_sum_assignment.html) and lapsolver's [`solve dense`](https://github.com/cheind/py-lapsolver)). The assignment matrix can be constructed from `x` as follows:
-```
-A = np.zeros((N, M))
-for i in range(N):
-    A[i, x[i]] = 1
+The function `lapjv(C)` returns the assignment cost `cost` and two arrays `x`
+and `y`. If cost matrix `C` has shape NxM, then `x` is a size-N array
+specifying to which column each row is assigned, and `y` is a size-M array
+specifying to which row each column is assigned. For example, an output of `x =
+[1, 0]` indicates that row 0 is assigned to column 1 and row 1 is assigned to
+column 0. Similarly, an output of `x = [2, 1, 0]` indicates that row 0 is
+assigned to column 2, row 1 is assigned to column 1, and row 2 is assigned to
+column 0.
+
+Note that this function *does not* return the assignment matrix (as done by
+scipy's
+[`linear_sum_assignment`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.linear_sum_assignment.html)
+and lapsolver's [`solve dense`](https://github.com/cheind/py-lapsolver)). The
+assignment matrix can be constructed from `x` as follows: ``` A = np.zeros((N,
+M)) for i in range(N): A[i, x[i]] = 1
 ```
 
 Equivalently, we could construct the assignment matrix from `y`:
@@ -81,7 +99,8 @@
     A[y[j], j] = 1
 ```
 
-Finally, note that the outputs are redundant: we can construct `x` from `y`, and vise versa:
+Finally, note that the outputs are redundant: we can construct `x` from `y`,
+and vise versa:
 ```
 x = [np.where(y == i)[0][0] for i in range(N)]
 y = [np.where(x == j)[0][0] for j in range(M)]
--- a/LICENSE
+++ b/LICENSE
@@ -1,9 +1,21 @@
-Copyright (c) 2012-2024, Tomas Kazmar
-All rights reserved.
+Copyright (c) 2012-2024, Tomas Kazmar All rights reserved.
 
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
 
-    Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-    Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+    Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.  Redistributions in binary
+    form must reproduce the above copyright notice, this list of conditions and
+    the following disclaimer in the documentation and/or other materials
+    provided with the distribution.
 
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.