You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to merge multiple BitVecs, such that if a position has a 1 in one of the BitVecs, that position in the final set will store 1; if all the BitVecs have 0 in that position, the result will be 0. I am attempting to accomplish this task in the following way:
for each_class in mask {for all in mask_all.as_raw_mut_slice(){for current in each_class.mask.as_raw_slice(){*all |= *current;}}}
But it doesn't seem to be working properly, how should I change it? This is the current version that works:
for each_class in mask {for(index, all)in each_class.mask.iter().enumerate(){if*all {
mask_all.set(index,true);}}}
The text was updated successfully, but these errors were encountered:
Anivie
changed the title
What is the best way to merge multiple bit vectors?
The best way to merge multiple bit vectors?
Sep 29, 2024
I am trying to merge multiple BitVecs, such that if a position has a 1 in one of the BitVecs, that position in the final set will store 1; if all the BitVecs have 0 in that position, the result will be 0. I am attempting to accomplish this task in the following way:
But it doesn't seem to be working properly, how should I change it? This is the current version that works:
The text was updated successfully, but these errors were encountered: