File tree Expand file tree Collapse file tree 1 file changed +15
-24
lines changed
Expand file tree Collapse file tree 1 file changed +15
-24
lines changed Original file line number Diff line number Diff line change @@ -101,32 +101,23 @@ impl<F> Sampler<F> {
101101 . collect :: < Vec < _ > > ( ) ;
102102 let transform = |zk| state. cov_transform ( ) * zk;
103103
104- match constraints {
104+ let ok_constraints = | yk : & DVector < f64 > | match constraints {
105105 Some ( constraints) => {
106- let ok_constraints = |yk : & DVector < f64 > | {
107- let point = to_point ( & yk, state. mean ( ) , state. sigma ( ) ) ;
108- constraints. meets_constraints ( & point)
109- } ;
110-
111- if parallel_update {
112- z. into_par_iter ( )
113- . map ( transform)
114- . filter ( ok_constraints)
115- . collect ( )
116- } else {
117- z. into_iter ( )
118- . map ( transform)
119- . filter ( ok_constraints)
120- . collect ( )
121- }
122- }
123- None => {
124- if parallel_update {
125- z. into_par_iter ( ) . map ( transform) . collect ( )
126- } else {
127- z. into_iter ( ) . map ( transform) . collect ( )
128- }
106+ constraints. meets_constraints ( & to_point ( & yk, state. mean ( ) , state. sigma ( ) ) )
129107 }
108+ None => true ,
109+ } ;
110+
111+ if parallel_update {
112+ z. into_par_iter ( )
113+ . map ( transform)
114+ . filter ( ok_constraints)
115+ . collect ( )
116+ } else {
117+ z. into_iter ( )
118+ . map ( transform)
119+ . filter ( ok_constraints)
120+ . collect ( )
130121 }
131122 } ;
132123
You can’t perform that action at this time.
0 commit comments