src/scaled.rs

changeset 46
90cc221eb52b
parent 18
84923812d220
child 55
15f01efc034b
equal deleted inserted replaced
45:cac6978dc7dd 46:90cc221eb52b
6 use crate::manifold::ManifoldPoint; 6 use crate::manifold::ManifoldPoint;
7 use crate::fb::{Grad, Desc, Prox}; 7 use crate::fb::{Grad, Desc, Prox};
8 8
9 /// Structure for a function of type `G`, scaled by a scalar. 9 /// Structure for a function of type `G`, scaled by a scalar.
10 pub struct Scaled<G> { 10 pub struct Scaled<G> {
11 /// Scaling factor
11 α : f64, 12 α : f64,
13 /// The base function
12 g : G, 14 g : G,
13 } 15 }
14 16
15 impl<G> Scaled<G> { 17 impl<G> Scaled<G> {
18 /// Creates a new scaled function.
16 #[allow(dead_code)] 19 #[allow(dead_code)]
17 pub fn new(α : f64, g : G) -> Self { 20 pub fn new(α : f64, g : G) -> Self {
18 Scaled{ α, g } 21 Scaled{ α, g }
19 } 22 }
20 } 23 }

mercurial