Sum the components of two vectors, the input is not modified.

@param a first vector
@param b second vector
@return scaled vector
347105
static Vector2d sum(final Tuple2d a, final Tuple2d b) {
        return new Vector2d(a.x + b.x, a.y + b.y);
    }
1173830
public static double tanimotoCoefficient(double[] a, double[] b) {
        return tanimotoCoefficient(Vectors.asVector(a), Vectors.asVector(b));
    }
829917
public T elementMult( T b )
    {
        convertType.specify(this,b);
        T A = convertType.convert(this);
        b = convertType.convert(b);

        T c = A.createLike();
        A.ops.elementMult(A.mat,b.mat,c.mat);
        return c;
    }
276066
public static int addExact(int a, int b) {
        long result = (long) a + b;
        checkNoOverflow(result == (int) result);
        return (int) result;
    }
126521
public Vector2d fma(Vector2dc a, Vector2dc b) {
        return fma(a, b, thisOrNew());
    }
332802
public Matrix plusEquals(Matrix B)
    {
        checkMatrixDimensions(B);
        for (int i = 0; i < m; i++)
        {
            for (int j = 0; j < n; j++)
            {
                A[i][j] = A[i][j] + B.A[i][j];
            }
        }
        return this;
    }
265945
public static float max(final float a, final float b, final float c) {
        return Math.max(Math.max(a, b), c);
    }
416918
public static <T1 extends Comparable<T1>, T2 extends Comparable<T2>> int compare(T1 a1, T1 b1, T2 a2, T2 b2) {
        int res = N.compare(a1, b1);

        return res == 0 ? N.compare(a2, b2) : res;
    }
577882
@Inline(value="$1.add($2)")
	@Pure
	public static BigInteger operator_plus(BigInteger a, BigInteger b) {
		return a.add(b);
	}
315244
public static void scale(double scalar, DMatrixSparseCSC A, DMatrixSparseCSC B) {
        if( A != B ) {
            B.copyStructure(A);

            for(int i = 0; i < A.nz_length; i++ ) {
                B.nz_values[i] = A.nz_values[i]*scalar;
            }
        } else {
            for(int i = 0; i < A.nz_length; i++ ) {
                B.nz_values[i] *= scalar;
            }
        }
    }
375159
public SparseVector plus(SparseVector b) {
		SparseVector a = this;
		if (a.N != b.N) throw new IllegalArgumentException("Vector lengths disagree : " + a.N + " != " + b.N);
		SparseVector c = new SparseVector(N);
		for (int i : a.symbolTable) c.put(i, a.get(i));                // c = a
		for (int i : b.symbolTable) c.put(i, b.get(i) + c.get(i));     // c = c + b
		return c;
	}
956647
@Override
    public Matrix applyCommon(Matrix a, Matrix b) {
        int n = a.rows() * b.rows();
        int m = a.columns() * b.columns();
        int p = b.rows();
        int q = b.columns();

        Matrix result = a.blankOfShape(n, m);

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                result.set(i, j, a.get(i / p, j / q) * b.get(i % p, j % q));
            }
        }

        return result;
    }
1336789
public static Vector add(Vector vector1, Vector vector2) {
        if (vector2.length() != vector1.length())
            throw new IllegalArgumentException(
                    "Vectors of different sizes cannot be added");
        if (vector2 instanceof IntegerVector &&
            vector1 instanceof DoubleVector)
            return add(vector1, Vectors.asDouble(vector2));
        if (vector2 instanceof SparseVector)
            addSparseValues(vector1, vector2);
        else {
            int length = vector2.length();
            for (int i = 0; i < length; ++i) {
                double value = vector2.getValue(i).doubleValue() +
                               vector1.getValue(i).doubleValue();
                vector1.set(i, value);
            }
        }

        return vector1;
    }
24325
static public Angle sum(Angle angle1, Angle angle2) {
        return new Angle(angle1.value + angle2.value);
    }
1292340
public static void scale( double alpha , DMatrix2x2 a ) {
        a.a11 *= alpha; a.a12 *= alpha;
        a.a21 *= alpha; a.a22 *= alpha;
    }
409635
public Vec multiply(Vec b)
    {
        DenseVector result = new  DenseVector(rows());
        multiply(b, 1.0, result);
        return result;
    }
528426
public LongIntSortedVector getSum(LongIntVector other) {
        LongIntSortedVector sum = new LongIntSortedVector(this);
        sum.add(other);
        return sum;
    }