it.unimi.dsi.fastutil.ints.IntIterable Java Examples

The following examples show how to use it.unimi.dsi.fastutil.ints.IntIterable. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractRhsValidationTask.java    From metanome-algorithms with Apache License 2.0 5 votes vote down vote up
@Override
public void validate(Iterable<int[]> leftMatches, IntIterable right) {
	Int2ObjectMultimap<int[]> grouped = groupByValue(leftMatches);
	Iterator<Entry<Collection<int[]>>> it = grouped.iterator();
	while (it.hasNext() && shouldUpdate()) {
		Entry<Collection<int[]>> entry = it.next();
		int value = entry.getIntKey();
		Collection<int[]> records = entry.getValue();
		threshold = updateThreshold(value, records, right);
	}
}
 
Example #2
Source File: AbstractRhsValidationTask.java    From metanome-algorithms with Apache License 2.0 5 votes vote down vote up
@Override
public void validate(int[] record, IntIterable right) {
	if (shouldUpdate()) {
		int leftValue = getLeftValue(record);
		Collection<int[]> records = Collections.singletonList(record);
		threshold = updateThreshold(leftValue, records, right);
	}
}
 
Example #3
Source File: GroupingRhsValidationTask.java    From metanome-algorithms with Apache License 2.0 5 votes vote down vote up
private Int2ObjectMultimap<int[]> groupByValue(IntIterable matching) {
	Int2ObjectMultimap<int[]> map = new Int2ObjectHashMultimap<>();
	OfInt it = matching.iterator();
	while (it.hasNext()) {
		int id = it.nextInt();
		int[] right = getRightRecord(id);
		int rightValue = getRightValue(right);
		map.put(rightValue, right);
	}
	return map;
}
 
Example #4
Source File: RhsValidationTaskImpl.java    From metanome-algorithms with Apache License 2.0 5 votes vote down vote up
@Override
public double calculateMinSimilarity(IntIterable matching) {
	OfInt it = matching.iterator();
	//does order have an impact on runtime?
	while (it.hasNext() && shouldUpdate(minSimilarity)) {
		int id = it.nextInt();
		updateMinSimilarity(id);
	}
	return minSimilarity;
}
 
Example #5
Source File: TrivialRhsValidationTask.java    From metanome-algorithms with Apache License 2.0 4 votes vote down vote up
@Override
public void validate(Iterable<int[]> leftMatches, IntIterable right) {
	// do nothing because we already know the result
}
 
Example #6
Source File: TrivialRhsValidationTask.java    From metanome-algorithms with Apache License 2.0 4 votes vote down vote up
@Override
public void validate(int[] record, IntIterable right) {
	// do nothing because we already know the result
}
 
Example #7
Source File: AbstractRhsValidationTask.java    From metanome-algorithms with Apache License 2.0 4 votes vote down vote up
private double calculateMinSimilarity(int value, Collection<int[]> records,
	IntIterable matching) {
	return with(value, records).calculateMinSimilarity(matching);
}
 
Example #8
Source File: AbstractRhsValidationTask.java    From metanome-algorithms with Apache License 2.0 4 votes vote down vote up
private double updateThreshold(int value, Collection<int[]> records, IntIterable matching) {
	double minSimilarity = calculateMinSimilarity(value, records, matching);
	return Math.min(threshold, minSimilarity);
}
 
Example #9
Source File: GroupingRhsValidationTask.java    From metanome-algorithms with Apache License 2.0 4 votes vote down vote up
@Override
public double calculateMinSimilarity(IntIterable matching) {
	Int2ObjectMultimap<int[]> map = groupByValue(matching);
	return calculateMinSimilarity(map);
}
 
Example #10
Source File: RecordGrouperImpl.java    From metanome-algorithms with Apache License 2.0 4 votes vote down vote up
private Stream<Tuple2<Selector, Collection<int[]>>> process(IntIterable records) {
	records.forEach((IntConsumer) this::process);
	return getGroups();
}
 
Example #11
Source File: AbstractRhsValidationTask.java    From metanome-algorithms with Apache License 2.0 votes vote down vote up
abstract double calculateMinSimilarity(IntIterable matching); 
Example #12
Source File: RhsValidationTask.java    From metanome-algorithms with Apache License 2.0 votes vote down vote up
void validate(Iterable<int[]> left, IntIterable right); 
Example #13
Source File: RhsValidationTask.java    From metanome-algorithms with Apache License 2.0 votes vote down vote up
void validate(int[] record, IntIterable right);