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

Method newHintForId

ecgo/builder/builder.go:208–225  ·  view source on GitHub ↗
(id solver.HintID, nbOutputs int, inputs []frontend.Variable)

Source from the content-addressed store, hash-verified

206}
207
208func (builder *builder) newHintForId(id solver.HintID, nbOutputs int, inputs []frontend.Variable) ([]frontend.Variable, error) {
209 hintInputs := builder.toVariableIds(inputs...)
210
211 builder.instructions = append(builder.instructions,
212 irsource.Instruction{
213 Type: irsource.Hint,
214 ExtraId: uint64(id),
215 Inputs: hintInputs,
216 NumOutputs: nbOutputs,
217 },
218 )
219
220 res := make([]frontend.Variable, nbOutputs)
221 for i := 0; i < nbOutputs; i++ {
222 res[i] = builder.addVar()
223 }
224 return res, nil
225}
226
227func (builder *builder) CustomGate(gateType uint64, inputs ...frontend.Variable) frontend.Variable {
228 hintInputs := builder.toVariableIds(inputs...)

Callers 2

NewHintMethod · 0.95
NewHintForIdMethod · 0.95

Calls 2

toVariableIdsMethod · 0.95
addVarMethod · 0.95

Tested by

no test coverage detected