# HG changeset patch
# User Tuomo Valkonen
# Date 1664131556 -10800
# Node ID 5aa5c279e341bbdc8f7bc9becb521b62bd990973
# Parent eb3c7813b67acf6b6b89c71acd0b24594b0fccd6
Attempt at directly referring to measure masses as SliceStorageMut
diff -r eb3c7813b67a -r 5aa5c279e341 src/fb.rs
--- a/src/fb.rs Thu Dec 01 23:07:35 2022 +0200
+++ b/src/fb.rs Sun Sep 25 21:45:56 2022 +0300
@@ -457,7 +457,7 @@
iterator : I,
plotter : SeqPlotter
) -> DiscreteMeasure, F>
-where F : Float + ToNalgebraRealField,
+where F : Float + ToNalgebraRealField,
I : AlgIteratorFactory>,
for<'b> &'b A::Observable : std::ops::Neg
#[replace_float_literals(F::cast_from(literal).to_nalgebra_mixed())]
-pub fn quadratic_nonneg_ssn(
- mA : &DMatrix,
- g : &DVector,
+pub fn quadratic_nonneg_ssn(
+ mA : &Matrix,
+ g : &Vector,
//c_ : F,
λ_ : F,
- x : &mut DVector,
+ x : &mut Vector,
τ_ : F,
iterator : I
) -> Result
-where F : Float + ToNalgebraRealField,
- I : AlgIteratorFactory
+where F : Float + ToNalgebraRealField,
+ I : AlgIteratorFactory,
+ S : StorageMut>,
+ SA : Storage,
+ SG : Storage>,
{
let n = x.len();
- let mut xprev = x.clone();
+ let mut xprev = x.clone_owned();
let mut v = DVector::zeros(n);
//let c = c_.to_nalgebra_mixed();
let λ = λ_.to_nalgebra_mixed();
let τ = τ_.to_nalgebra_mixed();
let τλ = τ * λ;
let mut inact : Vec = Vec::from_iter(std::iter::repeat(false).take(n));
+ let mut v = {
+ let (r, c) = x.shape_generic();
+ Vector::zeros_generic(r, c)
+ };
let mut s = DVector::zeros(0);
let mut decomp = nalgebra::linalg::LU::new(DMatrix::zeros(0, 0));
let mut iters = 0;
@@ -346,18 +373,21 @@
/// cone_, .
///
/// This function returns the number of iterations taken.
-pub fn quadratic_nonneg(
+pub fn quadratic_nonneg(
method : InnerMethod,
- mA : &DMatrix,
- g : &DVector,
+ mA : &Matrix,
+ g : &Vector,
//c_ : F,
λ : F,
- x : &mut DVector,
+ x : &mut Vector,
τ : F,
iterator : I
) -> usize
-where F : Float + ToNalgebraRealField,
- I : AlgIteratorFactory
+where F : Float + ToNalgebraRealField,
+ I : AlgIteratorFactory,
+ S : StorageMut>,
+ SA : Storage,
+ SG : Storage>,
{
match method {