All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.tensorics.core.util.MoreMultisets Maven / Gradle / Ivy

Go to download

Tensorics is a java framework which uses a tensor as a central object. A tensor represents a set of values placed in an N-dimensional space. Wherever you are tempted to use maps of maps, a tensor might be a good choice ;-) Tensorics provides methods to create, transform and performing calculations with those tensors.

There is a newer version: 0.0.81
Show newest version
package org.tensorics.core.util;

import static com.google.common.collect.Multisets.difference;

import com.google.common.collect.ImmutableMultiset;
import com.google.common.collect.Multiset;

public class MoreMultisets {

	private MoreMultisets() {
		/* only static methods */
	}

	public static boolean containsNonUniqueElements(Multiset dimensions) {
		return dimensions.size() > dimensions.elementSet().size();
	}

	public static  Multiset nonUniqueElementsOf(Multiset dimensions) {
		return difference(dimensions, ImmutableMultiset.copyOf(dimensions.elementSet()));
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy