Subtracts two vectors.
348359
def sub(v1, v2):
    '''
    '''
    return tuple(a - b for a, b in zip(v1, v2))
240648
def subtract_vectors(a, b, periodic):
    '''

    '''
    r = a - b
    delta = np.abs(r)
    sign = np.sign(r)
    return np.where(delta > 0.5 * periodic, sign * (periodic - delta), r)
956005
def subtract(dict_a, dict_b, strict=False):
    """"""
    if not strict:
        return subtract_by_key(dict_a, dict_b)

    difference_dict = {}
    for key in dict_a:
        if key not in dict_b or dict_b[key] != dict_a[key]:
            difference_dict[key] = dict_a[key]

    return difference_dict
1295727
def Subtract(self, other):
        """"""
        for val, freq in other.Items():
            self.Incr(val, -freq)
470949
public static double subtract(double minuend, double reduction) {
        BigDecimal minuendBd = new BigDecimal(Double.toString(minuend));
        BigDecimal reductionBd = new BigDecimal(Double.toString(reduction));
        return minuendBd.subtract(reductionBd).doubleValue();
    }
124733
public Complex subtract(Complex c)
    {
        Complex ret = new Complex(real, imag);
        ret.mutableSubtract(c);
        return ret;
    }
111235
public void elemSubtract(VTensor other) {
        checkEqualSize(this, other);
        for (int c = 0; c < this.size(); c++) {
            subtractValue(c, other.getValue(c));
        }
    }
111068
public Vector3f sub(Vector3fc v, Vector3f dest) {
        dest.x = x - v.x();
        dest.y = y - v.y();
        dest.z = z - v.z();
        return dest;
    }
1300803
public static IntPoint Subtract(IntPoint point1, IntPoint point2) {
        IntPoint result = new IntPoint(point1);
        result.Subtract(point2);
        return result;
    }
1179665
public static void subtractEquals( DMatrix4 a , DMatrix4 b ) {
        a.a1 -= b.a1;
        a.a2 -= b.a2;
        a.a3 -= b.a3;
        a.a4 -= b.a4;
    }
1015821
public IntFloatSortedVector getDiff(IntFloatVector other) {
        IntFloatSortedVector diff = new IntFloatSortedVector(this);
        diff.subtract(other);
        return diff;
    }
679998
public function subtract($b)
    {
        switch (true) {
            case $b instanceof Matrix:
                $c = $this->subtractMatrix($b);
                break;

            case $b instanceof ColumnVector:
                $c = $this->subtractColumnVector($b);
                break;
                
            case $b instanceof Vector:
                $c = $this->subtractVector($b);
                break;

            case is_int($b) or is_float($b):
                $c = $this->subtractScalar($b);
                break;

            default:
                throw new InvalidArgumentException('Cannot subtract a '
                    . gettype($b) . ' from a matrix.');
        }

        return $c;
    }
1045922
public void apply(Vector x, int i1, int i2) {
        double temp = c * x.get(i1) + s * x.get(i2);
        x.set(i2, -s * x.get(i1) + c * x.get(i2));
        x.set(i1, temp);
    }
684376
private static void subtractSparseValues(Vector destination,
                                        Vector source) {
        int[] otherIndices = ((SparseVector) source).getNonZeroIndices();
        for (int index : otherIndices) {
            double value = destination.getValue(index).doubleValue() -
                           source.getValue(index).doubleValue();
            destination.set(index, value);
        }
    }
1208296
public void subtractValue(int idx, double val) {
        values[idx] = s.minus(values[idx], val); 
    }
661990
private static BigDecimal doSubtract(final BigDecimal v1, final BigDecimal v2) {
        BigDecimal diff = v1;
        if (v1 != null && v2 != null) {
            diff = v1.subtract(v2);
        } else if (v2 != null) {
            diff = v2.negate();
        }
        return diff;
    }
235005
private static void subtractTernaryValues(Vector destination,
                                              TernaryVector source) {
        for (int p : source.positiveDimensions())
            destination.set(p, destination.getValue(p).doubleValue() - 1);
        for (int n : source.negativeDimensions())
            destination.set(n, destination.getValue(n).doubleValue() + 1);
    }