|
algebramix_doc 0.3
|
#include <crt_blocks.hpp>
Definition at line 87 of file crt_blocks.hpp.
| typedef WL::base base |
Definition at line 89 of file crt_blocks.hpp.
| typedef WL::modulus_base modulus_base |
Definition at line 91 of file crt_blocks.hpp.
| typedef WL::modulus_base_variant modulus_base_variant |
Definition at line 92 of file crt_blocks.hpp.
| typedef WL::modulus_variant modulus_variant |
Definition at line 90 of file crt_blocks.hpp.
| crt_blocks_transformer | ( | const vector< M > & | p, |
| bool | lazy = true |
||
| ) | [inline] |
Definition at line 121 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::aux, crt_blocks_transformer< WL, WH, s, V >::H, crt_blocks_transformer< WL, WH, s, V >::high, crt_blocks_transformer< WL, WH, s, V >::low, crt_blocks_transformer< WL, WH, s, V >::m, mmx::N(), crt_blocks_transformer< WL, WH, s, V >::n, crt_blocks_transformer< WL, WH, s, V >::P, crt_blocks_transformer< WL, WH, s, V >::product(), mmx::range(), and crt_blocks_transformer< WL, WH, s, V >::setup.
{
n= N(p); m= (n + s - 1) / s; setup= !lazy;
if (n == 0) { P= 1; H= 0; return; }
low= mmx_new<WL*> (m);
vector<Modulus> v (Modulus (), m);
for (nat i= 0; i < m; i++) {
low[i]= mmx_new<WL> (1, range (p, i * s, min (n, (i+1) * s)), lazy);
v[i]= low[i] -> product ();
}
high= mmx_new<WH> (1, v, lazy);
P= high -> product ();
H= Crt::half (P);
aux= mmx_new<C> (m); }
| ~crt_blocks_transformer | ( | ) | [inline] |
| void combine | ( | C & | a, |
| const I * | c | ||
| ) | [inline] |
Definition at line 161 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::aux, crt_blocks_transformer< WL, WH, s, V >::high, crt_blocks_transformer< WL, WH, s, V >::low, crt_blocks_transformer< WL, WH, s, V >::m, crt_blocks_transformer< WL, WH, s, V >::n, and crt_blocks_transformer< WL, WH, s, V >::setup_comoduli().
{
if (n == 0) { a= 0; return; }
setup_comoduli ();
Crt::combine (a, c, low, high, aux, m, s); }
| C comodulus | ( | nat | i | ) | const [inline] |
Definition at line 152 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::high, crt_blocks_transformer< WL, WH, s, V >::low, and crt_blocks_transformer< WL, WH, s, V >::n.
| void direct_transform | ( | I * | c, |
| const C & | a | ||
| ) | [inline] |
Definition at line 156 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::aux, crt_blocks_transformer< WL, WH, s, V >::high, crt_blocks_transformer< WL, WH, s, V >::low, crt_blocks_transformer< WL, WH, s, V >::m, crt_blocks_transformer< WL, WH, s, V >::n, and crt_blocks_transformer< WL, WH, s, V >::P.
| void inverse_transform | ( | C & | a, |
| const I * | c | ||
| ) | [inline] |
Definition at line 166 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::aux, crt_blocks_transformer< WL, WH, s, V >::H, crt_blocks_transformer< WL, WH, s, V >::high, crt_blocks_transformer< WL, WH, s, V >::low, crt_blocks_transformer< WL, WH, s, V >::m, crt_blocks_transformer< WL, WH, s, V >::n, crt_blocks_transformer< WL, WH, s, V >::P, and crt_blocks_transformer< WL, WH, s, V >::setup_inverse().
| M operator[] | ( | nat | i | ) | const [inline] |
Definition at line 142 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::low, and crt_blocks_transformer< WL, WH, s, V >::n.
{
VERIFY (i < n, "index out of range");
return low[i / s]-> operator [] (i % s); }
| Modulus product | ( | ) | const [inline] |
Definition at line 149 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::P.
Referenced by crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer().
{
return P; }
| void setup_comoduli | ( | ) | [inline] |
Definition at line 111 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::combine().
{}
| void setup_inverse | ( | ) | [inline] |
Definition at line 114 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::high, crt_blocks_transformer< WL, WH, s, V >::low, crt_blocks_transformer< WL, WH, s, V >::m, and crt_blocks_transformer< WL, WH, s, V >::setup.
Referenced by crt_blocks_transformer< WL, WH, s, V >::inverse_transform().
{
if (setup) return;
high -> setup_inverse ();
for (nat i= 0; i < m; i++)
low[i] -> setup_inverse ();
setup= true; }
| nat size | ( | ) | const [inline] |
Definition at line 146 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::n.
Referenced by mmx::N().
{
return n; }
| C* aux |
Definition at line 106 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::combine(), crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer(), crt_blocks_transformer< WL, WH, s, V >::direct_transform(), crt_blocks_transformer< WL, WH, s, V >::inverse_transform(), and crt_blocks_transformer< WL, WH, s, V >::~crt_blocks_transformer().
| C H |
Definition at line 108 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer(), and crt_blocks_transformer< WL, WH, s, V >::inverse_transform().
| WH* high |
Definition at line 105 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::combine(), crt_blocks_transformer< WL, WH, s, V >::comodulus(), crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer(), crt_blocks_transformer< WL, WH, s, V >::direct_transform(), crt_blocks_transformer< WL, WH, s, V >::inverse_transform(), implementation< matrix_multiply, V, matrix_crt< W > >::mul(), crt_blocks_transformer< WL, WH, s, V >::setup_inverse(), and crt_blocks_transformer< WL, WH, s, V >::~crt_blocks_transformer().
| WL** low |
Definition at line 104 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::combine(), crt_blocks_transformer< WL, WH, s, V >::comodulus(), crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer(), crt_blocks_transformer< WL, WH, s, V >::direct_transform(), crt_blocks_transformer< WL, WH, s, V >::inverse_transform(), implementation< matrix_multiply, V, matrix_crt< W > >::mul(), crt_blocks_transformer< WL, WH, s, V >::operator[](), crt_blocks_transformer< WL, WH, s, V >::setup_inverse(), and crt_blocks_transformer< WL, WH, s, V >::~crt_blocks_transformer().
| nat m |
Definition at line 103 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::combine(), crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer(), crt_blocks_transformer< WL, WH, s, V >::direct_transform(), crt_blocks_transformer< WL, WH, s, V >::inverse_transform(), crt_blocks_transformer< WL, WH, s, V >::setup_inverse(), and crt_blocks_transformer< WL, WH, s, V >::~crt_blocks_transformer().
| nat n |
Definition at line 103 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::combine(), crt_blocks_transformer< WL, WH, s, V >::comodulus(), crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer(), crt_blocks_transformer< WL, WH, s, V >::direct_transform(), crt_blocks_transformer< WL, WH, s, V >::inverse_transform(), crt_blocks_transformer< WL, WH, s, V >::operator[](), crt_blocks_transformer< WL, WH, s, V >::size(), and crt_blocks_transformer< WL, WH, s, V >::~crt_blocks_transformer().
| Modulus P |
Definition at line 107 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer(), crt_blocks_transformer< WL, WH, s, V >::direct_transform(), crt_blocks_transformer< WL, WH, s, V >::inverse_transform(), and crt_blocks_transformer< WL, WH, s, V >::product().
| bool setup |
Definition at line 109 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer(), and crt_blocks_transformer< WL, WH, s, V >::setup_inverse().