MCPcopy Index your code
hub / github.com/ciphermodelabs/ciphercore / constant

Method constant

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

Adds a node creating a constant of a given type and value. # Arguments `output_type` - type of a constant `value` - value of a constant # Returns New constant node # Example ``` # use ciphercore_base::graphs::create_context; # use ciphercore_base::data_types::{BIT, scalar_type}; # use ciphercore_base::data_values::Value; let c = create_context().unwrap(); let g = c.create_graph().unwrap(); l

(&self, output_type: Type, value: Value)

Source from the content-addressed store, hash-verified

2648 /// let n = g.constant(t, v).unwrap();
2649 /// ```
2650 pub fn constant(&self, output_type: Type, value: Value) -> Result<Node> {
2651 self.add_node(vec![], vec![], Operation::Constant(output_type, value))
2652 }
2653
2654 /// Adds a node converting an integer array or scalar to the binary form.
2655 ///

Callers 15

test_constant_workerFunction · 0.45
create_dummy_graphFunction · 0.45
test_wellformed_casesFunction · 0.45
call_iterate_testFunction · 0.45
context_generatorsFunction · 0.45
constantFunction · 0.45
get_msb_flip_constantFunction · 0.45
instantiateMethod · 0.45
create_approximationFunction · 0.45

Calls 1

add_nodeMethod · 0.80

Tested by 15

test_constant_workerFunction · 0.36
test_wellformed_casesFunction · 0.36
call_iterate_testFunction · 0.36
test_empty_state_iterateFunction · 0.36
test_simpleFunction · 0.36
test_no_duplicatesFunction · 0.36