See [`ComparisonResult`]. `a` and `b` should have type `Array` with bits pulled out to the outermost dimension. Inputs are interpreted as unsigned numbers. The number of bits should be the same in `a` and `b`.
(a: Node, b: Node)
| 232 | /// Inputs are interpreted as unsigned numbers. The number of bits should be the same |
| 233 | /// in `a` and `b`. |
| 234 | fn build_comparison_graph(a: Node, b: Node) -> Result<ComparisonResult> { |
| 235 | let mut to_shrink = ComparisonResult::from_a_b(a, b)?; |
| 236 | let mut remainders = vec![]; |
| 237 | loop { |
| 238 | let shrink_res = to_shrink.shrink()?; |
| 239 | |
| 240 | if let Some(remainder) = shrink_res.remainder { |
| 241 | remainders.push(remainder); |
| 242 | } |
| 243 | |
| 244 | if let Some(shrinked) = shrink_res.shrinked { |
| 245 | to_shrink = shrinked; |
| 246 | } else { |
| 247 | break; |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | let mut res = remainders[0].clone(); |
| 252 | for remainder in remainders[1..].iter() { |
| 253 | res = res.join(remainder)?; |
| 254 | } |
| 255 | Ok(res) |
| 256 | } |
| 257 | |
| 258 | /// As we support broadcasting in comparison arguments, we need to make |
| 259 | /// sure they are still broadcastable after bits are pulled out to the |
no test coverage detected