// NewLeastSquaresFunction creates a new least squares function based
// on a set of points.
166356
func NewLeastSquaresFunction(points Points) *LeastSquaresFunction {
	lsf := new(LeastSquaresFunction)
	if points != nil {
		lsf.AppendPoints(points)
	}
	return lsf
}
1092709
func New(x, y, w, h int) *XRect {
	return &XRect{x, y, w, h}
}
159224
func (lsf *LeastSquaresFunction) EvalPoints(fromX, toX float64, count int) Points {
	return evalPoints(lsf, fromX, toX, count)
}
457969
func New(left, right []interface{}) Lcs {
	return &lcs{
		left:       left,
		right:      right,
		table:      nil,
		indexPairs: nil,
		values:     nil,
	}
}
646777
func SassMakeFunction(signature string, idx int) SassFunc {
	csign := C.CString(signature)
	ptr := unsafe.Pointer(uintptr(idx))
	fn := C.sass_make_function(
		csign,
		C.Sass_Function_Fn(C.CallSassFunction),
		ptr)

	return (SassFunc)(fn)
}
1253381
func NewAggFuncDesc(ctx sessionctx.Context, name string, args []expression.Expression, hasDistinct bool) *AggFuncDesc {
	b := newBaseFuncDesc(ctx, name, args)
	return &AggFuncDesc{baseFuncDesc: b, HasDistinct: hasDistinct}
}
310668
func getEQFunctionOffset(expr expression.Expression, cols []*model.IndexColumn) int {
	f, ok := expr.(*expression.ScalarFunction)
	if !ok || f.FuncName.L != ast.EQ {
		return -1
	}
	if c, ok := f.GetArgs()[0].(*expression.Column); ok {
		if _, ok := f.GetArgs()[1].(*expression.Constant); ok {
			for i, col := range cols {
				if col.Name.L == c.ColName.L {
					return i
				}
			}
		}
	} else if _, ok := f.GetArgs()[0].(*expression.Constant); ok {
		if c, ok := f.GetArgs()[1].(*expression.Column); ok {
			for i, col := range cols {
				if col.Name.L == c.ColName.L {
					return i
				}
			}
		}
	}
	return -1
}
363922
func NewFunctionQueue(queueSize uint) *FunctionQueue {
	fq := &FunctionQueue{
		queue:  make(chan queuedFunction, queueSize),
		stopCh: make(chan struct{}),
	}
	go fq.run()
	return fq
}
920261
func NewFunction(FunctionName node.Node, ReturnsRef bool, Params []node.Node, ReturnType node.Node, Stmts []node.Node, PhpDocComment string) *Function {
	return &Function{
		FreeFloating:  nil,
		ReturnsRef:    ReturnsRef,
		PhpDocComment: PhpDocComment,
		FunctionName:  FunctionName,
		Params:        Params,
		ReturnType:    ReturnType,
		Stmts:         Stmts,
	}
}
999544
func (m *Matrix) IsSquare() bool {
	return m.stride == (len(m.elements) / m.stride)
}
43217
func sumSquares(s metrics.Sample) float64 {
	count := float64(s.Count())
	sumSquared := math.Pow(count*s.Mean(), 2)
	sumSquares := math.Pow(count*s.StdDev(), 2) + sumSquared/count
	if math.IsNaN(sumSquares) {
		return 0.0
	}
	return sumSquares
}
374524
func NewValuesFunc(offset int, retTp *types.FieldType, ctx context.Context) *ScalarFunction {
	bt := &builtinValuesSig{newBaseBuiltinFunc(nil, ctx), offset}
	return &ScalarFunction{
		FuncName: model.NewCIStr(ast.Values),
		RetType:  retTp,
		Function: bt,
	}
}
619250
func MarkSquares(c color.Color, sqs ...chess.Square) func(*encoder) {
	return func(e *encoder) {
		for _, sq := range sqs {
			e.marks[sq] = c
		}
	}
}
1347142
func (runtime *_runtime) newBoundFunction(target *_object, this Value, argumentList []Value) *_object {
	self := runtime.newBoundFunctionObject(target, this, argumentList)
	self.prototype = runtime.global.FunctionPrototype
	prototype := runtime.newObject()
	self.defineProperty("prototype", toValue_object(prototype), 0100, false)
	prototype.defineProperty("constructor", toValue_object(self), 0100, false)
	return self
}
988755
func NewFunction(args []Type, result Type) *Function {
	return &Function{
		args:   args,
		result: result,
	}
}
475970
func (p *Pattern) geoNestedSquares() {
	blockSize := utils.Map(utils.HexVal(p.Hash, 0, 1), 0, 15, 4, 12)
	squareSize := blockSize * 7

	p.Svg.SetHeight(int((squareSize+blockSize)*6 + blockSize*6))
	p.Svg.SetWidth(int((squareSize+blockSize)*6 + blockSize*6))

	i := 0
	for y := 0; y <= 5; y++ {
		for x := 0; x <= 5; x++ {

			val := utils.HexVal(p.Hash, i, 1)
			opacity := utils.Opacity(val)
			fill := utils.FillColor(val)

			styles := make(map[string]interface{})
			styles["fill"] = "none"
			styles["stroke"] = fill
			styles["style"] = map[string]string{"opacity": fmt.Sprintf("%v", opacity), "stroke-width": fmt.Sprintf("%vpx", blockSize)}

			p.Svg.Rect(float64(x)*squareSize+float64(x)*blockSize*2+blockSize/2, float64(y)*squareSize+float64(y)*blockSize*2+blockSize/2, squareSize, squareSize, styles)

			val = utils.HexVal(p.Hash, 39-i, 1)
			opacity = utils.Opacity(val)
			fill = utils.FillColor(val)

			styles = make(map[string]interface{})
			styles["fill"] = "none"
			styles["stroke"] = fill
			styles["style"] = map[string]string{"opacity": fmt.Sprintf("%v", opacity), "stroke-width": fmt.Sprintf("%vpx", blockSize)}

			p.Svg.Rect(float64(x)*squareSize+float64(x)*blockSize*2+blockSize/2+blockSize*2, float64(y)*squareSize+float64(y)*blockSize*2+blockSize/2+blockSize*2, blockSize*3, blockSize*3, styles)

			i = i + 1
		}
	}
}
838663
func SquareDistance(a, b *T) float64 {
	d := Sub(a, b)
	return d.LengthSqr()
}