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

Method repeat

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

Adds a node that creates a vector with `n` copies of a value of this node. Applies [Graph::repeat] to the parent graph, `this` node and `n`. # Example ``` # use ciphercore_base::data_types::{INT32, array_type}; # use ciphercore_base::graphs::create_context; let c = create_context().unwrap(); let g = c.create_graph().unwrap(); let t = array_type(vec![3, 2, 3], INT32); let n1 = g.input(t).unwrap(

(&self, n: u64)

Source from the content-addressed store, hash-verified

1215 /// let n2 = n1.repeat(10).unwrap();
1216 /// ```
1217 pub fn repeat(&self, n: u64) -> Result<Node> {
1218 self.get_graph().repeat(self.clone(), n)
1219 }
1220
1221 /// Adds a node returning the Cuckoo hash map of an input array of binary strings using provided hash functions.
1222 ///

Calls 3

cloneMethod · 0.80
add_nodeMethod · 0.80
get_graphMethod · 0.45

Tested by 7

test_repeat_workerFunction · 0.36
test_wellformed_casesFunction · 0.36
test_inline_iterateFunction · 0.36
test_nested_iterateFunction · 0.36