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

Method iterate

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

Adds a node that iteratively computes a given finalized graph on the elements of a given vector and updates the state value accordingly. This node calls another `graph` with 2 input nodes `old_state` and `input` and an output node that returns a [tuple](Type::Tuple) `(new_state, output)`. This graph is used to map the elements of a given vector `V` to another vector `W` as follows: ```text graph(

(&self, graph: Graph, state: Node, input: Node)

Source from the content-addressed store, hash-verified

3027 /// g2.iterate(g1, initial_state, input_vector).unwrap();
3028 /// ```
3029 pub fn iterate(&self, graph: Graph, state: Node, input: Node) -> Result<Node> {
3030 self.add_node(vec![state, input], vec![graph], Operation::Iterate)
3031 }
3032
3033 /// Adds a node converting an array to a vector.
3034 ///

Callers 13

test_iterate_workerFunction · 0.45
test_iterate_worker_failFunction · 0.45
call_iterate_testFunction · 0.45
instantiateMethod · 0.45
instantiateMethod · 0.45
instantiateMethod · 0.45
test_inline_iterateFunction · 0.45
test_nested_iterateFunction · 0.45
test_empty_state_iterateFunction · 0.45

Calls 1

add_nodeMethod · 0.80

Tested by 8

test_iterate_workerFunction · 0.36
test_iterate_worker_failFunction · 0.36
call_iterate_testFunction · 0.36
test_inline_iterateFunction · 0.36
test_nested_iterateFunction · 0.36
test_empty_state_iterateFunction · 0.36