mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 13:16:44 +01:00
Added VecZnxBorrow
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use crate::{VecZnx, VmpPMat};
|
||||
use crate::{VecZnx, VecZnxBorrow, VmpPMat};
|
||||
|
||||
pub trait Infos {
|
||||
/// Returns the ring degree of the receiver.
|
||||
@@ -46,6 +46,33 @@ impl Infos for VecZnx {
|
||||
}
|
||||
}
|
||||
|
||||
impl Infos for VecZnxBorrow {
|
||||
/// Returns the base 2 logarithm of the [VecZnx] degree.
|
||||
fn log_n(&self) -> usize {
|
||||
(usize::BITS - (self.n - 1).leading_zeros()) as _
|
||||
}
|
||||
|
||||
/// Returns the [VecZnx] degree.
|
||||
fn n(&self) -> usize {
|
||||
self.n
|
||||
}
|
||||
|
||||
/// Returns the number of limbs of the [VecZnx].
|
||||
fn limbs(&self) -> usize {
|
||||
self.limbs
|
||||
}
|
||||
|
||||
/// Returns the number of limbs of the [VecZnx].
|
||||
fn cols(&self) -> usize {
|
||||
self.limbs
|
||||
}
|
||||
|
||||
/// Returns the number of limbs of the [VecZnx].
|
||||
fn rows(&self) -> usize {
|
||||
1
|
||||
}
|
||||
}
|
||||
|
||||
impl Infos for VmpPMat {
|
||||
/// Returns the ring dimension of the [VmpPMat].
|
||||
fn n(&self) -> usize {
|
||||
|
||||
Reference in New Issue
Block a user