Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* This file is part of "TweetyProject", a collection of Java libraries for
* logical aspects of artificial intelligence and knowledge representation.
*
* TweetyProject is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*
* Copyright 2016 The TweetyProject Team
*/
package org.tweetyproject.commons.util;
import java.util.*;
/**
* This class provides some utility functions for maps.
* @author Matthias Thimm
*
* @param Domain class of the maps
* @param Range class of the maps
*/
public class MapTools {
/** Constructor*/
public MapTools(){
}
/**
* Computes the complete set of maps from E to F such that the following
* condition holds. For every map "m" in the result the set m.keySet()
* is equal to the union of all sets S with S in relations.keySet() and each
* element "e" in m.keySet() is mapped to an element "f" such that "f" in
* relations.get(S) with "e" in S. For example the map:
* {a,b} => {1,2}
* {c,d} => {3}
* {f} => {4,5}
* yields the set of maps:
* a=>1, b=>1, c=>3, d=>3, f=>4
* a=>1, b=>1, c=>3, d=>3, f=>5
* a=>1, b=>2, c=>3, d=>3, f=>4
* a=>1, b=>2, c=>3, d=>3, f=>5
* a=>2, b=>1, c=>3, d=>3, f=>4
* a=>2, b=>1, c=>3, d=>3, f=>5
* a=>2, b=>2, c=>3, d=>3, f=>4
* a=>2, b=>2, c=>3, d=>3, f=>5
* @param relations a map from sets of E to sets of F.
* @return a set of maps from E to F.
*/
public Set