// Length returns the sum of the length of the LineStrings.
9805
func (g *MultiLineString) Length() float64 {
	return length2(g.flatCoords, 0, g.ends, g.stride)
}
930869
func (f *RetireConnectionIDFrame) Length(protocol.VersionNumber) protocol.ByteCount {
	return 1 + utils.VarIntLen(f.SequenceNumber)
}
195841
func (vec *T) LengthSqr() float64 {
	return vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]
}
1229345
func stringLengthFunc(arg1 query) func(query, iterator) interface{} {
	return func(q query, t iterator) interface{} {
		switch v := arg1.Evaluate(t).(type) {
		case string:
			return float64(len(v))
		case query:
			node := v.Select(t)
			if node == nil {
				break
			}
			return float64(len(node.Value()))
		}
		return float64(0)
	}
}
1025918
func ExtractLength(opts ...interface{}) *opt.LengthOption {
	for _, o := range opts {
		if v, ok := o.(*opt.LengthOption); ok {
			return v
		}
	}
	return nil
}
886270
func (f *AckFrame) Length(version protocol.VersionNumber) protocol.ByteCount {
	largestAcked := f.AckRanges[0].Largest
	numRanges := f.numEncodableAckRanges()

	length := 1 + utils.VarIntLen(uint64(largestAcked)) + utils.VarIntLen(encodeAckDelay(f.DelayTime))

	length += utils.VarIntLen(uint64(numRanges - 1))
	lowestInFirstRange := f.AckRanges[0].Smallest
	length += utils.VarIntLen(uint64(largestAcked - lowestInFirstRange))

	for i := 1; i < numRanges; i++ {
		gap, len := f.encodeAckRange(i)
		length += utils.VarIntLen(gap)
		length += utils.VarIntLen(len)
	}
	return length
}
478984
func (s *String) Length() *Number {
	return &Number{s.chain, float64(len(s.value))}
}
1344169
func (s *OIDSet) Length() int {
	if s == nil {
		return 0
	}
	return int(s.C_gss_OID_set.count)
}
689691
func (a *assertion) Length(obtained interface{}, expected int, msgs ...string) bool {
	length, err := a.Len(obtained)
	if err != nil {
		return a.failer.Fail(Length, ValueDescription(obtained), expected, err.Error())
	}
	if length != expected {
		return a.failer.Fail(Length, length, expected, msgs...)
	}
	return true
}
1237242
func MinLength(path, in, data string, minLength int64) *errors.Validation {
	strLen := int64(utf8.RuneCount([]byte(data)))
	if strLen < minLength {
		return errors.TooShort(path, in, minLength)
	}
	return nil
}
597693
func Length(x uint64) int {
	// TODO: use math/bits when it's merged in 1.9

	// Loop: for loop
	// Log10: math.Log10
	// Asm: https://graphics.stanford.edu/~seander/bithacks.html#IntegerLog10
	// 	with "IntegerLogBase2(v)" in assembly implemented similar to GCC's
	// 	__builtin_clzll.
	// Cond: the switch below
	//
	// 	Seq: sequential numbers
	// 	Rand: random numbers
	//
	// BenchmarkIntLenLoopSeq-4     	200000000         7.87 ns/op
	// BenchmarkIntLenLog10Seq-4    	30000000        43.8 ns/op
	// BenchmarkIntLenAsmSeq-4      	200000000         7.38 ns/op
	// BenchmarkIntLenCondSeq-4     	500000000         3.67 ns/op
	//
	// BenchmarkIntLenLoopRand-4    	10000000000000000000        21.8 ns/op
	// BenchmarkIntLenLog10Rand-4   	30000000        44.5 ns/op
	// BenchmarkIntLenAsmRand-4     	200000000         8.62 ns/op
	// BenchmarkIntLenCondRand-4    	200000000         8.09 ns/op

	switch {
	case x < 10:
		return 1
	case x < 100:
		return 2
	case x < 1000:
		return 3
	case x < 10000:
		return 4
	case x < 100000:
		return 5
	case x < 1000000:
		return 6
	case x < 10000000:
		return 7
	case x < 100000000:
		return 8
	case x < 1000000000:
		return 9
	case x < 10000000000:
		return 10
	case x < 100000000000:
		return 11
	case x < 1000000000000:
		return 12
	case x < 10000000000000:
		return 13
	case x < 100000000000000:
		return 14
	case x < 1000000000000000:
		return 15
	case x < 10000000000000000:
		return 16
	case x < 100000000000000000:
		return 17
	case x < 1000000000000000000:
		return 18
	case x < 10000000000000000000:
		return 19
	default:
		panic("unreachable")
	}
}
447515
func (s *RedisQueueStore) Length(key string) (int, error) {
	if !strings.HasPrefix(key, s.prefix) {
		key = s.prefix + key
	}
	res, err := s.client.LLen(key).Result()
	if err == redis.Nil {
		return int(res), nil
	}
	return int(res), err
}
259533
func (lru *LRUCache) Length() int64 {
	lru.mu.Lock()
	defer lru.mu.Unlock()
	return int64(lru.list.Len())
}
812528
func (b *Buffer) Size() int {
	size := len(b.Buf)
	for _, buf := range b.bufs {
		size += len(buf)
	}
	return size
}
546474
func Length(p0, p1, p2 *vec2.T, t float64) float64 {
	ax := p0[0] - 2*p1[0] + p2[0]
	ay := p0[1] - 2*p1[1] + p2[1]
	bx := 2*p1[0] - 2*p0[0]
	by := 2*p1[1] - 2*p0[1]

	a := 4 * (ax*ax + ay*ay)
	b := 4 * (ax*bx + ay*by)
	c := bx*bx + by*by

	abc := 2 * math.Sqrt(a+b+c)
	a2 := math.Sqrt(a)
	a32 := 2 * a * a2
	c2 := 2 * math.Sqrt(c)
	ba := b / a2

	return t * (a32*abc + a2*b*(abc-c2) + (4*c*a-b*b)*math.Log((2*a2+ba+abc)/(ba+c2))) / (4 * a32)
}
845385
func length(v interface{}, param string) error {
	st := reflect.ValueOf(v)
	valid := true
	if st.Kind() == reflect.Ptr {
		if st.IsNil() {
			return nil
		}
		st = st.Elem()
	}
	switch st.Kind() {
	case reflect.String:
		p, err := asInt(param)
		if err != nil {
			return ErrBadParameter
		}
		valid = int64(len(st.String())) == p
	case reflect.Slice, reflect.Map, reflect.Array:
		p, err := asInt(param)
		if err != nil {
			return ErrBadParameter
		}
		valid = int64(st.Len()) == p
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		p, err := asInt(param)
		if err != nil {
			return ErrBadParameter
		}
		valid = st.Int() == p
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
		p, err := asUint(param)
		if err != nil {
			return ErrBadParameter
		}
		valid = st.Uint() == p
	case reflect.Float32, reflect.Float64:
		p, err := asFloat(param)
		if err != nil {
			return ErrBadParameter
		}
		valid = st.Float() == p
	default:
		return ErrUnsupported
	}
	if !valid {
		return ErrLen
	}
	return nil
}
1095217
func (f *StreamFrame) Length(version protocol.VersionNumber) protocol.ByteCount {
	length := 1 + utils.VarIntLen(uint64(f.StreamID))
	if f.Offset != 0 {
		length += utils.VarIntLen(uint64(f.Offset))
	}
	if f.DataLenPresent {
		length += utils.VarIntLen(uint64(f.DataLen()))
	}
	return length + f.DataLen()
}