L3FP.reducer
reduce(f_c, gsc_k, gsc_l, spanning_vec_k, spanning_vec_l, l)
Performs size reduction by subtracting a multiple of one basis vector from another, updating the corresponding Gram-Schmidt coefficients and spanning vector.
This function computes mu = round(gsc_k[l]) and, if mu exceeds a threshold, sets the
floating-point precision flag f_c to True. It then updates spanning_vec_k
by subtracting mu times spanning_vec_l, respectively. Values in gsc_l are also
updated based on mu and the contents of gsc_l.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f_c
|
bool
|
A flag used to track floating-point precision issues. May be updated. |
required |
gsc_k
|
ndarray
|
The k-th column of Gram-Schmidt coefficent matrix. |
required |
gsc_l
|
ndarray
|
The l-th column of Gram-Schmidt coefficent matrix. |
required |
spanning_vec_k
|
ndarray
|
The k-th column of spanning_matrix. |
required |
spanning_vec_l
|
ndarray
|
The l-th column of spanning_matrix. |
required |
l
|
int
|
Index representing the column position of gsc_l and spanning_vec_l. |
required |
Returns:
| Type | Description |
|---|---|
tuple
|
|
Source code in bkz/L3FP/reducer.py
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 | |
size_reduction_loop(stage, gs_coeff_matrix, spanning_matrix, f_c)
Performs size reduction on the specified column of the Gram-Schmidt coefficient matrix.
This function iterates over the Gram-Schmidt coefficients of the column indexed by stage,
checking whether each coefficient satisfies the size reduction condition. If the absolute
value of a coefficient exceeds the predefined threshold, the reduce function is invoked
to update the basis and Gram-Schmidt data accordingly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stage
|
int
|
The index of the basis vector that is currently under investigation. |
required |
gs_coeff_matrix
|
ndarray
|
A 2D NumPy array of shape (m, m) representing the Gram-Schmidt coefficients of the spanning_matrix. |
required |
spanning_matrix
|
ndarray
|
A 2D NumPy array of shape (n, m), where n<=m, representing a vector space (which correspond to basis_matrix or injected_basis_matrix). |
required |
f_c
|
bool
|
A flag used to track floating-point precision issues. |
required |
Returns:
| Type | Description |
|---|---|
tuple
|
|
Source code in bkz/L3FP/reducer.py
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 | |