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

Method degree

expander_compiler/src/circuit/ir/expr.rs:329–345  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

327 Expression { terms }
328 }
329 pub fn degree(&self) -> usize {
330 let mut has_linear = false;
331 for term in self.iter() {
332 match term.vars {
333 VarSpec::Const => {}
334 VarSpec::Linear(_) => has_linear = true,
335 VarSpec::Quad(_, _) => return 2,
336 VarSpec::Custom { .. } => return 2,
337 VarSpec::RandomLinear(_) => panic!("unexpected situation: RandomLinear"),
338 }
339 }
340 if has_linear {
341 1
342 } else {
343 0
344 }
345 }
346 pub fn count_of_degrees(&self) -> [usize; 3] {
347 let mut res = [0; 3];
348 for term in self.iter() {

Callers 10

to_singleFunction · 0.80
to_single_strippedFunction · 0.80
to_really_singleFunction · 0.80
try_get_really_single_idFunction · 0.80
mul_two_exprFunction · 0.80
make_singleMethod · 0.80
try_make_singleMethod · 0.80
make_really_singleMethod · 0.80
mul_vecMethod · 0.80

Calls 1

iterMethod · 0.80

Tested by

no test coverage detected