@@ -230,7 +230,7 @@ impl<SB: SurrogateBuilder> EgorSolver<SB> {
230230 let xtypes = config. xtypes . clone ( ) ;
231231 EgorSolver {
232232 config,
233- xlimits : unfold_xtypes_as_continuous_limits ( & xtypes) ,
233+ xlimits : as_continuous_limits ( & xtypes) ,
234234 surrogate_builder : SB :: new_with_xtypes ( & xtypes) ,
235235 rng,
236236 }
@@ -312,7 +312,7 @@ where
312312 let doe = hstart_doe. as_ref ( ) . or ( self . config . doe . as_ref ( ) ) ;
313313
314314 let ( y_data, x_data) = if let Some ( doe) = doe {
315- let doe = unfold_with_enum_mask ( & self . config . xtypes , doe) ;
315+ let doe = to_continuous_space ( & self . config . xtypes , doe) ;
316316
317317 if doe. ncols ( ) == self . xlimits . nrows ( ) {
318318 // only x are specified
@@ -970,10 +970,9 @@ where
970970 x : & Array2 < f64 > ,
971971 ) -> Array2 < f64 > {
972972 let params = if self . config . discrete ( ) {
973- // When xtypes is specified, we have to cast x to folded space
974- // as EgorSolver works internally in the continuous space
975- let xcast = cast_to_discrete_values ( & self . config . xtypes , x) ;
976- fold_with_enum_index ( & self . config . xtypes , & xcast. view ( ) )
973+ // We have to cast x to folded space as EgorSolver
974+ // works internally in the continuous space
975+ to_discrete_space ( & self . config . xtypes , x)
977976 } else {
978977 x. to_owned ( )
979978 } ;
0 commit comments