MCPcopy Create free account
hub / github.com/cel-expr/cel-go / setsCostModel

Function setsCostModel

ext/sets.go:227–232  ·  view source on GitHub ↗
(id string, costFactor float64)

Source from the content-addressed store, hash-verified

225}
226
227func setsCostModel(id string, costFactor float64) cost.OverloadModel {
228 return cost.Overload(id,
229 cost.EvalCost(cost.Sum(cost.Const(cost.CallCost),
230 cost.Scale(cost.Mul(cost.Length(cost.Arg(0)), cost.Length(cost.Arg(1))), costFactor))),
231 cost.BeforeVersion(1, cost.ManualCost(estimateSetsCost(costFactor), trackSetsCost(costFactor))))
232}
233
234func estimateSetsCost(costFactor float64) cost.FunctionEstimator {
235 return func(estimator cost.Estimator, target *cost.AstNode, args []cost.AstNode) *cost.CallEstimate {

Callers 1

CompileOptionsMethod · 0.85

Calls 12

OverloadFunction · 0.92
EvalCostFunction · 0.92
SumFunction · 0.92
ConstFunction · 0.92
ScaleFunction · 0.92
MulFunction · 0.92
LengthFunction · 0.92
ArgFunction · 0.92
BeforeVersionFunction · 0.92
ManualCostFunction · 0.92
estimateSetsCostFunction · 0.85
trackSetsCostFunction · 0.85

Tested by

no test coverage detected