// TraceQuad generate lines subdividing the curve using a Liner
// flattening_threshold helps determines the flattening expectation of the curve
199313
func TraceQuad(t Liner, quad []float64, flatteningThreshold float64) {
	const curveLen = CurveRecursionLimit * 6
	const curveEndIndex = curveLen - 1
	const lastIteration = CurveRecursionLimit - 1

	// Allocates curves stack
	curves := make([]float64, curveLen)

	// copy 6 elements from the quad path to the stack
	copy(curves[0:6], quad[0:6])

	var i int
	var c []float64
	var dx, dy, d float64

	for i >= 0 {
		c = traceGetWindow(curves, i)
		dx, dy, d = traceCalcDeltas(c)

		// bail early if the distance is 0
		if d == 0 {
			return
		}

		// if it's flat then trace a line
		if traceIsFlat(dx, dy, d, flatteningThreshold) || i == lastIteration {
			t.LineTo(c[4], c[5])
			i--
		} else {
			SubdivideQuad(c, traceGetWindow(curves, i+1), traceGetWindow(curves, i))
			i++
		}
	}
}
1197525
func (m *Mux) Trace(pattern PatternType, handler HandlerType) {
	m.rt.handleUntyped(pattern, mTRACE, handler)
}
1347851
func (s *Sling) Trace(pathURL string) *Sling {
	s.method = "TRACE"
	return s.Path(pathURL)
}
567944
func Tracer(tracer trace.Tracer) SchemaOpt {
	return func(s *Schema) {
		s.tracer = tracer
	}
}
392133
func (err *cmnError) Trace(offset int, format string, args ...interface{}) Error {
	msg := fmt.Sprintf(format, args...)
	return err.doTrace(msg, offset)
}
1176384
func Trace(msg string, ctx ...interface{}) {
	metrics.GetOrRegisterCounter("trace", nil).Inc(1)
	l.Output(msg, l.LvlTrace, CallDepth, ctx...)
}
449982
func (mat *MatMxN) Trace() float64 {
	if mat == nil || mat.m != mat.n {
		return float64(math.NaN())
	}

	var out float64
	for i := 0; i < mat.m; i++ {
		out += mat.At(i, i)
	}

	return out
}
1301636
func TraceR(req *http.Request, message string, data Data) {
	TraceC(GetRequestID(req), message, data)
}
22355
func (t TraceID) String() string {
	if t.High == 0 {
		return fmt.Sprintf("%016x", t.Low)
	}
	return fmt.Sprintf("%016x%016x", t.High, t.Low)
}
850325
func (c *Overlay) HighlightQuadWithParams(v *OverlayHighlightQuadParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Overlay.highlightQuad", Params: v})
}
118096
func Trace(arg0 interface{}, args ...interface{}) {
	const (
		lvl = TRACE
	)
	switch first := arg0.(type) {
	case string:
		// Use the string as a format string
		Global.intLogf(lvl, first, args...)
	case func() string:
		// Log the closure (no other arguments used)
		Global.intLogc(lvl, first)
	default:
		// Build a format string so that it will be similar to Sprint
		Global.intLogf(lvl, fmt.Sprint(arg0)+strings.Repeat(" %v", len(args)), args...)
	}
}
229540
func (q *MatchQuery) CutoffFrequency(cutoff float64) *MatchQuery {
	q.cutoffFrequency = &cutoff
	return q
}
649394
func PrintTrace(w io.Writer, r *Rego) {
	if r == nil || r.tracebuf == nil {
		return
	}
	topdown.PrettyTrace(w, *r.tracebuf)
}
708781
func (t *Transaction) AddQuad(q quad.Quad) {
	ad, rd := createDeltas(q)

	if _, adExists := t.deltas[ad]; !adExists {
		if _, rdExists := t.deltas[rd]; rdExists {
			t.deleteDelta(rd)
		} else {
			t.addDelta(ad)
		}
	}
}
116777
func (p *Parser) printTrace(a ...interface{}) {
	if !p.enableTrace {
		return
	}

	const dots = ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "
	const n = len(dots)
	fmt.Printf("%5d:%3d: ", p.tok.Pos.Line, p.tok.Pos.Column)

	i := 2 * p.indent
	for i > n {
		fmt.Print(dots)
		i -= n
	}
	// i <= n
	fmt.Print(dots[0:i])
	fmt.Println(a...)
}
394159
func Trace(e *logrus.Entry, args ...interface{}) {
	level := logrus.Level(atomic.LoadUint32((*uint32)(&e.Logger.Level)))
	if level >= TraceLevel {
		e.Debug(args...)
	}
}
1287173
func (logger *Logger) Tracef(format string, args ...interface{}) {
	logger.log(TRACE, fmt.Sprintf(format, args...))
}