Selects elements of node 0 if bits of node b are zero and elements of node 1 otherwise. Broadcasting is applied # Arguments - `a0` - node 0 containing an array - `a1` - node 1 containing an array of the same type as `a` - `b` - node containing selection bits # Returns Node containing an array with selected elements of `a0` or `a1`
(b: Node, a1: Node, a0: Node)
| 217 | /// |
| 218 | /// Node containing an array with selected elements of `a0` or `a1` |
| 219 | pub fn select_node(b: Node, a1: Node, a0: Node) -> Result<Node> { |
| 220 | let dif = a1.subtract(a0.clone())?; |
| 221 | if dif.get_type()?.get_scalar_type() == BIT { |
| 222 | dif.multiply(b)?.add(a0) |
| 223 | } else { |
| 224 | dif.mixed_multiply(b)?.add(a0) |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | pub(super) fn convert_main_graph_to_mpc( |
| 229 | in_context: Context, |
no test coverage detected