Skip to content

Commit

Permalink
More bugfixes for empty occurrences
Browse files Browse the repository at this point in the history
  • Loading branch information
pbloem committed Aug 17, 2016
1 parent 143c1ce commit f76453c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/main/java/nl/peterbloem/motive/MotifModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,12 @@ public static List<D> subbedDegrees(
rest.add("multi-edges", OnlineModel.storeIntegers(additions));

// * check for any disconnected nodes and add 0s
int expSize = graph.size() - occurrences.size() * (occurrences.get(0).size() - 1);
while(degrees.size() < expSize)
degrees.add(new D(0, 0));
if(! occurrences.isEmpty())
{
int expSize = graph.size() - occurrences.size() * (occurrences.get(0).size() - 1);
while(degrees.size() < expSize)
degrees.add(new D(0, 0));
}

return degrees;
}
Expand Down Expand Up @@ -432,9 +435,12 @@ public static List<Integer> subbedDegrees(
rest.add("multi-edges", OnlineModel.storeIntegers(additions));

// * check for any disconnected nodes and add 0s
int expSize = graph.size() - occurrences.size() * (occurrences.get(0).size() - 1);
while(result.size() < expSize)
result.add(0);
if(! occurrences.isEmpty())
{
int expSize = graph.size() - occurrences.size() * (occurrences.get(0).size() - 1);
while(result.size() < expSize)
result.add(0);
}

return result;
}
Expand Down

0 comments on commit f76453c

Please sign in to comment.