// define minmax table
773787
func Minmax(target uint32, internalformat uint32, sink bool) {
	C.glowMinmax(gpMinmax, (C.GLenum)(target), (C.GLenum)(internalformat), (C.GLboolean)(boolToInt(sink)))
}
1263073
func (ic *IntegerConstraint) Maximum(n float64) *IntegerConstraint {
	ic.applyMaximum = true
	ic.maximum = n
	return ic
}
1231053
func (m mathUtil) MaxInt(values ...int) int {
	max := math.MinInt32
	for _, v := range values {
		if v > max {
			max = v
		}
	}
	return max
}
649873
func (s *SummarizedCounter) SetMax(v float64) *SummarizedCounter {
	s.Max = &v
	return s
}
585042
func NormalizeMax(buf *audio.PCMBuffer) {
	if buf == nil {
		return
	}
	buf.SwitchPrimaryType(audio.Float)
	max := 0.0

	for i := 0; i < buf.Len(); i++ {
		if math.Abs(buf.Floats[i]) > max {
			max = math.Abs(buf.Floats[i])
		}
	}

	if max != 0.0 {
		for i := 0; i < buf.Len(); i++ {
			buf.Floats[i] /= max
		}
	}
}
260209
func (q *TermRangeQuery) Min(min string, inclusive bool) *TermRangeQuery {
	q.options["min"] = min
	q.options["inclusive_min"] = inclusive
	return q
}
845707
func Max(data Interface) (max float64, max_index int) {
	Len := data.Len()
	max = data.Get(0)

	for i := 0; i < Len; i++ {
		xi := data.Get(i)

		if xi > max {
			max = xi
			max_index = i
		}

		if math.IsNaN(xi) {
			max = xi
			max_index = i
			return
		}
	}

	return
}
872196
func (m mathUtil) MinInt(values ...int) int {
	min := math.MaxInt32
	for _, v := range values {
		if v < min {
			min = v
		}
	}
	return min
}
932537
func filterMinMax(height, min, max, limit int64) (int64, int64, error) {
	// filter negatives
	if min < 0 || max < 0 {
		return min, max, fmt.Errorf("heights must be non-negative")
	}

	// adjust for default values
	if min == 0 {
		min = 1
	}
	if max == 0 {
		max = height
	}

	// limit max to the height
	max = cmn.MinInt64(height, max)

	// limit min to within `limit` of max
	// so the total number of blocks returned will be `limit`
	min = cmn.MaxInt64(min, max-limit+1)

	if min > max {
		return min, max, fmt.Errorf("min height %d can't be greater than max height %d", min, max)
	}
	return min, max, nil
}
4312
func (s *FieldStats) SetMax(v string) *FieldStats {
	s.Max = &v
	return s
}
539663
func (impl *Standard) Idamax(n int, x []float64, incX int) (retVal int) {
	// declared at cublasgen.h:390:17 enum CUBLAS_STATUS { ... } cublasIdamax ...
	if impl.e != nil {
		return
	}

	if n < 0 {
		panic("blas: n < 0")
	}
	if incX == 0 {
		panic("blas: zero x index increment")
	}
	if n == 0 || incX < 0 {
		return -1
	}
	if incX > 0 && (n-1)*incX >= len(x) {
		panic("blas: x index out of range")
	}
	if n == 0 {
		return
	}
	var ret C.int
	impl.e = status(C.cublasIdamax(C.cublasHandle_t(impl.h), C.int(n), (*C.double)(&x[0]), C.int(incX), &ret))
	return int(ret)
}
799595
func MinMax(inReal []float64, inTimePeriod int) ([]float64, []float64) {

	outMin := make([]float64, len(inReal))
	outMax := make([]float64, len(inReal))

	nbInitialElementNeeded := (inTimePeriod - 1)
	startIdx := nbInitialElementNeeded
	outIdx := startIdx
	today := startIdx
	trailingIdx := startIdx - nbInitialElementNeeded
	highestIdx := -1
	highest := 0.0
	lowestIdx := -1
	lowest := 0.0
	for today < len(inReal) {
		tmpLow, tmpHigh := inReal[today], inReal[today]
		if highestIdx < trailingIdx {
			highestIdx = trailingIdx
			highest = inReal[highestIdx]
			i := highestIdx
			i++
			for i <= today {
				tmpHigh = inReal[i]
				if tmpHigh > highest {
					highestIdx = i
					highest = tmpHigh
				}
				i++
			}
		} else if tmpHigh >= highest {
			highestIdx = today
			highest = tmpHigh
		}
		if lowestIdx < trailingIdx {
			lowestIdx = trailingIdx
			lowest = inReal[lowestIdx]
			i := lowestIdx
			i++
			for i <= today {
				tmpLow = inReal[i]
				if tmpLow < lowest {
					lowestIdx = i
					lowest = tmpLow
				}
				i++
			}
		} else if tmpLow <= lowest {
			lowestIdx = today
			lowest = tmpLow
		}
		outMax[outIdx] = highest
		outMin[outIdx] = lowest
		outIdx++
		trailingIdx++
		today++
	}
	return outMin, outMax
}
471982
func (s *ResourceQuota) SetMaximum(v int64) *ResourceQuota {
	s.Maximum = &v
	return s
}
1126682
func Max(values []int64) int64 {
	if len(values) == 0 {
		return 0
	}
	if isSorted(values) {
		return values[len(values)-1]
	}
	max := values[0]
	for i := 1; i < len(values); i++ {
		v := values[i]
		if max < v {
			max = v
		}
	}
	return max
}
380854
func (tb *LTable) MaxN() int {
	if tb.array == nil {
		return 0
	}
	for i := len(tb.array) - 1; i >= 0; i-- {
		if tb.array[i] != LNil {
			return i + 1
		}
	}
	return 0
}
600322
func (db *DB) RangeLimitIterator(min []byte, max []byte, rangeType uint8, offset int, count int) *RangeLimitIterator {
	return NewRangeLimitIterator(db.NewIterator(), &Range{min, max, rangeType}, &Limit{offset, count})
}
1087997
func Min(x ...*decimal.Big) *decimal.Big {
	m := x[0]
	for _, v := range x[1:] {
		if v.Cmp(m) < 0 {
			m = v
		}
	}
	return m
}