mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 13:16:44 +01:00
Added size and memory layout to VecZnxBig, VecZnxDft and VmpPmat
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use crate::LAYOUT;
|
||||
use crate::cast_mut;
|
||||
use crate::ffi::vec_znx;
|
||||
use crate::ffi::znx;
|
||||
use crate::LAYOUT;
|
||||
use crate::{Infos, Module};
|
||||
use crate::{alloc_aligned, assert_alignement};
|
||||
use itertools::izip;
|
||||
@@ -99,11 +99,6 @@ impl VecZnx {
|
||||
self.data.len() == 0
|
||||
}
|
||||
|
||||
/// TODO: when SML refactoring is done, move this to the [Infos] trait.
|
||||
pub fn size(&self) -> usize {
|
||||
self.size
|
||||
}
|
||||
|
||||
/// Total size is [VecZnx::n()] * [VecZnx::size()] * [VecZnx::cols()].
|
||||
pub fn raw(&self) -> &[i64] {
|
||||
unsafe { std::slice::from_raw_parts(self.ptr, self.n * self.size * self.cols) }
|
||||
@@ -225,6 +220,14 @@ impl Infos for VecZnx {
|
||||
self.n
|
||||
}
|
||||
|
||||
fn size(&self) -> usize {
|
||||
self.size
|
||||
}
|
||||
|
||||
fn layout(&self) -> LAYOUT {
|
||||
self.layout
|
||||
}
|
||||
|
||||
/// Returns the number of cols of the [VecZnx].
|
||||
fn cols(&self) -> usize {
|
||||
self.cols
|
||||
|
||||
Reference in New Issue
Block a user