de.gaalop.dfg.Expression.copy()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中de.gaalop.dfg.Expression.copy()方法的一些代码示例,展示了Expression.copy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Expression.copy()方法的具体详情如下:
包路径:de.gaalop.dfg.Expression
类名称:Expression
方法名:copy

Expression.copy介绍

[英]Creates a deep copy of this expression and returns it. We do not use the clone method of the Object class here, because by definition it only creates shallow copies.
[中]创建此表达式的深层副本并返回它。这里我们不使用对象类的clone方法,因为根据定义,它只创建浅拷贝。

代码示例

代码示例来源:origin: CallForSanity/Gaalop

@Override
public ColorNode copyElements() {
  return new ColorNode(getGraph(), r.copy(), g.copy(), b.copy());
}

代码示例来源:origin: CallForSanity/Gaalop

/**
 * Creates an expression node that negates the given expression.
 * 
 * @param value The expression that should be negated. A deep copy will be created.
 * @return A Negation object that negates the given expression.
 */
public static Negation negate(Expression value) {
  return new Negation(value.copy());
}

代码示例来源:origin: CallForSanity/Gaalop

/**
 * Creates an exponentation node that squares the given expression.
 * 
 * @param base The expression that should be squared. A deep copy will be created.
 * @return An exponentation object that exponentiates the given base with a float constant of 2.0.
 */
public static Multiplication square(Expression base) {
  return new Multiplication(base, base.copy());
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public Expression copy() {
  // create a deep copy of args list
  List<Expression> newArgs = new ArrayList<Expression>();
  for (Expression e : args) {
    newArgs.add(e.copy());
  }
  return new MacroCall(name, newArgs);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public Expression copy() {
 return new Relation(getLeft().copy(), getRight().copy(), type);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public Expression copy() {
  return new Division(getLeft().copy(), getRight().copy());
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public Expression copy() {
  return new Equality(getLeft().copy(), getRight().copy());
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public Expression copy() {
  return new OuterProduct(getLeft().copy(), getRight().copy());
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public Expression copy() {
  return new LogicalAnd(getLeft().copy(), getRight().copy());
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public Expression copy() {
  return new InnerProduct(getLeft().copy(), getRight().copy());
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public Expression copy() {
  return new Subtraction(getLeft().copy(), getRight().copy());
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public Expression copy() {
  return new LogicalOr(getLeft().copy(), getRight().copy());
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public Expression copy() {
  return new Inequality(getLeft().copy(), getRight().copy());
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public void visit(Variable node) {
  if (replaceMap.containsKey(node.getName())) 
    result = replaceMap.get(node.getName()).copy();
  super.visit(node);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public Macro copyElements() {
  List<SequentialNode> bodyCopy = new ArrayList<SequentialNode>();
  for (SequentialNode node : body) {
    bodyCopy.add(node.copy());
  }
  return new Macro(getGraph(), name, bodyCopy, returnValue.copy());
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public Expression copy() {
  return new Negation(getOperand().copy());
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public Expression copy() {
    return new MathFunctionCall(getOperand().copy(), function);
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public void visit(StoreResultNode node) {
  if (replaceMap.containsKey(node.getValue().getName())) {
    Expression replacement = replaceMap.get(node.getValue().getName());
    if (replacement instanceof Variable) {
      node.setValue((Variable) replacement.copy());
    } 
  }
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public void visit(AssignmentNode node) {
  node.getValue().accept(dfgReplacer);
  if (dfgReplacer.result != null) {
    node.setValue(dfgReplacer.result);
    dfgReplacer.result = null;
  }
  if (replaceMap.containsKey(node.getVariable().getName()))
    node.setVariable((Variable) replaceMap.get(node.getVariable().getName()).copy());
}

代码示例来源:origin: CallForSanity/Gaalop

@Override
public AssignmentNode copyElements() {
  AssignmentNode result = new AssignmentNode(getGraph(), variable.copy(), value.copy());
  result.setGAPP(copyGAPP());
  return result;
}

相关文章