mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 13:16:44 +01:00
more refactoring
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use base2k::{
|
||||
Encoding, FFT64, Infos, Module, Sampling, Scalar, SvpPPol, SvpPPolOps, VecZnx, VecZnxBig, VecZnxBigOps, VecZnxDft,
|
||||
VecZnxDftOps, VecZnxLayout, VecZnxOps, alloc_aligned,
|
||||
Encoding, FFT64, Module, Sampling, Scalar, ScalarZnxDft, ScalarZnxDftOps, VecZnx, VecZnxBig, VecZnxBigOps, VecZnxDft,
|
||||
VecZnxDftOps, VecZnxOps, ZnxInfos, ZnxLayout, alloc_aligned,
|
||||
};
|
||||
use itertools::izip;
|
||||
use sampling::source::Source;
|
||||
@@ -25,7 +25,7 @@ fn main() {
|
||||
s.fill_ternary_prob(0.5, &mut source);
|
||||
|
||||
// Buffer to store s in the DFT domain
|
||||
let mut s_ppol: SvpPPol<FFT64> = module.new_svp_ppol();
|
||||
let mut s_ppol: ScalarZnxDft<FFT64> = module.new_svp_ppol();
|
||||
|
||||
// s_ppol <- DFT(s)
|
||||
module.svp_prepare(&mut s_ppol, &s);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use base2k::{
|
||||
Encoding, FFT64, Infos, Module, VecZnx, VecZnxBig, VecZnxBigOps, VecZnxDft, VecZnxDftOps, VecZnxLayout, VecZnxOps, VmpPMat,
|
||||
VmpPMatOps, alloc_aligned,
|
||||
Encoding, FFT64, MatZnxDft, MatZnxDftOps, Module, VecZnx, VecZnxBig, VecZnxBigOps, VecZnxDft, VecZnxDftOps, VecZnxOps,
|
||||
ZnxInfos, ZnxLayout, alloc_aligned,
|
||||
};
|
||||
|
||||
fn main() {
|
||||
@@ -31,16 +31,16 @@ fn main() {
|
||||
a.print(n);
|
||||
println!();
|
||||
|
||||
let mut vmp_pmat: VmpPMat<FFT64> = module.new_vmp_pmat(rows_mat, 1, limbs_mat);
|
||||
let mut mat_znx_dft: MatZnxDft<FFT64> = module.new_mat_znx_dft(rows_mat, 1, limbs_mat);
|
||||
|
||||
(0..a.limbs()).for_each(|row_i| {
|
||||
let mut tmp: VecZnx = module.new_vec_znx(1, limbs_mat);
|
||||
tmp.at_limb_mut(row_i)[1] = 1 as i64;
|
||||
module.vmp_prepare_row(&mut vmp_pmat, tmp.raw(), row_i, &mut buf);
|
||||
module.vmp_prepare_row(&mut mat_znx_dft, tmp.raw(), row_i, &mut buf);
|
||||
});
|
||||
|
||||
let mut c_dft: VecZnxDft<FFT64> = module.new_vec_znx_dft(1, limbs_mat);
|
||||
module.vmp_apply_dft(&mut c_dft, &a, &vmp_pmat, &mut buf);
|
||||
module.vmp_apply_dft(&mut c_dft, &a, &mat_znx_dft, &mut buf);
|
||||
|
||||
let mut c_big: VecZnxBig<FFT64> = c_dft.as_vec_znx_big();
|
||||
module.vec_znx_idft_tmp_a(&mut c_big, &mut c_dft);
|
||||
|
||||
Reference in New Issue
Block a user