Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
pbloem committed Oct 25, 2016
1 parent 9d6f348 commit 028611b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/main/java/nl/peterbloem/motive/MotifModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -1334,14 +1334,21 @@ public static List<D> subbedDegrees(

// * convert the rewritten links to new indices, and build a
// frequencymodel
int size = 0;
for(Pair<Integer, Integer> link : rewLinks)
{
int f = link.first(), s = link.second();
int a = map.containsKey(f) ? map.get(f) : f;
int b = map.containsKey(s) ? map.get(s) : s;

multiEdges.add(Pair.p(a, b));

size ++;
if(size % 10000 == 0)
System.out.println(size + " rewritten links processed");
}

System.out.println(".");

// * Add each rewritten link _once_
for(Pair<Integer, Integer> link : multiEdges.tokens())
Expand Down Expand Up @@ -1476,7 +1483,8 @@ public static Pair<Long, Long> subbedERInstances(
new LinkedHashSet<Pair<Integer, Integer>>();

for(List<Integer> occurrence : occurrences)
{
{

List<Integer> rw = new LinkedList<Integer>();
for(int index : occurrence)
map.put(index, occurrence.get(0));
Expand All @@ -1503,6 +1511,7 @@ public static Pair<Long, Long> subbedERInstances(
}

rewiring.add(rw);

}

subbedNumLinks -= rewLinks.size();
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/nl/peterbloem/motive/exec/Run.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,16 @@ public static void main(String[] args)
try {
if("edgelist".equals(filetype.toLowerCase().trim()))
{
data = useDisk ? DiskDGraph.fromFile(file, new File("./tmp/")) : Data.edgeListDirectedUnlabeledSimple(file);
if(useDisk)
{
File dir = new File("./tmp/");
dir.mkdirs();
data = DiskDGraph.fromFile(file, dir);
} else
{
data = Data.edgeListDirectedUnlabeledSimple(file);
}

} else if ("gml".equals(filetype.toLowerCase().trim()))
{
if(!useDisk)
Expand Down

0 comments on commit 028611b

Please sign in to comment.