File tree Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Expand file tree Collapse file tree 4 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ fn main() -> anyhow::Result<()> {
265265        . configure ( |config| { 
266266            config
267267                . n_cstr ( N_CSTR ) 
268-                 . cstr_tol ( & cstr_tol) 
268+                 . cstr_tol ( cstr_tol. clone ( ) ) 
269269                . n_clusters ( 1 ) 
270270                . n_start ( 50 ) 
271271                . n_doe ( n_doe) 
Original file line number Diff line number Diff line change @@ -412,13 +412,20 @@ mod tests {
412412            . with_rng ( Xoshiro256Plus :: seed_from_u64 ( 42 ) ) 
413413            . sample ( 3 ) ; 
414414        let  res = EgorBuilder :: optimize ( f_g24) 
415-             . configure ( |config| config. n_cstr ( 2 ) . doe ( & doe) . max_iters ( 20 ) . random_seed ( 42 ) ) 
415+             . configure ( |config| { 
416+                 config
417+                     . n_cstr ( 2 ) 
418+                     . doe ( & doe) 
419+                     . max_iters ( 20 ) 
420+                     . cstr_tol ( array ! [ 2e-6 ,  1e-6 ] ) 
421+                     . random_seed ( 42 ) 
422+             } ) 
416423            . min_within ( & xlimits) 
417424            . run ( ) 
418425            . expect ( "Minimize failure" ) ; 
419426        println ! ( "G24 optim result = {res:?}" ) ; 
420427        let  expected = array ! [ 2.3295 ,  3.1785 ] ; 
421-         assert_abs_diff_eq ! ( expected,  res. x_opt,  epsilon = 5e -2) ; 
428+         assert_abs_diff_eq ! ( expected,  res. x_opt,  epsilon = 2e -2) ; 
422429    } 
423430
424431    #[ test]  
@@ -434,7 +441,7 @@ mod tests {
434441                    . regression_spec ( RegressionSpec :: ALL ) 
435442                    . correlation_spec ( CorrelationSpec :: ALL ) 
436443                    . n_cstr ( 2 ) 
437-                     . cstr_tol ( & array ! [ 2e-6 ,  2e-6 ] ) 
444+                     . cstr_tol ( array ! [ 2e-6 ,  2e-6 ] ) 
438445                    . q_points ( 2 ) 
439446                    . qei_strategy ( QEiStrategy :: KrigingBeliever ) 
440447                    . doe ( & doe) 
Original file line number Diff line number Diff line change @@ -125,8 +125,8 @@ impl EgorConfig {
125125    } 
126126
127127    /// Sets the tolerance on constraints violation (`cstr < tol`) 
128-      pub  fn  cstr_tol ( mut  self ,  tol :  & Array1 < f64 > )  -> Self  { 
129-         self . cstr_tol  = Some ( tol. to_owned ( ) ) ; 
128+      pub  fn  cstr_tol ( mut  self ,  tol :  Array1 < f64 > )  -> Self  { 
129+         self . cstr_tol  = Some ( tol) ; 
130130        self 
131131    } 
132132
Original file line number Diff line number Diff line change @@ -433,7 +433,7 @@ impl Egor {
433433            . max_iters ( max_iters. unwrap_or ( 1 ) ) 
434434            . n_start ( self . n_start ) 
435435            . n_doe ( self . n_doe ) 
436-             . cstr_tol ( & cstr_tol) 
436+             . cstr_tol ( cstr_tol) 
437437            . regression_spec ( egobox_moe:: RegressionSpec :: from_bits ( self . regression_spec . 0 ) . unwrap ( ) ) 
438438            . correlation_spec ( 
439439                egobox_moe:: CorrelationSpec :: from_bits ( self . correlation_spec . 0 ) . unwrap ( ) , 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments