File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ impl AlphaSAnalytic {
114114 if nf == 0 {
115115 return Err ( Error :: NfZeroValueError ) ;
116116 }
117- match self . lambda_maps . get ( & self . num_fl ) {
117+ match self . lambda_maps . get ( & nf ) {
118118 Some ( lambda_value) => Ok ( * lambda_value) ,
119119 None => self . lambda_qcd ( nf - 1 ) ,
120120 }
@@ -202,10 +202,20 @@ pub struct AlphaSInterpol {
202202
203203impl AlphaSInterpol {
204204 pub fn from_metadata ( meta : & MetaData ) -> Result < Self , String > {
205- let q2_values: Vec < f64 > = meta. alphas_q_values . iter ( ) . map ( |& q| ( q * q) . ln ( ) ) . collect ( ) ;
205+ let ( q_values, alphas_vals) : ( Vec < _ > , Vec < _ > ) = meta
206+ . alphas_q_values
207+ . iter ( )
208+ . zip ( & meta. alphas_vals )
209+ . enumerate ( )
210+ . filter ( |( i, ( & q, _) ) | * i == 0 || q != meta. alphas_q_values [ i - 1 ] )
211+ . map ( |( _, ( & q, & alpha) ) | ( q, alpha) )
212+ . unzip ( ) ;
213+
214+ let q2_values: Vec < f64 > = q_values. iter ( ) . map ( |& q| ( q * q) . ln ( ) ) . collect ( ) ;
215+
206216 let interpolator = Interp1D :: new (
207217 q2_values. into ( ) ,
208- meta . alphas_vals . to_owned ( ) . into ( ) ,
218+ alphas_vals. into ( ) ,
209219 AlphaSCubicInterpolation ,
210220 Extrapolate :: Error ,
211221 )
You can’t perform that action at this time.
0 commit comments