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

Method Sub

ecgo/builder/api.go:49–52  ·  view source on GitHub ↗

Sub computes the difference between the given variables. When more than two variables are provided, the difference is computed as i1 - Σ(i2...).

(i1, i2 frontend.Variable, in ...frontend.Variable)

Source from the content-addressed store, hash-verified

47// Sub computes the difference between the given variables.
48// When more than two variables are provided, the difference is computed as i1 - Σ(i2...).
49func (builder *builder) Sub(i1, i2 frontend.Variable, in ...frontend.Variable) frontend.Variable {
50 vars := builder.toVariableIds(append([]frontend.Variable{i1, i2}, in...)...)
51 return builder.add(vars, true)
52}
53
54// returns res = Σ(vars) or res = vars[0] - Σ(vars[1:]) if sub == true.
55func (builder *builder) add(vars []int, sub bool) frontend.Variable {

Callers 15

SelectMethod · 0.95
Lookup2Method · 0.95
AssertIsEqualMethod · 0.95
AssertIsDifferentMethod · 0.95
mustBeLessOrEqVarMethod · 0.95
MustBeLessOrEqCstMethod · 0.95
LogUpPolyValsAtAlphaFunction · 0.45
DefineMethod · 0.45
keccakFFunction · 0.45
notFunction · 0.45
fromMyBitFormFunction · 0.45
keccakFFunction · 0.45

Calls 2

toVariableIdsMethod · 0.95
addMethod · 0.95

Tested by

no test coverage detected