Skip to content

Commit

Permalink
Hotfix for #1246.
Browse files Browse the repository at this point in the history
jdramsey committed Feb 4, 2020
1 parent 4c72779 commit c1cd20f
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tetrad-lib/src/main/java/edu/cmu/tetrad/search/Fas.java
Original file line number Diff line number Diff line change
@@ -158,7 +158,7 @@ public Graph search() {
this.logger.log("info", "Starting Fast Adjacency Search.");

sepset = new SepsetMap();
sepset.setReturnEmptyIfNotSet(sepsetsReturnEmptyIfNotFixed);
// sepset.setReturnEmptyIfNotSet(sepsetsReturnEmptyIfNotFixed);

int _depth = depth;

8 changes: 5 additions & 3 deletions tetrad-lib/src/main/java/edu/cmu/tetrad/search/SepsetMap.java
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ public final class SepsetMap implements TetradSerializable {

private Map<Node, HashSet<Node>> parents = new HashMap<>();
private Set<Set<Node>> correlations;
private boolean returnEmptyIfNotSet = false;
private boolean returnEmptyIfNotSet = true;

//=============================CONSTRUCTORS===========================//

@@ -107,11 +107,13 @@ public List<Node> get(Node a, Node b) {
return Collections.emptyList();
}

if (returnEmptyIfNotSet && sepsets.get(pair) == null) {
List<Node> nodes = sepsets.get(pair);

if (returnEmptyIfNotSet && nodes == null) {
return Collections.emptyList();
}

return sepsets.get(pair);
return nodes;
}

public double getPValue(Node x, Node y) {
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@

import edu.cmu.tetrad.graph.Node;

import java.util.Collections;
import java.util.List;

/**
@@ -48,8 +49,7 @@ public List<Node> getSepset(Node a, Node b) {
@Override
public boolean isCollider(Node i, Node j, Node k) {
List<Node> sepset = sepsets.get(i, k);
isIndependent(i, k, sepsets.get(i, k));
return sepset != null && !sepset.contains(j);
return !sepset.contains(j);
}

@Override

0 comments on commit c1cd20f

Please sign in to comment.