Skip to content

Commit 1a6e114

Browse files
committed
Fix bug in unfold_with_enum_mask
1 parent ff073e0 commit 1a6e114

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ego/src/mixint.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub fn unfold_with_enum_mask(
114114
) -> Array2<f64> {
115115
let mut xunfold = Array::zeros((x.nrows(), compute_unfolded_dimension(xtypes)));
116116
let mut unfold_index = 0;
117-
xtypes.iter().for_each(|s| match s {
117+
xtypes.iter().enumerate().for_each(|(i, s)| match s {
118118
XType::Cont(_, _) | XType::Int(_, _) | XType::Ord(_) => {
119119
xunfold
120120
.column_mut(unfold_index)
@@ -126,8 +126,8 @@ pub fn unfold_with_enum_mask(
126126
Zip::from(unfold.rows_mut())
127127
.and(x.rows())
128128
.for_each(|mut row, xrow| {
129-
let index = xrow[[unfold_index]] as usize;
130-
row[[index]] = 1.;
129+
let index = xrow[i] as usize;
130+
row[index] = 1.;
131131
});
132132
xunfold
133133
.slice_mut(s![.., unfold_index..unfold_index + v])
@@ -368,7 +368,7 @@ impl MixintMoeValidParams {
368368
}
369369

370370
impl SurrogateBuilder for MixintMoeParams {
371-
fn new_with_xtypes_rng(xtypes: &[XType]) -> Self {
371+
fn new_with_xtypes(xtypes: &[XType]) -> Self {
372372
MixintMoeParams::new(xtypes, &MoeParams::new())
373373
}
374374

0 commit comments

Comments
 (0)