public class MathOperations extends Object
| Constructor and Description |
|---|
MathOperations() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsDoubleObjectSomeRestriction(org.semanticweb.owlapi.model.OWLClassExpression d)
Returns true if the same property is used twice in an object some
restriction, e.g.
|
static List<List<Integer>> |
getCombos(int number)
Given
number, the functions returns all
combinations of natural numbers plus the number count
(which can be thought of as the number of interconnecting
symbols between those numbers) adds up to number. |
static List<List<Integer>> |
getCombos(int length,
int maxValue)
Methods for computing combinations with the additional restriction
that
maxValue is the highest natural number, which can
occur. |
static SortedSet<org.semanticweb.owlapi.model.OWLObjectUnionOf> |
incCrossProduct(Set<org.semanticweb.owlapi.model.OWLObjectUnionOf> baseSet,
Set<org.semanticweb.owlapi.model.OWLClassExpression> newSet)
Implements a cross product in the sense that each union in the
base set is extended by each class expression in the new set.
|
public MathOperations()
public static List<List<Integer>> getCombos(int number)
number, the functions returns all
combinations of natural numbers plus the number count
(which can be thought of as the number of interconnecting
symbols between those numbers) adds up to number.
It uses an efficient algorithm to achieve this, which can
handle number=50 in less than a second and number=30 in
about 10 milliseconds on an average PC.
For illustrating the function, the return values of the first numbers
are given:
number = 1: [[1]]
number = 2: [[2]]
number = 3: [[3], [1, 1]]
number = 4: [[4], [2, 1]]
number = 5: [[5], [3, 1], [2, 2], [1, 1, 1]]
number = 6: [[6], [4, 1], [3, 2], [2, 1, 1]]
number = 7: [[7], [5, 1], [4, 2], [3, 3], [3, 1, 1], [2, 2, 1], [1, 1, 1, 1]]number - A natural number.public static List<List<Integer>> getCombos(int length, int maxValue)
maxValue is the highest natural number, which can
occur.length - Length of construct.maxValue - Maximum value which can occur in sum.getCombos(int).getCombos(int)public static SortedSet<org.semanticweb.owlapi.model.OWLObjectUnionOf> incCrossProduct(Set<org.semanticweb.owlapi.model.OWLObjectUnionOf> baseSet, Set<org.semanticweb.owlapi.model.OWLClassExpression> newSet)
baseSet - A set of union class descriptions.newSet - The descriptions to add to each union class descriptions.public static boolean containsDoubleObjectSomeRestriction(org.semanticweb.owlapi.model.OWLClassExpression d)
d - OWLClassExpression to test.
DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2019 Jens Lehmann