plll  1.0
plll.hpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2011-2014 University of Zurich
3 
4  Permission is hereby granted, free of charge, to any person obtaining a copy
5  of this software and associated documentation files (the "Software"), to deal
6  in the Software without restriction, including without limitation the rights
7  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  copies of the Software, and to permit persons to whom the Software is
9  furnished to do so, subject to the following conditions:
10 
11  The above copyright notice and this permission notice shall be included in
12  all copies or substantial portions of the Software.
13 
14  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  THE SOFTWARE.
21 */
22 
23 #ifndef PLLL_INCLUDE_GUARD__PLLL2_LLL_HPP
24 #define PLLL_INCLUDE_GUARD__PLLL2_LLL_HPP
25 
48 #include <plll/config.hpp>
49 #include <plll/arithmetic.hpp>
50 #include <plll/arithmetic-nint.hpp>
51 #include <plll/matrix.hpp>
52 #include <exception>
53 #include <iostream>
54 #include <limits>
55 #include <boost/function.hpp>
56 
62 namespace plll
63 {
64  class LatticeReductionImpl;
65 
74  {
75  private:
76  std::auto_ptr<LatticeReductionImpl> d_impl;
77 
79  // Disable copy constructor and operator
81  LatticeReduction & operator = (const LatticeReduction &);
82 
83  public:
87  class stop_reduction : public std::exception
94  {
95  public:
96  virtual ~stop_reduction() PLLL_INTERNAL_NOTHROW_POSTFIX_ENFORCE
97  {
98  }
99 
100  virtual const char * what() const PLLL_INTERNAL_NOTHROW_POSTFIX_ENFORCE;
101  };
102 
103  class stop_enumeration : public std::exception
110  {
111  public:
112  virtual ~stop_enumeration() PLLL_INTERNAL_NOTHROW_POSTFIX_ENFORCE
113  {
114  }
115 
116  virtual const char * what() const PLLL_INTERNAL_NOTHROW_POSTFIX_ENFORCE;
117  };
119 
134  {
176  };
177 
178  enum Integers
189  {
207  };
208 
220  {
247  };
248 
256  {
268  };
269 
270  enum LLLMode
278  {
313  };
314 
315  enum BKZMode
324  {
404  BKZ_Experimental, // An experimental variant which should *not* be used.
407  };
408 
409  enum SVPMode
417  {
483  };
484 
485  enum DIMethod
497  {
520  };
521 
522  enum DIChoice
528  {
550  };
551 
552  enum DIMode
559  {
573  };
574 
585  {
594  };
595 
605  {
615  };
617 
618  struct Statistics
625  {
626  unsigned long swaps;
629  unsigned long adds;
633  unsigned long adds_pm1;
637  unsigned long adds_pm2;
641  unsigned long flips;
645  unsigned long trans;
649  unsigned long sizereductions;
652  unsigned long deepinsertions;
656  unsigned long enumcalls;
659  unsigned long enumfails;
664  unsigned long vectorinsertions;
674  void reset();
675  Statistics();
676  };
677 
685  {
686  protected:
687  GramSchmidtInformer() { }
688  virtual ~GramSchmidtInformer() { }
689 
690  public:
691  virtual double getGSCoefficientD(unsigned, unsigned) const = 0;
693  virtual long double getGSCoefficientLD(unsigned, unsigned) const = 0;
695  virtual arithmetic::Real getGSCoefficientR(unsigned, unsigned, const arithmetic::RealContext &) const = 0;
699  virtual double getGSSqNormD(unsigned) const = 0;
703  virtual long double getGSSqNormLD(unsigned) const = 0;
707  virtual arithmetic::Real getGSSqNormR(unsigned, const arithmetic::RealContext &) const = 0;
712  virtual double computeProjectionLengthD(unsigned k, unsigned b,
713  const linalg::math_rowvector<arithmetic::Integer> & vec) const = 0;
721  virtual long double computeProjectionLengthLD(unsigned k, unsigned b,
722  const linalg::math_rowvector<arithmetic::Integer> & vec) const = 0;
730  virtual arithmetic::Real computeProjectionLengthR(unsigned k, unsigned b,
732  const arithmetic::RealContext &) const = 0;
741  inline arithmetic::Real getGSCoefficientR(unsigned i, unsigned j) const
747  {
749  }
750 
751  inline arithmetic::Real getGSSqNormR(unsigned i) const
757  {
759  }
760 
761  inline arithmetic::Real computeProjectionLengthR(unsigned k, unsigned b,
772  {
774  }
775  };
776 
780  typedef boost::function<void(const linalg::math_matrix<arithmetic::Integer> &)> CallbackFunction;
788  typedef boost::function<void(const linalg::math_matrix<arithmetic::NInt<long int> > &)> CallbackFunction_LI;
797  typedef boost::function<void(const linalg::math_matrix<arithmetic::Integer> &, unsigned,
807  typedef boost::function<void(const linalg::math_matrix<arithmetic::NInt<long int> > &, unsigned,
818  typedef boost::function<void(const linalg::math_matrix<arithmetic::Integer> & basis,
819  int p,
833  typedef boost::function<void(const linalg::math_matrix<arithmetic::NInt<long int> > & basis,
834  int p,
849  typedef boost::function<bool(const linalg::math_matrix<arithmetic::Integer> &,
862  typedef boost::function<bool(const linalg::math_matrix<arithmetic::Integer> &,
863  int k,
866  arithmetic::Real & T,
876  typedef boost::function<bool (const linalg::math_matrix<arithmetic::Integer> &,
877  int k, int windowsize,
881  arithmetic::Real & T,
895  typedef boost::function<void(VerboseLevel, const std::string &)> VerboseFunction;
903 
914  template<typename IType>
923 #if __cplusplus >= 201103L
936  LatticeReduction & operator = (LatticeReduction &&);
941 #endif
954  template<typename IType>
963 #if __cplusplus >= 201103L
970 #endif
976 
981  unsigned rank() const;
987  unsigned dimension() const;
993 
1003  Arithmetic getArithmetic() const;
1008  bool ensurePrecision(unsigned long);
1017  void setIntegers(Integers);
1022  Integers getIntegers() const;
1027 
1037  void setGramSchmidtRestart(bool);
1048  GramSchmidt getGramSchmidt() const;
1053  bool getGramSchmidtRestart() const;
1059 
1064  void forceGSRebuild(bool makeSureAllComputed = false);
1072  double getGSCoefficientD(unsigned, unsigned) const;
1077  long double getGSCoefficientLD(unsigned, unsigned) const;
1082  arithmetic::Real getGSCoefficientR(unsigned, unsigned) const;
1087  arithmetic::Real getGSCoefficientR(unsigned, unsigned, const arithmetic::RealContext &) const;
1093  double getGSSqNormD(unsigned) const;
1099  long double getGSSqNormLD(unsigned) const;
1105  arithmetic::Real getGSSqNormR(unsigned) const;
1111  arithmetic::Real getGSSqNormR(unsigned, const arithmetic::RealContext &) const;
1118 
1123  void modFlip(unsigned);
1128  void modSwap(unsigned, unsigned);
1133  void modAdd(unsigned i, unsigned j, const arithmetic::Integer & m);
1138 
1153  void disableTransform();
1158  bool isTransformationRecorded() const;
1175 
1180  void setSVPMode(SVPMode);
1182  SVPMode getSVPMode() const;
1184 
1189  void setMaximalCoreUsage(unsigned);
1199  unsigned getMaximalCoreUsage();
1204 
1237  void setCallbackInterval(double = 60.0*5.0);
1245  std::pair<CallbackFunction, CallbackFunction_LI> getCallbackFunction() const;
1250  double getCallbackInterval() const;
1288  std::pair<MinCallbackFunction, MinCallbackFunction_LI> getMinCallbackFunction() const;
1322  std::pair<EnumCallbackFunction, EnumCallbackFunction_LI> getEnumCallbackFunction();
1327 
1332  void setDefaultAnnealing();
1337  void setDefaultAnnealingLLL();
1342  void setDefaultAnnealingBKZ();
1360  void disableAnnealing();
1364  void disableAnnealingLLL();
1369  void disableAnnealingBKZ();
1374  bool isAnnealingLLLEnabled() const;
1376  bool isAnnealingBKZEnabled() const;
1378 
1395  void setDeepInsertionChoice(DIChoice, unsigned = 1);
1405  DIMode getDeepInsertionMode() const;
1415  unsigned getDeepInsertionBlocksize() const;
1420 
1425  void setRange(unsigned begin, unsigned end = std::numeric_limits<unsigned>::max());
1436  std::pair<unsigned, unsigned> getRange() const;
1441 
1446  void sort(bool projected = false);
1453  void sizereduction();
1458  void lll(double alpha = 0.99, LLLMode mode = LLL_Classic);
1469  void bkz(double alpha = 0.99, unsigned blocksize = 20, BKZMode mode = BKZ_SchnorrEuchner);
1481  void hkz(bool dual = false);
1491  void svp(bool make_basis = true, bool extreme = false, bool dual = false);
1508 
1513  bool isSizeReduced() const;
1515  bool isLLLBasis(double alpha = 0.99, LLLMode mode = LLL_Classic) const;
1521  bool isBKZBasis(double alpha = 0.99, unsigned blocksize = 20, BKZMode mode = BKZ_SchnorrEuchner) const;
1528  bool isHKZBasis(bool dual = false) const;
1534  bool isSVPBasis(bool dual = false) const;
1540 
1545  const Statistics & getStatistics() const;
1547  void resetStatistics();
1549 
1554  void setVerbose(VerboseOutputLevel level, const VerboseFunction & = 0);
1571  };
1573 }
1574 
1575 #endif
unsigned long vectorinsertions_rearrange
Definition: plll.hpp:668
bool isTransformationRecorded() const
Queries whether a transformation matrix is recorded.
void modSwap(unsigned, unsigned)
Swaps two given basis vectors.
const Statistics & getStatistics() const
Retrieves the current statistics object.
arithmetic::Real getGSSqNormR(unsigned) const
Returns the squared norm of the i-th Gram-Schmidt orthogonalized basis vector as a arithmetic::Real n...
bool isSVPBasis(bool dual=false) const
Tests whether the given lattice basis (or its reversed dual, in case dual is true) has a shortest vec...
void hkz(bool dual=false)
Computes a Hermite-Korkine-Zolotarev reduced basis.
RealContext & getThreadRealContext()
Retrieves a context for the current thread. The context is thread local and cannot be accessed by thi...
virtual arithmetic::Real getGSSqNormR(unsigned, const arithmetic::RealContext &) const =0
Returns the squared norm of the i-th Gram-Schmidt orthogonalized basis vector as a arithmetic::Real n...
boost::function< bool(const linalg::math_matrix< arithmetic::Integer > &, int k, arithmetic::RealContext &, arithmetic::RandomNumberGenerator &, arithmetic::Real &T, GramSchmidtInformer *)> LLL_AnnealFunction
A annealing function for LLL.
Definition: plll.hpp:867
void setLattice(const linalg::math_matrix< arithmetic::Integer > &lattice)
Sets the current lattice of the LatticeReduction object to the lattice given by the current matrix...
void setAnnealing(const AnnealCallbackFunction &, const LLL_AnnealFunction &, const BKZ_AnnealFunction &)
Sets annealing functions for both LLL and BKZ.
boost::function< bool(const linalg::math_matrix< arithmetic::Integer > &, int k, int windowsize, linalg::math_rowvector< arithmetic::Integer > &lincomb, arithmetic::RealContext &, arithmetic::RandomNumberGenerator &, arithmetic::Real &T, GramSchmidtInformer *)> BKZ_AnnealFunction
A annealing function for BKZ.
Definition: plll.hpp:882
void modAdd(unsigned i, unsigned j, const arithmetic::Integer &m)
Adds m times the i-th basis vector to the j-th basis vector.
void setCallbackInterval(double=60.0 *5.0)
Sets the callback interval for the callback function.
std::pair< EnumCallbackFunction, EnumCallbackFunction_LI > getEnumCallbackFunction()
Retrieves the current enumeration callback function.
std::pair< MinCallbackFunction, MinCallbackFunction_LI > getMinCallbackFunction() const
Retrieves the currently set minimum callback function.
DIMethod
Specifies which Deep Insertion mode is used.
Definition: plll.hpp:485
boost::function< void(VerboseLevel, const std::string &)> VerboseFunction
A verbose output callback function.
Definition: plll.hpp:895
long double getGSCoefficientLD(unsigned, unsigned) const
Returns the (i, j) Gram-Schmidt coefficient as a long double.
virtual long double computeProjectionLengthLD(unsigned k, unsigned b, const linalg::math_rowvector< arithmetic::Integer > &vec) const =0
Returns the squared norm of the given vector projected into the orthogonal complement of the first k-...
The matrix and vector template library.
boost::function< void(const linalg::math_matrix< arithmetic::NInt< long int > > &)> CallbackFunction_LI
A generic callback function for long int lattices.
Definition: plll.hpp:788
arithmetic::Real computeProjectionLengthR(unsigned k, unsigned b, const linalg::math_rowvector< arithmetic::Integer > &vec) const
Returns the squared norm of the given vector projected into the orthogonal complement of the first k-...
Definition: plll.hpp:761
virtual arithmetic::Real getGSCoefficientR(unsigned, unsigned, const arithmetic::RealContext &) const =0
Returns the (i, j) Gram-Schmidt coefficient as a arithmetic::Real number.
virtual double getGSCoefficientD(unsigned, unsigned) const =0
Returns the (i, j) Gram-Schmidt coefficient as a double.
boost::function< void(const linalg::math_matrix< arithmetic::NInt< long int > > &basis, int p, const linalg::math_rowvector< arithmetic::NInt< long int > > &vec)> EnumCallbackFunction_LI
A callback function for newly found shortest vectors during enumerations, or more generally SVP solvi...
Definition: plll.hpp:835
virtual arithmetic::Real computeProjectionLengthR(unsigned k, unsigned b, const linalg::math_rowvector< arithmetic::Integer > &vec, const arithmetic::RealContext &) const =0
Returns the squared norm of the given vector projected into the orthogonal complement of the first k-...
virtual long double getGSSqNormLD(unsigned) const =0
Returns the squared norm of the i-th Gram-Schmidt orthogonalized basis vector as a long double...
Integers getIntegers() const
Returns the currently set integer arithmetic.
unsigned getMaximalCoreUsage()
Returns the current maximal number of cores used.
double getGSSqNormD(unsigned) const
Returns the squared norm of the i-th Gram-Schmidt orthogonalized basis vector as a double...
This exception should be thrown by callback functions to stop reduction and return the current state ...
Definition: plll.hpp:87
void setIntegers(Integers)
Sets which integer arithmetic will be used for all lattice operations.
double getCallbackInterval() const
Retrieves the current (minimal) callback interval.
This exception should be thrown by callback functions to stop enumeration and return the currently fo...
Definition: plll.hpp:103
boost::function< void(const linalg::math_matrix< arithmetic::Integer > &basis, int p, const linalg::math_rowvector< arithmetic::Integer > &vec)> EnumCallbackFunction
A callback function for newly found shortest vectors during enumerations, or more generally SVP solvi...
Definition: plll.hpp:820
Statistics()
Creates a new statistics object with all values set to zero.
void svp(bool make_basis=true, bool extreme=false, bool dual=false)
Computes a shortest vector of the lattice and inserts it at the beginning.
void setSVPMode(SVPMode)
Sets the current SVP solver.
void setDefaultAnnealing()
Sets the default annealing functions.
arithmetic::Real getGSCoefficientR(unsigned, unsigned) const
Returns the (i, j) Gram-Schmidt coefficient as a arithmetic::Real number.
DIMethod getDeepInsertionMethod() const
Retrieves the current Deep Insertions method.
boost::function< void(const linalg::math_matrix< arithmetic::Integer > &, unsigned, const arithmetic::Integer &)> MinCallbackFunction
A callback function for newly found shortest vectors.
Definition: plll.hpp:798
void sort(bool projected=false)
Sorts the vectors by their norm.
SVPMode
Specifies which SVP solver is used.
Definition: plll.hpp:409
const linalg::math_matrix< arithmetic::Integer > * getTransformation() const
Queries the current transformation matrix.
unsigned getDeepInsertionBlocksize() const
Retrieves the current Deep Insertions choice block size parameter.
bool getGramSchmidtRestart() const
Returns whether restarts are used for the current Gram-Schmidt orthogonalization method.
Arithmetic
Specifies which arithmetic to use for Gram-Schmidt orthogonalization.
Definition: plll.hpp:123
bool isLLLBasis(double alpha=0.99, LLLMode mode=LLL_Classic) const
Tests whether the given lattice basis is LLL reduced with respect to the given reduction parameter al...
void setVerbose(VerboseOutputLevel level, const VerboseFunction &=0)
Sets the verbose output level to level.
bool isHKZBasis(bool dual=false) const
Tests whether the given lattice basis (or its reversed dual, in case dual is true) is HKZ reduced...
bool isBKZBasis(double alpha=0.99, unsigned blocksize=20, BKZMode mode=BKZ_SchnorrEuchner) const
Tests whether the given lattice basis is BKZ reduced with respect to the given reduction parameter al...
void setDefaultAnnealingBKZ()
Sets the defalut BKZ annealing function.
LLLMode
Specifies which LLL condition is used.
Definition: plll.hpp:270
arithmetic::Real getGSSqNormR(unsigned i) const
Returns the squared norm of the i-th Gram-Schmidt orthogonalized basis vector as a arithmetic::Real n...
Definition: plll.hpp:751
boost::function< bool(const linalg::math_matrix< arithmetic::Integer > &, arithmetic::RealContext &, arithmetic::Real &T)> AnnealCallbackFunction
A callback function for Simulated Annealing.
Definition: plll.hpp:851
bool isSizeReduced() const
Tests whether the given lattice is size reduced.
void setDeepInsertionMode(DIMode)
Sets the Deep Insertions mode.
void setEnumCallbackFunction(const EnumCallbackFunction &, const EnumCallbackFunction_LI &=EnumCallbackFunction_LI())
Sets a enumeration callback function which will be used if a new shortest vector is found during an e...
void setAnnealingBKZ(const AnnealCallbackFunction &, const BKZ_AnnealFunction &)
Sets annealing functions for BKZ.
void setDefaultAnnealingLLL()
Sets the defalut LLL annealing function.
void sizereduction()
Applies only size reduction to the vectors.
unsigned rank() const
Returns the current rank, i.e. the number of generating vectors.
bool ensurePrecision(unsigned long)
Ensures a minimal floating point precision (if possible).
VerboseOutputLevel getVerboseOutputLevel()
Retrieves the current verbose output level.
DIChoice getDeepInsertionChoice() const
Retrieves the current Deep Insertions choice.
arithmetic::Real getGSCoefficientR(unsigned i, unsigned j) const
Returns the (i, j) Gram-Schmidt coefficient as a arithmetic::Real number.
Definition: plll.hpp:741
void lll(double alpha=0.99, LLLMode mode=LLL_Classic)
Applies LLL with given reduction parameter alpha ( ) and mode mode.
double getGSCoefficientD(unsigned, unsigned) const
Returns the (i, j) Gram-Schmidt coefficient as a double.
bool isAnnealingLLLEnabled() const
Tests whether annealing for LLL is enabled.
void setDeepInsertionChoice(DIChoice, unsigned=1)
Sets the Deep Insertion choice and block size, which by default is 1.
Provides an interface to the lattice reduction algorithms of the plll library.
Definition: plll.hpp:66
std::pair< unsigned, unsigned > getRange() const
Retrieves the current range.
Represents a random number generator.
Represents a math row vector with coefficients in T.
Definition: matrix.hpp:342
LatticeReduction()
Creates a default LatticeReduction object with default settings.
GramSchmidt getGramSchmidt() const
Returns the currently used Gram-Schmidt orthogonalization method.
~LatticeReduction()
Destroys the LatticeReduction object.
bool isAnnealingBKZEnabled() const
Tests whether annealing for BKZ is enabled.
boost::function< void(const linalg::math_matrix< arithmetic::Integer > &)> CallbackFunction
A generic callback function.
Definition: plll.hpp:780
void disableAnnealingLLL()
Disable annealing for LLL.
Transform
Specifies which transformation matrix is computed.
Definition: plll.hpp:249
Represents a native integer.
Integers
Specifies which arithmetic to use for integer operations.
Definition: plll.hpp:178
void disableAnnealing()
Disable annealing for both LLL and BKZ.
long double getGSSqNormLD(unsigned) const
Returns the squared norm of the i-th Gram-Schmidt orthogonalized basis vector as a long double...
void setArithmetic(Arithmetic)
Sets which arithmetic will be used for Gram-Schmidt orthogonalizations.
void disableTransform()
Disables recording of a transformation matrix.
Represents an arbitrary precision floating point value.
virtual double getGSSqNormD(unsigned) const =0
Returns the squared norm of the i-th Gram-Schmidt orthogonalized basis vector as a double...
void setGramSchmidtRestart(bool)
Sets that the current Gram-Schmidt method should use restarts.
const linalg::math_matrix< arithmetic::Integer > & getLattice() const
Returns the current lattice generating set as a matrix.
void bkz(double alpha=0.99, unsigned blocksize=20, BKZMode mode=BKZ_SchnorrEuchner)
Applies BKZ (or one of its variants) with given reduction parameter alpha ( ), block size blocksize a...
VerboseLevel
Specifies a warning level for a specific output message.
Definition: plll.hpp:596
Describes lattice basis reduction statistics.
Definition: plll.hpp:618
DIMode getDeepInsertionMode() const
Retrieves the current Deep Insertions mode.
void enableTransform(Transform=T_Normal)
Enables that from this point on, a transformation matrix is recorded.
Transform getTransformationMode() const
Queries whether transformation matrix (normal or inverse) is recorded.
BKZMode
Specifies which BKZ algorithm is used.
Definition: plll.hpp:315
void setGramSchmidt(GramSchmidt)
Sets which Gram-Schmidt orthogonalization method will be used.
Provides information on the Gram-Schmidt coefficients.
Definition: plll.hpp:678
virtual double computeProjectionLengthD(unsigned k, unsigned b, const linalg::math_rowvector< arithmetic::Integer > &vec) const =0
Returns the squared norm of the given vector projected into the orthogonal complement of the first k-...
Represents an arithmetic context for arbitrary precision floating point values.
void setRange(unsigned begin, unsigned end=std::numeric_limits< unsigned >::max())
Retricts all algorithms to the range [begin, end].
GramSchmidt
Specifies which Gram-Schmidt orthogonalization is used.
Definition: plll.hpp:209
void setMaximalCoreUsage(unsigned)
Setups the maximal number of cores which will be used by the plll library.
Header for native integer arithmetic in the plll arithmetic context framework.
Arithmetic getArithmetic() const
Returns the currently set arithmetic for Gram-Schmidt orthogonalizations.
void reset()
Resets the statistics.
void setDeepInsertionMethod(DIMethod, DIMode=DIM_Default)
Sets the Deep Insertions method and optionally also the mode.
void setCallbackFunction(const CallbackFunction &, const CallbackFunction_LI &=CallbackFunction_LI())
Sets a callback function.
VerboseOutputLevel
Specifies the verbosity output level.
Definition: plll.hpp:575
void disableAnnealingBKZ()
Disable annealing for LLL.
DIChoice
Specifies which Deep Insertion choice is used.
Definition: plll.hpp:522
unsigned dimension() const
Returns the dimension of the ambient space in which the lattice exists.
const VerboseFunction & getVerboseFunction()
Retrieves the current verbose output function.
void resetStatistics()
Resets the current statistics object.
void setAnnealingLLL(const AnnealCallbackFunction &, const LLL_AnnealFunction &)
Sets annealing functions for LLL.
Represents an arbitrary precision integer.
boost::function< void(const linalg::math_matrix< arithmetic::NInt< long int > > &, unsigned, const arithmetic::NInt< long int > &)> MinCallbackFunction_LI
A callback function for newly found shortest vectors for long int lattices.
Definition: plll.hpp:808
Represents a math matrix with coefficients in T.
Definition: matrix.hpp:210
std::pair< CallbackFunction, CallbackFunction_LI > getCallbackFunction() const
Retrieves the currently set callback function.
DIMode
Specifies which Deep Insertions mode is used.
Definition: plll.hpp:552
void forceGSRebuild(bool makeSureAllComputed=false)
Forces the Gram-Schmidt coefficients to be rebuild.
void modFlip(unsigned)
Flips the signs of the given basis vector.
SVPMode getSVPMode() const
Retrieves the current SVP solver.
void setMinCallbackFunction(const MinCallbackFunction &, const MinCallbackFunction_LI &=MinCallbackFunction_LI())
Sets a minimum callback function which will be called as soon as a new shortest vector is found durin...
virtual long double getGSCoefficientLD(unsigned, unsigned) const =0
Returns the (i, j) Gram-Schmidt coefficient as a long double.
Main arithmetic header.