// SubVectors returns a new vector as subtraction of two vectors.
437922
func SubVectors(a, b *Vector) *Vector {
	return NewVector(a.x-b.x, a.y-b.y)
}
128233
func (v PreciseVector) Mul(f *big.Float) PreciseVector {
	return PreciseVector{
		X: precMul(v.X, f),
		Y: precMul(v.Y, f),
		Z: precMul(v.Z, f),
	}
}
607537
func (vm *Engine) subScript() []parsedOpcode {
	return vm.scripts[vm.scriptIdx][vm.lastCodeSep:]
}
812374
func NewFeatureVector(featureVector *RawFeatureVector,
	featureNames map[FeatureBit]string) *FeatureVector {

	if featureVector == nil {
		featureVector = NewRawFeatureVector()
	}
	return &FeatureVector{
		RawFeatureVector: featureVector,
		featureNames:     featureNames,
	}
}
955378
func (m *Matrix) SubMatrix(i, j, rows, cols int) *Matrix {
	return &Matrix{
		elements: m.elements[i*m.stride+j : i*m.stride+j+(rows-1)*m.stride+cols],
		stride:   m.stride,
		epsilon:  m.epsilon,
	}
}
724132
func Sub(a, b []float32) {
	b = b[:len(a)]
	for i, v := range a {
		a[i] = v - b[i]
	}
}
273729
func (p *Point) Subtract(p2 Point) *Point {
	p.X -= p2.X
	p.Y -= p2.Y
	return p
}
897584
func (e *Euclidean) Distance(vectorX *mat.Dense, vectorY *mat.Dense) float64 {
	subVector := mat.NewDense(1, 1, nil)
	subVector.Reset()
	subVector.Sub(vectorX, vectorY)
	result := e.InnerProduct(subVector, subVector)

	return math.Sqrt(result)
}
378413
func Sub(a, b *T) T {
	if a[3] == b[3] {
		return T{a[0] - b[0], a[1] - b[1], a[2] - b[2], 1}
	} else {
		a3 := a.Vec3DividedByW()
		b3 := b.Vec3DividedByW()
		return T{a3[0] - b3[0], a3[1] - b3[1], a3[2] - b3[2], 1}
	}
}
1052581
func (c RGBA) Sub(d RGBA) RGBA {
	return RGBA{
		R: c.R - d.R,
		G: c.G - d.G,
		B: c.B - d.B,
		A: c.A - d.A,
	}
}
141347
func (m1 Mat2x4) Sub(m2 Mat2x4) Mat2x4 {
	return Mat2x4{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5], m1[6] - m2[6], m1[7] - m2[7]}
}
888195
func (m1 Mat4x3) Sub(m2 Mat4x3) Mat4x3 {
	return Mat4x3{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5], m1[6] - m2[6], m1[7] - m2[7], m1[8] - m2[8], m1[9] - m2[9], m1[10] - m2[10], m1[11] - m2[11]}
}
440932
func (it *Not) SubIterators() []graph.Iterator {
	return []graph.Iterator{it.primaryIt, it.allIt}
}
1101061
func subIndex(n int, docStarts []int) int {
	// searcher/reader for doc n:
	size := len(docStarts)
	lo := 0        // search starts array
	hi := size - 1 // for first element less than n, return its index
	for hi >= lo {
		mid := int(uint(lo+hi) >> 1)
		midValue := docStarts[mid]
		if n < midValue {
			hi = mid - 1
		} else if n > midValue {
			lo = mid + 1
		} else { // found a match
			for mid+1 < size && docStarts[mid+1] == midValue {
				mid++ // scan to last match
			}
			return mid
		}
	}
	return hi
}
1248558
func AsVector(any interface{}) (Vector, error) {
	switch x := any.(type) {
	case []uint8:
		return uint8ToVector(x), nil
	case []uint16:
		return uint16ToVector(x), nil
	case []uint32:
		return uint32ToVector(x), nil
	case []uint64:
		return uint64ToVector(x), nil
	case []int:
		return intToVector(x), nil
	case []int8:
		return int8ToVector(x), nil
	case []int16:
		return int16ToVector(x), nil
	case []int32:
		return int32ToVector(x), nil
	case []int64:
		return int64ToVector(x), nil
	case []float32:
		return float32ToVector(x), nil
	case []float64:
		return float64ToVector(x), nil
	default:
		return nil, fmt.Errorf("Unable to coerce input of type %T into vector", any)
	}
}
437844
func (m1 Mat3x4) Sub(m2 Mat3x4) Mat3x4 {
	return Mat3x4{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5], m1[6] - m2[6], m1[7] - m2[7], m1[8] - m2[8], m1[9] - m2[9], m1[10] - m2[10], m1[11] - m2[11]}
}
700345
func Mat3x2FromRows(row0, row1, row2 Vec2) Mat3x2 {
	return Mat3x2{row0[0], row1[0], row2[0], row0[1], row1[1], row2[1]}
}