Hypercomplex
Abstract & fast header-only C++ template library for lattice-based cryptosystems in high-dimensional algebras
|
#include <Hypercomplex_MPFR.hpp>
Public Member Functions | |
Hypercomplex (const mpfr_t *ARR) | |
This is the main constructor. More... | |
Hypercomplex (const Hypercomplex &H) | |
This is the copy constructor. More... | |
uint64_t | _ () const |
Dimensionality getter. More... | |
int32_t | norm (mpfr_t norm) const |
Calculate Euclidean norm of a number. More... | |
Hypercomplex | inv () const |
Calculate inverse of a given number. More... | |
template<const uint64_t newdim> | |
Hypercomplex< mpfr_t, newdim > | expand () const |
Cast a number into a higher dimension. More... | |
Hypercomplex | operator~ () const |
Create a complex conjugate. More... | |
Hypercomplex | operator- () const |
Create an additive inverse of a given number. More... | |
Hypercomplex & | operator= (const Hypercomplex &H) |
Assignment operator. More... | |
mpfr_t const & | operator[] (const uint64_t i) const |
Access operator (const) More... | |
mpfr_t & | operator[] (const uint64_t i) |
Access operator (non-const) More... | |
Hypercomplex & | operator+= (const Hypercomplex &H) |
Addition-Assignment operator. More... | |
Hypercomplex & | operator-= (const Hypercomplex &H) |
Subtraction-Assignment operator. More... | |
Hypercomplex & | operator*= (const Hypercomplex &H) |
Multiplication-Assignment operator. More... | |
Hypercomplex & | operator^= (const uint64_t x) |
Power-Assignment operator. More... | |
Hypercomplex & | operator/= (const Hypercomplex &H) |
Division-Assignment operator. More... | |
Static Public Member Functions | |
static void | init () |
Basis multiplication table initialiser. | |
static void | clear () |
Cleanup function: free all memory. | |
static Hypercomplex | MUL (const Hypercomplex &H1, const Hypercomplex &H2) |
Optimised multiplication function. More... | |
Partial specialisation of the main class for high precision
|
inlineexplicit |
This is the main constructor.
[in] | ARR | array of MPFR numbers |
Template parameters are:
|
inline |
This is the copy constructor.
[in] | H | existing class instance |
Template parameters are:
|
inline |
Dimensionality getter.
|
inline |
Cast a number into a higher dimension.
New dimension is passed as a function template parameter, as the return class is not the same as the caller's class.
|
inline |
Calculate inverse of a given number.
|
inlinestatic |
Optimised multiplication function.
[in] | H1 | LHS operand |
[in] | H2 | RHS operand |
|
inline |
Calculate Euclidean norm of a number.
[in,out] | norm | MPFR variable for the calculated norm |
Note that the interface of this method is different than for the fully template class. Following the MPFR logic: function takes as an argument a variable to store the output in.
|
inline |
Multiplication-Assignment operator.
[in] | H | existing class instance |
|
inline |
Addition-Assignment operator.
[in] | H | existing class instance |
|
inline |
Create an additive inverse of a given number.
|
inline |
Subtraction-Assignment operator.
[in] | H | existing class instance |
|
inline |
Division-Assignment operator.
[in] | H | existing class instance |
|
inline |
Assignment operator.
[in] | H | existing class instance |
|
inline |
Access operator (non-const)
[in] | i | index for the element to access |
|
inline |
Access operator (const)
[in] | i | index for the element to access |
|
inline |
Power-Assignment operator.
[in] | x | positive integer |
|
inline |
Create a complex conjugate.