Compares two vectors and determines if they are numeric equals,
independent of its type.

@param vector1
the first vector
@param vector2
the second vector
@return true if the vectors are numeric equals
435874
protected static boolean numericEquals(Field vector1, Field vector2) {
		if (vector1.size() != vector2.size())
			return false;
		if (vector1.isEmpty())
			return true;

		Iterator<Object> it1 = vector1.iterator();
		Iterator<Object> it2 = vector2.iterator();

		while (it1.hasNext()) {
			Object obj1 = it1.next();
			Object obj2 = it2.next();

			if (!(obj1 instanceof Number && obj2 instanceof Number))
				return false;

			if (((Number) obj1).doubleValue() != ((Number) obj2).doubleValue())
				return false;
		}

		return true;
	}
377824
private boolean isEqual(Object fld1, Object fld2)
    {
        if (fld1 == null || fld2 == null)
        {
            return (fld1 == fld2);
        }
        else if ((fld1 instanceof BigDecimal) && (fld2 instanceof BigDecimal))
        {
            return (((BigDecimal) fld1).compareTo((BigDecimal) fld2) == 0);
        }
        else if ((fld1 instanceof Date) && (fld2 instanceof Date))
        {
            return (((Date) fld1).getTime() == ((Date) fld2).getTime());
        }
        else
        {
            return fld1.equals(fld2);
        }
    }
467486
def vector_check(vector):
    
    for i in vector:
        if isinstance(i, int) is False:
            return False
        if i < 0:
            return False
    return True
1207320
public static double dotDense(NumberVector v1, NumberVector v2) {
    final int dim1 = v1.getDimensionality(), dim2 = v2.getDimensionality();
    final int mindim = (dim1 <= dim2) ? dim1 : dim2;
    double dot = 0;
    for(int k = 0; k < mindim; k++) {
      dot += v1.doubleValue(k) * v2.doubleValue(k);
    }
    return dot;
  }
1024240
public boolean areEquals(String str1, String str2) {

		return (str1 == null && str2 == null || str1 != null && str2 != null && str1.equals(str2));
	}
744535
public static boolean varInsnEqual(VarInsnNode insn1, VarInsnNode insn2)
	{
		if (insn1.var == -1 || insn2.var == -1)
			return true;

		return insn1.var == insn2.var;
	}
631108
public static <T> boolean compareInstance(T t1, T t2) {
        if (t1 == t2) {
            return true;
        }
        if (t1 != null && t2 != null && t1.equals(t2)) {
            return true;
        }

        return false;
    }
1021061
public static boolean areEqual(byte[] array1, byte[] array2) {
		if (array1.length != array2.length) return false;

		for (int i=0; i<array1.length; ++i)
			if (array1[i] != array2[i]) return false;

		return true;
	}
965865
public static boolean isGreater(BigDecimal bigNum1, BigDecimal bigNum2) {
		Assert.notNull(bigNum1);
		Assert.notNull(bigNum2);
		return bigNum1.compareTo(bigNum2) > 0;
	}
367043
public static boolean isEqualOrNull( Map s1,
                                         Map s2 ) {
        if ( s1 == null
                && s2 == null ) {
            return true;
        } else if ( s1 != null
                && s2 != null
                && s1.size() == s2.size() ) {
            return true;
        }
        return false;
    }
667441
public static boolean compareQNames(QName qn1, QName qn2) {
        if (qn1 == qn2)
            return true;
        if (qn1 == null || qn2 == null)
            return false;
        return qn1.equals(qn2);
    }
902374
public static boolean equalsOrBothNull(final Object object1, final Object object2) {
        return object1 == null && object2 == null || object1 != null && object1.equals(object2);
    }
65107
public static function distance2(Vector $vector1, Vector $vector2) : float {
        $value = 0;
        $count = count($vector1);
        for ($i = 0;$i<$count;$i++) {
            $value += ($vector1[$i] - $vector2[$i]) * ($vector1[$i] - $vector2[$i]);
        }
        return $value;
    }
1131586
public static boolean isLessOrEqual(BigDecimal bigNum1, BigDecimal bigNum2) {
		Assert.notNull(bigNum1);
		Assert.notNull(bigNum2);
		return bigNum1.compareTo(bigNum2) <= 0;
	}
680894
def dot(vec1, vec2):
        """"""
        if isinstance(vec1, Vector2) \
                and isinstance(vec2, Vector2):
            return ((vec1.X * vec2.X) + (vec1.Y * vec2.Y))
        else:
            raise TypeError("vec1 and vec2 must be Vector2's")
137966
public int compare(NUMERICTYPE value1, NUMERICTYPE value2) {
        if (this.performCalculationsAsDoublePrimitive) {
            double v1 = value1.doubleValue();
            double v2 = value2.doubleValue();
            return Double.compare(v1, v2);
        } else {
            // evaluate as long
            long v1 = value1.longValue();
            long v2 = value2.longValue();
            return Long.compare(v1, v2);
        }

    }
489790
public static boolean isNotEqual(String s1, String s2, int modifier) {
        return !isEqual(s1, s2, modifier);
    }