use of edu.cmu.tetrad.calculator.expression.VariableExpression in project tetrad by cmu-phil.
the class GraphWrapper method findParameter.
// ==========================PRIVATE METaHODS===========================//
private static String findParameter(Expression expression, String name) {
List<Expression> expressions = expression.getExpressions();
if (expression.getToken().equals("*")) {
Expression expression1 = expressions.get(1);
VariableExpression varExpr = (VariableExpression) expression1;
if (varExpr.getVariable().equals(name)) {
Expression expression2 = expressions.get(0);
VariableExpression constExpr = (VariableExpression) expression2;
return constExpr.getVariable();
}
}
for (Expression _expression : expressions) {
String param = findParameter(_expression, name);
if (param != null) {
return param;
}
}
return null;
}
Aggregations