MCPcopy Create free account
hub / github.com/ciphermodelabs/ciphercore / zip

Method zip

ciphercore-base/src/graphs.rs:2906–2908  ·  view source on GitHub ↗

Adds a node that takes vectors V 1 (n, t 1 ), V 2 (n, t 2 ), ..., V k (n, t k ) of the same length and returns a vector V(n, tuple(t 1 , ..., t k )) (similar to [zip](https://doc.rust-lang.org/stable/std/iter/fn.zip.html)). # Arguments `nodes` - vector of nodes containing input vectors # Returns New zip node # Example ``

(&self, nodes: Vec<Node>)

Source from the content-addressed store, hash-verified

2904 /// let n3 = g.zip(vec![n1,n2]).unwrap();
2905 /// ```
2906 pub fn zip(&self, nodes: Vec<Node>) -> Result<Node> {
2907 self.add_node(nodes, vec![], Operation::Zip)
2908 }
2909
2910 /// Adds a node that creates a vector with `n` copies of a value of a given node.
2911 ///

Callers 15

to_vectorMethod · 0.45
process_nodeMethod · 0.45
test_zip_workerFunction · 0.45
test_zip_worker_failFunction · 0.45
test_wellformed_casesFunction · 0.45
call_iterate_testFunction · 0.45
pwl_array_testFunction · 0.45
pwl_array2d_testFunction · 0.45

Calls 1

add_nodeMethod · 0.80

Tested by 13

test_zip_workerFunction · 0.36
test_zip_worker_failFunction · 0.36
test_wellformed_casesFunction · 0.36
call_iterate_testFunction · 0.36
pwl_array_testFunction · 0.36
pwl_array2d_testFunction · 0.36
test_sortFunction · 0.36
test_zip_arrays_getFunction · 0.36