MCPcopy Create free account
hub / github.com/PolyhedraZK/ExpanderCompilerCollection / to_single

Function to_single

expander_compiler/src/builder/basic.rs:380–387  ·  view source on GitHub ↗
(mid_vars: &mut Pool<Expression<C>>, expr: &Expression<C>)

Source from the content-addressed store, hash-verified

378}
379
380fn to_single<C: Config>(mid_vars: &mut Pool<Expression<C>>, expr: &Expression<C>) -> Expression<C> {
381 let (e, coef, constant) = strip_constants(expr);
382 if e.len() == 1 && e.degree() <= 1 {
383 return expr.clone();
384 }
385 let idx = mid_vars.add(&e);
386 unstrip_constants_single(idx, coef, constant)
387}
388
389fn to_single_stripped<C: Config>(
390 mid_vars: &mut Pool<Expression<C>>,

Callers 2

lin_comb_innerFunction · 0.85
mul_two_exprFunction · 0.85

Calls 6

degreeMethod · 0.80
strip_constantsFunction · 0.70
unstrip_constants_singleFunction · 0.70
lenMethod · 0.45
cloneMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected