Skip to content

Commit

Permalink
New kit/nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
pbloem committed Sep 25, 2016
1 parent 9f87661 commit ea77142
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
20 changes: 16 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>

Expand Down Expand Up @@ -61,7 +61,19 @@
</execution>
</executions>
</plugin>
</plugins>
<plugin> <!-- Create sources.jar -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
Expand All @@ -80,7 +92,7 @@
<dependency>
<groupId>com.github.Data2Semantics</groupId>
<artifactId>nodes</artifactId>
<version>v0.1.16</version>
<version>v0.1.17</version>
</dependency>
<!-- <dependency> -->
<!-- <groupId>data2semantics</groupId> -->
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/nl/peterbloem/motive/MotifModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static <L> double size(Graph<L> graph, Graph<L> sub,
additions.add((int)removals.frequency(pair));
}

bits.add("multiple-edges", Functions.prefix(additions.isEmpty() ? 0 : Functions.max(additions)));
bits.add("multiple-edges", Functions.prefix(additions.isEmpty() ? 0 : (long)Functions.max(additions)));
bits.add("multiple-edges", OnlineModel.storeIntegers(additions));
}

Expand Down Expand Up @@ -287,7 +287,7 @@ public static List<D> subbedDegrees(
for(Pair<Integer, Integer> token : instanceToInstance.tokens())
additions.add((int)instanceToInstance.frequency(token) - 1);

rest.add("multi-edges", Functions.prefix(additions.isEmpty() ? 0 : Functions.max(additions)));
rest.add("multi-edges", Functions.prefix(additions.isEmpty() ? 0 : (long)Functions.max(additions)));
rest.add("multi-edges", OnlineModel.storeIntegers(additions));

// * check for any disconnected nodes and add 0s
Expand Down Expand Up @@ -431,7 +431,7 @@ public static List<Integer> subbedDegrees(

rest.add("multi-edges", Functions.prefix(
additions.isEmpty() ?
0 : Functions.max(additions)));
0 : (long)Functions.max(additions)));
rest.add("multi-edges", OnlineModel.storeIntegers(additions));

// * check for any disconnected nodes and add 0s
Expand Down Expand Up @@ -682,7 +682,7 @@ private static void sizeSubbedER(DGraph<?> graph, DGraph<?> sub,
for(Pair<Integer, Integer> token : instanceToInstance.tokens())
additions.add((int)instanceToInstance.frequency(token) - 1);

bits.add("multiple-edges", Functions.prefix(additions.isEmpty() ? 0 : max(additions)));
bits.add("multiple-edges", Functions.prefix(additions.isEmpty() ? 0 : (long)max(additions)));
bits.add("multiple-edges", OnlineModel.storeIntegers(additions));
}

Expand Down Expand Up @@ -751,7 +751,7 @@ private static void sizeSubbedER(UGraph<?> graph, UGraph<?> sub,
for(Pair<Integer, Integer> token : instanceToInstance.tokens())
additions.add((int)instanceToInstance.frequency(token) - 1);

bits.add("multiple-edges", Functions.prefix(additions.isEmpty() ? 0 : max(additions)));
bits.add("multiple-edges", Functions.prefix(additions.isEmpty() ? 0 : (long)max(additions)));
bits.add("multiple-edges", OnlineModel.storeIntegers(additions));
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/nl/peterbloem/motive/MotifModelTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public static <L> double sizeBetaCopying(DGraph<L> graph, DGraph<L> sub,
additions.add((int)removals.frequency(pair));
}

rest.add("multi-edges", Functions.prefix(additions.isEmpty() ? 0 : Functions.max(additions)));
rest.add("multi-edges", Functions.prefix(additions.isEmpty() ? 0 : (long) Functions.max(additions)));
rest.add("multi-edges", OnlineModel.storeIntegers(additions));

// * Store the rewiring information
Expand Down Expand Up @@ -327,7 +327,7 @@ public static <L> double sizeBetaCopying(UGraph<L> graph, UGraph<L> sub,
additions.add((int)removals.frequency(pair));
}

rest.add("multi-edges", Functions.prefix(additions.isEmpty() ? 0 : Functions.max(additions)));
rest.add("multi-edges", Functions.prefix(additions.isEmpty() ? 0 : (long) Functions.max(additions)));
rest.add("multi-edges", OnlineModel.storeIntegers(additions));

// * Store the rewiring information
Expand Down

0 comments on commit ea77142

Please sign in to comment.