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

Method truncate

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

Adds a node to the parent graph that divides a scalar or each entry of the array associated with the node by a positive constant integer `scale`. Applies [Graph::add] to the parent graph, `this` node and `scale`. # Example ``` # use ciphercore_base::graphs::create_context; # use ciphercore_base::data_types::{INT32, array_type}; let c = create_context().unwrap(); let g = c.create_graph().unwrap(

(&self, scale: u128)

Source from the content-addressed store, hash-verified

894 /// let n2 = n1.truncate(4).unwrap();
895 /// ```
896 pub fn truncate(&self, scale: u128) -> Result<Node> {
897 self.get_graph().truncate(self.clone(), scale)
898 }
899
900 /// Adds a node to the parent graph that computes the sum of entries of the array associated with the node along given axes.
901 ///

Callers 15

get_sub_vector_helperFunction · 0.45
test_truncate_workerFunction · 0.45
test_wellformed_casesFunction · 0.45
multiply_fixed_pointFunction · 0.45
instantiateMethod · 0.45
instantiateMethod · 0.45
instantiateMethod · 0.45
compute_naive_aucFunction · 0.45
create_approximationFunction · 0.45

Calls 3

cloneMethod · 0.80
add_nodeMethod · 0.80
get_graphMethod · 0.45

Tested by 4

test_truncate_workerFunction · 0.36
test_wellformed_casesFunction · 0.36