Skip to content

Commit

Permalink
bug at removeNorm constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
rcabanasdepaz committed Sep 24, 2021
1 parent ae6f12c commit af13114
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public SeparateHalfspaceDefaultFactor removeNormConstraints() {
final TIntObjectMap<List<LinearConstraint>> constraints = getDataStructure();

for (int i : data.keys()) {
constraints.get(i).addAll(i, ConstraintsUtil.removeNormalization(getLinearProblemAt(i).getConstraints()));
constraints.get(i).addAll(ConstraintsUtil.removeNormalization(getLinearProblemAt(i).getConstraints()));
}
return new SeparateHalfspaceDefaultFactor(getDataDomain(), getSeparatingDomain(), constraints);
}
Expand All @@ -195,7 +195,7 @@ public SeparateHalfspaceDefaultFactor removeNonNegativeConstraints() {
final TIntObjectMap<List<LinearConstraint>> constraints = getDataStructure();

for (int i : data.keys()) {
constraints.get(i).addAll(i, ConstraintsUtil.removeNonNegative(getLinearProblemAt(i).getConstraints()));
constraints.get(i).addAll(ConstraintsUtil.removeNonNegative(getLinearProblemAt(i).getConstraints()));
}
return new SeparateHalfspaceDefaultFactor(getDataDomain(), getSeparatingDomain(), constraints);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import ch.idsia.crema.utility.ArraysUtil;
import com.google.common.primitives.Ints;
import gnu.trove.map.TIntIntMap;
import gnu.trove.map.hash.TIntIntHashMap;

/**
* Author: Claudio "Dna" Bonesana
Expand Down Expand Up @@ -63,4 +64,8 @@ public BayesianFactor query(GraphicalModel<BayesianFactor> model, TIntIntMap obs
return cond;
}

public BayesianFactor query(GraphicalModel<BayesianFactor> model, int... target) {
return this.query(model, new TIntIntHashMap(), target);
}

}

0 comments on commit af13114

Please sign in to comment.