[Mlir-commits] [mlir] [MLIR][Presburger] Add LLL basis reduction (PR #75565)

Arjun P llvmlistbot at llvm.org
Fri Dec 15 09:08:11 PST 2023


================
@@ -576,4 +576,39 @@ FracMatrix FracMatrix::gramSchmidt() const {
     }
   }
   return orth;
-}
\ No newline at end of file
+}
+
+void FracMatrix::LLL(Fraction delta) {
+  MPInt nearest;
+  Fraction mu;
+
+  // `bStar` holds the Gram-Schmidt orthogonalisation
+  // of the matrix at all times. It is recomputed every
+  // time the matrix is modified during the algorithm.
+  FracMatrix bStar = gramSchmidt();
+
+  unsigned k = 1;
+  while (k < getNumRows()) {
----------------
Superty wrote:

Please write the pseudocode for the algorithm above the loop and then in the loop explain where each step is being done. Look at GBRSimplex::reduceBasis for an example

https://github.com/llvm/llvm-project/pull/75565


More information about the Mlir-commits mailing list