MatHouseholder< ZT, FT > Class Template Reference

#include <householder.h>

Public Member Functions

 MatHouseholder (Matrix< ZT > &arg_b, Matrix< ZT > &arg_u, Matrix< ZT > &arg_uinv_t, int flags)
 
 ~MatHouseholder ()
 
void get_R (FT &f, int i, int j, long &expo)
 
void get_R (FT &f, int i, int j)
 
MatrixRow< FT > get_R (int i, long &expo)
 
const Matrix< FT > & get_R (vector< long > &expo)
 
MatrixRow< ZT > get_b (int i)
 
const Matrix< ZT > & get_b ()
 
void update_R (int i, bool last_j)
 
void update_R (int i)
 
void update_R_last (int i)
 
void update_R ()
 
int get_d ()
 
int get_n ()
 
void norm_square_b_row (FT &f, int k, long &expo)
 
void norm_square_R_row (FT &f, int k, int beg, int end, long &expo)
 
void norm_R_row (FT &f, int k, int beg, int end, long &expo)
 
bool size_reduce (int k, int size_reduction_end, int size_reduction_start=0)
 
void swap (int i, int j)
 
void invalidate_row (int k)
 
bool is_enable_row_expo ()
 
bool get_updated_R ()
 
void set_updated_R_false ()
 
FT get_R_inverse_diag (int i)
 
void recover_R (int i)
 
long get_row_expo (int i)
 
bool is_row_op_force_long ()
 
void refresh_R_bf (int i)
 
void refresh_R_bf ()
 
void refresh_R (int i)
 
void refresh_R ()
 
void get_norm_square_b (FT &f, int i, long &expo)
 
void update_R_naively ()
 
void update_R_naively (int i)
 
void get_R_naively (FT &f, int i, int j, long &expo)
 
void norm_square_b_row_naively (FT &f, int k, long &expo)
 
void norm_square_R_row_naively (FT &f, int k, int end, long &expo)
 

Detailed Description

template<class ZT, class FT>
class MatHouseholder< ZT, FT >

MatHouseholder provides an interface for performing elementary operations on a basis and computing its R matrix using Householder transformations.

Constructor & Destructor Documentation

◆ MatHouseholder()

template<class ZT , class FT >
MatHouseholder< ZT, FT >::MatHouseholder ( Matrix< ZT > &  arg_b,
Matrix< ZT > &  arg_u,
Matrix< ZT > &  arg_uinv_t,
int  flags 
)
inline

Constructor. The precision of FT must be defined before creating an instance of the class and must remain the same until the object is destroyed (or no longer needed).

Parameters
bThe matrix on which row operations are performed. It must not be empty.
enable_row_expoIf true, each row of b is normalized by a power of 2 before doing conversion to floating-point, which hopefully avoids some overflows. This option cannot be enabled if enable_int_gram=true and works only with FT=double and FT=long double. It is useless and MUST NOT be used for FT=dpe or FT=mpfr_t.
enable_transformCompute u
uIf u is not empty, operations on b are also done on u (in this case both must have the same number of rows). If u is initially the identity matrix, multiplying transform by the initial basis gives the current basis.
enable_inverse_transformCompute u_inv_t
u_inv_tInverse transform (should be empty, which disables the computation, or initialized with identity matrix). It works only if u is not empty.
enable_op_force_longAffects the behaviour of row_addmul(_we). See the documentation of row_addmul.

◆ ~MatHouseholder()

template<class ZT , class FT >
MatHouseholder< ZT, FT >::~MatHouseholder ( )
inline

Member Function Documentation

◆ get_b() [1/2]

template<class ZT , class FT >
const Matrix< ZT > & MatHouseholder< ZT, FT >::get_b ( )
inline

Returns the b matrix

◆ get_b() [2/2]

template<class ZT , class FT >
MatrixRow< ZT > MatHouseholder< ZT, FT >::get_b ( int  i)

Returns b[i].

◆ get_d()

template<class ZT , class FT >
int MatHouseholder< ZT, FT >::get_d ( )
inline

Retun the dimensions of the lattice

◆ get_n()

template<class ZT , class FT >
int MatHouseholder< ZT, FT >::get_n ( )
inline

◆ get_norm_square_b()

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::get_norm_square_b ( FT &  f,
int  i,
long &  expo 
)
inline

Set in f the precomputed squared norm of b[i] and in expo the exponent such that ||b[i]||^2 = f

  • 2^{expo}

◆ get_R() [1/4]

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::get_R ( FT &  f,
int  i,
int  j 
)
inline

Returns f (* 2^expo if enable_row_expo) = R(i, j).

Returns reference to f.

◆ get_R() [2/4]

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::get_R ( FT &  f,
int  i,
int  j,
long &  expo 
)
inline

Returns f (* 2^expo if enable_row_expo) = R(i, j).

Returns reference to f and expo.

◆ get_R() [3/4]

template<class ZT , class FT >
MatrixRow< FT > MatHouseholder< ZT, FT >::get_R ( int  i,
long &  expo 
)
inline

Returns R[i].

◆ get_R() [4/4]

template<class ZT , class FT >
const Matrix< FT > & MatHouseholder< ZT, FT >::get_R ( vector< long > &  expo)
inline

Returns the R matrix expo is set to row_expo

◆ get_R_inverse_diag()

template<class ZT , class FT >
FT MatHouseholder< ZT, FT >::get_R_inverse_diag ( int  i)
inline

Get the precomputation of R(i, i)

◆ get_R_naively()

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::get_R_naively ( FT &  f,
int  i,
int  j,
long &  expo 
)
inline

Return R_naively(i, j) = f (* 2^expo, if enable_row_expo)

◆ get_row_expo()

template<class ZT , class FT >
long MatHouseholder< ZT, FT >::get_row_expo ( int  i)
inline

Return row_expo[i]

◆ get_updated_R()

template<class ZT , class FT >
bool MatHouseholder< ZT, FT >::get_updated_R ( )
inline

Return value of updated_R

◆ invalidate_row()

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::invalidate_row ( int  k)
inline

Update n_known_rows to k.

◆ is_enable_row_expo()

template<class ZT , class FT >
bool MatHouseholder< ZT, FT >::is_enable_row_expo ( )
inline

Return values enable_row_expo

◆ is_row_op_force_long()

template<class ZT , class FT >
bool MatHouseholder< ZT, FT >::is_row_op_force_long ( )
inline

Returns the value of row_op_force_long

◆ norm_R_row()

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::norm_R_row ( FT &  f,
int  k,
int  beg,
int  end,
long &  expo 
)
inline

Truncated norm of R[k], with coefficients of R[k][beg..end-1].

◆ norm_square_b_row()

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::norm_square_b_row ( FT &  f,
int  k,
long &  expo 
)
inline

Compute the squared norm of b[k].

◆ norm_square_b_row_naively()

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::norm_square_b_row_naively ( FT &  f,
int  k,
long &  expo 
)
inline

Squared norm of b[k]. Use row_expo_naively if enable_row_expo is used. f * 2^expo = ||b[i]||^2

◆ norm_square_R_row()

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::norm_square_R_row ( FT &  f,
int  k,
int  beg,
int  end,
long &  expo 
)
inline

Truncated squared norm of R[k], with coefficients of R[k][beg..end-1].

◆ norm_square_R_row_naively()

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::norm_square_R_row_naively ( FT &  f,
int  k,
int  end,
long &  expo 
)
inline

Truncated norm square of R_naively[k], with coefficients of R_naively[k][0..end-1].

◆ recover_R()

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::recover_R ( int  i)
inline

◆ refresh_R() [1/2]

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::refresh_R
inline

Set R to b.

◆ refresh_R() [2/2]

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::refresh_R ( int  i)

Set R[i] to b[i].

◆ refresh_R_bf() [1/2]

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::refresh_R_bf
inline

Set bf and R to b. Precompute squared norm of all the vectors of b

◆ refresh_R_bf() [2/2]

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::refresh_R_bf ( int  i)

Set bf[i] and R[i] to b[i]. Precompute square norm of b[i].

◆ set_updated_R_false()

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::set_updated_R_false ( )
inline

Set updated_R to false updated_R is set to true in recover_R

◆ size_reduce()

template<class ZT , class FT >
bool MatHouseholder< ZT, FT >::size_reduce ( int  k,
int  size_reduction_end,
int  size_reduction_start = 0 
)

◆ swap()

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::swap ( int  i,
int  j 
)

Swap row i and j of b, bf, R, V, u and u_inv_t Swap element i and j in sigma, row_expo, norm_square_b, expo_norm_square_b, init_row_size and R_history.

◆ update_R() [1/3]

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::update_R
inline

Full computation of the matrix R.

◆ update_R() [2/3]

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::update_R ( int  i)
inline

Apply Householder transformation on row i.

◆ update_R() [3/3]

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::update_R ( int  i,
bool  last_j 
)

Apply Householder transformation on row i for columns [0, i). If last_j, apply Householder transformation on row i, from cols [0, i].

◆ update_R_last()

template<class ZT , class FT >
FPLLL_BEGIN_NAMESPACE void MatHouseholder< ZT, FT >::update_R_last ( int  i)

Finalize Householder transformation on row i (especially after update_R(i, false))

◆ update_R_naively() [1/2]

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::update_R_naively
inline

Full computation of the matrix R.

◆ update_R_naively() [2/2]

template<class ZT , class FT >
void MatHouseholder< ZT, FT >::update_R_naively ( int  i)

Apply Householder transformation on row i.


The documentation for this class was generated from the following files: