bkz.basis_generator
basis_gen(dim, entry_bound)
Generates a random full-rank integer lattice basis.
This function creates a square integer matrix of size dim x dim where each entry
is sampled uniformly from [0, entry_bound - 1]. The matrix is constructed row by row,
ensuring that the rank increases with each addition. If adding a new row does not
increase the rank, that row is discarded. The final matrix is transposed so that
basis vectors are represented as columns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dim
|
int
|
Dimension of the lattice basis (number of basis vectors).
Defaults to |
required |
entry_bound
|
int
|
Upper bound for random integer entries (exclusive).
Defaults to |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
A 2D NumPy array of shape |
Source code in bkz/basis_generator.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 | |