mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 21:26:41 +01:00
added generic copy_from for VecZnxApi
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::{Infos, VecZnx, Encoding};
|
||||
use crate::{Encoding, Infos, VecZnx};
|
||||
use rug::float::Round;
|
||||
use rug::ops::{AddAssignRound, SubAssignRound, DivAssignRound};
|
||||
use rug::ops::{AddAssignRound, DivAssignRound, SubAssignRound};
|
||||
use rug::Float;
|
||||
|
||||
impl VecZnx {
|
||||
@@ -18,9 +18,7 @@ impl VecZnx {
|
||||
x.sub_assign_round(&avg, Round::Nearest);
|
||||
});
|
||||
let mut std: Float = Float::with_val(prec, 0);
|
||||
data.iter().for_each(|x| {
|
||||
std += x*x
|
||||
});
|
||||
data.iter().for_each(|x| std += x * x);
|
||||
std.div_assign_round(Float::with_val(prec, data.len()), Round::Nearest);
|
||||
std = std.sqrt();
|
||||
std.to_f64()
|
||||
|
||||
Reference in New Issue
Block a user