|
void | ident (Mat_64 &mat, long dim) |
|
double | determinant (const NTL::matrix< std::int64_t > &mat) |
|
|
These functions perform conversions between different types.
Most of them do not really need explanations, but sometimes a specific logic is used when doing the conversion.
|
void | conv (std::int64_t &l, const char *c) |
| Converts the array of characters (string) c into an std::int64_t l using the strtol() function of cstdlib.h.
|
|
void | conv (double &r, const char *c) |
| Converts the array of characters (string) c into a double r using the strtod() function of cstdlib.h.
|
|
|
These functions are already implemented in NTL for NTL::ZZ or NTL::RR types, but not for the other standard types we use.
These overloads allow us to make a simple call to the function in the NTL namespace without worrying about types and still have working algorithms.
|
bool | IsZero (const std::int64_t &x) |
| Returns the bool resulting of the statement x == 0 .
|
|
void | clear (double &x) |
| Sets x to 0.
|
|
void | clear (std::int64_t &x) |
| Sets x to 0.
|
|
std::int64_t | IsOdd (const std::int64_t &x) |
| Tests if x is odd.
|
|
void | set (std::int64_t &x) |
| Sets x to 1.
|
|
|
These are complementary overloads to NTL power functions.
|
typedef NTL::matrix< int64_t > | matrix64 |
|
typedef NTL::vector< int64_t > | vector64 |
|
typedef Mat< std::int64_t > | Mat_64 |
|
typedef Vec< std::int64_t > | Vec_64 |
|
std::int64_t | power (std::int64_t p, std::int64_t i) |
| Returns \(p^i\).
|
|
void | power2 (std::int64_t &z, std::int64_t i) |
| Sets \(z = 2^i\).
|
|
void | power2 (NTL::ZZ &z, std::int64_t i) |
| Sets \(z = 2^i\).
|
|
double | inv (const double x) |
|
template<typename T > |
static void | transpose (NTL::Mat< T > &X, const NTL::Mat< T > &A) |
| Transposes A into X .
|
|
template<typename T > |
static NTL::Mat< T > | transpose (const NTL::Mat< T > &a) |
| Another implementation of the transpose function.
|
|
static void | add (int64_t &x, const int64_t a, const int64_t b) |
|
static void | sub (int64_t &x, const int64_t a, const int64_t b) |
|
static void | SubPos (int64_t &x, const int64_t a, const int64_t b) |
|
static void | negate (int64_t &x, const int64_t a) |
|
static void | mul (int64_t &x, const int64_t a, const int64_t b) |
|
static void | div (int64_t &x, const int64_t a, const int64_t b) |
|
static void | rem (int64_t &x, const int64_t a, const int64_t b) |
|
static void | sqr (int64_t &x, const int64_t a) |
|
static void | MulAddTo (int64_t &x, const int64_t a, const int64_t b) |
|
static void | MulSubFrom (int64_t &x, int64_t a, int64_t b) |
|
static void | LeftShift (int64_t &x, const int64_t a, int64_t k) |
|
static void | RightShift (int64_t &x, const int64_t a, int64_t k) |
|
static void | mul (vector64 &x, const vector64 &a, const int64_t b) |
|
static void | add (vector64 &x, const vector64 &a, const vector64 &b) |
|
static void | sub (vector64 &x, const vector64 &a, const vector64 &b) |
|
Vec_64 | operator* (const Vec_64 &vec, std::int64_t a) |
| These are operator overloads for Mat_64 and Vec_64 types.
|
|
Vec_64 | operator* (std::int64_t a, const Vec_64 &vec) |
|
std::int64_t | operator* (const Vec_64 &vec1, const Vec_64 &vec2) |
|
Vec_64 & | operator+= (Vec_64 &vec1, const Vec_64 &vec2) |
|
Vec_64 & | operator-= (Vec_64 &vec1, const Vec_64 &vec2) |
|
Vec_64 & | operator*= (Vec_64 &vec, std::int64_t a) |
|
Mat_64 & | operator*= (Mat_64 &mat, std::int64_t a) |
|
Mat_64 | operator* (const Mat_64 &mat1, const Mat_64 &mat2) |
|
void | ident (Mat_64 &mat, int64_t dim) |
| Transforms mat into the identity matrix of dimensions \(\text{dim}\times\text{dim}\).
|
|
double | determinant (const Mat_64 &mat) |
| Computes and returns the determinant of ‘mat’.
|
|
This module extends the Vec
and Mat
classes of NTL.
It was previously necessary because NTL and boost (an old dependency) did not use the same function names and indices. Most of the methods below only define alias names for some NTL methods. This was done at the time to have the same names for methods that are in both boost and NTL, allowing LatticeTester to work with either the boost or NTL library, depending on pre-processing statements. These alias could probably be removed because we no longer use boost in LatticeTester. However, they may still be used in LatNet Builder (?) **************
New functions have also been implemented in this module as a way to overload a few operators and methods of NTL (especially on matrix and vector types) to the usage of NTL::Mat<std::int64_t>
because some basic utilities that we need for those integers are not offered in NTL.