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

Function CombineColumn

ecgo/examples/log_up/main.go:163–183  ·  view source on GitHub ↗
(api ecgo.API, vec_2d [][]frontend.Variable, randomness []frontend.Variable)

Source from the content-addressed store, hash-verified

161}
162
163func CombineColumn(api ecgo.API, vec_2d [][]frontend.Variable, randomness []frontend.Variable) []frontend.Variable {
164 n_rows := len(vec_2d)
165 if n_rows == 0 {
166 return make([]frontend.Variable, 0)
167 }
168
169 n_columns := len(vec_2d[0])
170 if n_columns != len(randomness) {
171 panic("Inconsistent randomness length and column size")
172 }
173
174 vec_return := make([]frontend.Variable, 0)
175 for i := 0; i < n_rows; i++ {
176 var v_at_row_i frontend.Variable = 0
177 for j := 0; j < n_columns; j++ {
178 v_at_row_i = api.Add(v_at_row_i, api.Mul(randomness[j], vec_2d[i][j]))
179 }
180 vec_return = append(vec_return, v_at_row_i)
181 }
182 return vec_return
183}
184
185func LogUpPolyValsAtAlpha(api ecgo.API, vec_1d []frontend.Variable, count []frontend.Variable, x frontend.Variable) RationalNumber {
186 poly := make([]RationalNumber, len(vec_1d))

Callers 1

CheckMethod · 0.70

Calls 2

AddMethod · 0.45
MulMethod · 0.45

Tested by

no test coverage detected