src/main/java/chlx/hashing/minhash/MinHashSimplified.java
private void init(final int size, final Random r) {
		if (size <= 0) {
			throw new InvalidParameterException(
					"Signature size should be positive");
		}

		this.signatureSize = size;

		// h = (a * x) + b
		// a and b should be randomly generated
		hash_coefs = new int[signatureSize][2];
		for (int i = 0; i < signatureSize; i++) {
			hash_coefs[i][0] = Math.abs(r.nextInt()); // a
			hash_coefs[i][1] = Math.abs(r.nextInt()); // b
		}
	}
/**
	 * Compute hash function coefficients using provided Random.
	 *
	 * @param size
	 * @param r
	 */
Compute hash function coefficients using provided Random.
@param size
@param r
Compute hash function coefficients using provided Random . @param size @param r
private void init(final int size, final Random r) {
		if (size <= 0) {
			throw new InvalidParameterException(
					"Signature size should be positive");
		}
		this.signatureSize = size;
		hash_coefs = new int[signatureSize][2];
		for (int i = 0; i < signatureSize; i++) {
			hash_coefs[i][0] = Math.abs(r.nextInt()); 
			hash_coefs[i][1] = Math.abs(r.nextInt()); 
		}
	}
private void init ( final int size , final Random r ) { if ( size <= 0 ) { throw new InvalidParameterException ( "Signature size should be positive" ) ; } this . signatureSize = size ; hash_coefs = new int [ signatureSize ] [ 2 ] ; for ( int i = 0 ; i < signatureSize ; i ++ ) { hash_coefs [ i ] [ 0 ] = Math . abs ( r . nextInt ( ) ) ; hash_coefs [ i ] [ 1 ] = Math . abs ( r . nextInt ( ) ) ; } }
Compute hash function coefficients using provided Random.
Compute hash function coefficients using provided Random .
// h = (a * x) + b // a and b should be randomly generated // a // b