|
| 1 | +From e36ec985019d8ee3ef21739cc4fc6774f2336cd2 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Fredrik Johansson < [email protected]> |
| 3 | +Date: Sat, 14 Jun 2025 20:34:17 +0200 |
| 4 | +Subject: [PATCH] gr_mat_lu_classical: set permutation vector even if there are |
| 5 | + 0 columns |
| 6 | + |
| 7 | +--- |
| 8 | + src/gr_mat/lu_classical.c | 19 ++++++++++--------- |
| 9 | + 1 file changed, 10 insertions(+), 9 deletions(-) |
| 10 | + |
| 11 | +diff --git a/src/gr_mat/lu_classical.c b/src/gr_mat/lu_classical.c |
| 12 | +index 003cfd5d9b..a0043d40dd 100644 |
| 13 | +--- a/src/gr_mat/lu_classical.c |
| 14 | ++++ flint-3.3.0/src/gr_mat/lu_classical.c |
| 15 | +@@ -34,25 +34,26 @@ gr_mat_lu_classical(slong * res_rank, slong * P, gr_mat_t LU, const gr_mat_t A, |
| 16 | + int status = GR_SUCCESS; |
| 17 | + int pivot_status; |
| 18 | + |
| 19 | +- if (gr_mat_is_empty(A, ctx) == T_TRUE) |
| 20 | ++ m = gr_mat_nrows(A, ctx); |
| 21 | ++ n = gr_mat_ncols(A, ctx); |
| 22 | ++ |
| 23 | ++ rank = row = col = 0; |
| 24 | ++ for (i = 0; i < m; i++) |
| 25 | ++ P[i] = i; |
| 26 | ++ |
| 27 | ++ if (m == 0 || n == 0) |
| 28 | + { |
| 29 | + *res_rank = 0; |
| 30 | + return GR_SUCCESS; |
| 31 | + } |
| 32 | + |
| 33 | +- GR_TMP_INIT2(d, e, ctx); |
| 34 | +- |
| 35 | +- m = gr_mat_nrows(A, ctx); |
| 36 | +- n = gr_mat_ncols(A, ctx); |
| 37 | + sz = ctx->sizeof_elem; |
| 38 | + |
| 39 | + status |= gr_mat_set(LU, A, ctx); |
| 40 | + |
| 41 | +-#define ENTRY(ii, jj) GR_MAT_ENTRY(LU, ii, jj, sz) |
| 42 | ++ GR_TMP_INIT2(d, e, ctx); |
| 43 | + |
| 44 | +- rank = row = col = 0; |
| 45 | +- for (i = 0; i < m; i++) |
| 46 | +- P[i] = i; |
| 47 | ++#define ENTRY(ii, jj) GR_MAT_ENTRY(LU, ii, jj, sz) |
| 48 | + |
| 49 | + while (row < m && col < n) |
| 50 | + { |
| 51 | +-- |
| 52 | +2.43.0 |
| 53 | + |
0 commit comments