src/main/java/chlx/hashing/similarity/JaccardIndex.java
public static double indexMinHashWithMinSimThreshold(double minSimThreshold,
			@NotNull int[] minhash1, @NotNull int[] minhash2) {
		if (minhash1.length != minhash2.length) {
			throw new IllegalArgumentException("Min hash lengths must be the same");
		}
		int diffCount = 0;
		int diffMaxThreshold = (int) (minSimThreshold * minhash1.length);
		for (int i = 0, j = 0; i < minhash1.length && j < minhash2.length; ) {
			if (minhash1[i] == minhash2[j]) {
				++i;
				++j;
			} else {
				++diffCount;
				if (minhash1[i] > minhash2[j]) {
					++j;
				} else {
					++i;
				}
			}
			if (diffCount > diffMaxThreshold) {
				return 0;
			}
		}

		return (double) (minhash1.length - diffCount) / minhash1.length;
	}
/**
	 * Calculate similarity between 2 min-hashes (faster than normal index)
	 *
	 * @implSpec if similarity < minSimThreshold then return 0;
	 */
Calculate similarity between 2 min-hashes (faster than normal index)
@implSpec if similarity < minSimThreshold then return 0.
Calculate similarity between 2 min - hashes ( faster than normal index ) @implSpec if similarity < minSimThreshold then return 0 .
public static double indexMinHashWithMinSimThreshold(double minSimThreshold,
			@NotNull int[] minhash1, @NotNull int[] minhash2) {
		if (minhash1.length != minhash2.length) {
			throw new IllegalArgumentException("Min hash lengths must be the same");
		}
		int diffCount = 0;
		int diffMaxThreshold = (int) (minSimThreshold * minhash1.length);
		for (int i = 0, j = 0; i < minhash1.length && j < minhash2.length; ) {
			if (minhash1[i] == minhash2[j]) {
				++i;
				++j;
			} else {
				++diffCount;
				if (minhash1[i] > minhash2[j]) {
					++j;
				} else {
					++i;
				}
			}
			if (diffCount > diffMaxThreshold) {
				return 0;
			}
		}
		return (double) (minhash1.length - diffCount) / minhash1.length;
	}
public static double indexMinHashWithMinSimThreshold ( double minSimThreshold , @ NotNull int [ ] minhash1 , @ NotNull int [ ] minhash2 ) { if ( minhash1 . length != minhash2 . length ) { throw new IllegalArgumentException ( "Min hash lengths must be the same" ) ; } int diffCount = 0 ; int diffMaxThreshold = ( int ) ( minSimThreshold * minhash1 . length ) ; for ( int i = 0 , j = 0 ; i < minhash1 . length && j < minhash2 . length ; ) { if ( minhash1 [ i ] == minhash2 [ j ] ) { ++ i ; ++ j ; } else { ++ diffCount ; if ( minhash1 [ i ] > minhash2 [ j ] ) { ++ j ; } else { ++ i ; } } if ( diffCount > diffMaxThreshold ) { return 0 ; } } return ( double ) ( minhash1 . length - diffCount ) / minhash1 . length ; }
Calculate similarity between 2 min-hashes (faster than normal index)
 @implSpec if similarity < minSimThreshold then return 0;
Calculate similarity between 2 min - hashes ( faster than normal index ) @implSpec if similarity < minSimThreshold then return 0 ;