org.tensorics.core.functional.expressions.FunctionalExpression Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tensorics-core Show documentation
Show all versions of tensorics-core Show documentation
Tensorics is a java framework which uses a tensor as a central object. A tensor represents a set of values placed in an N-dimensional space. Wherever you are tempted to use maps of maps, a tensor might be a good choice ;-) Tensorics provides methods to create, transform and performing calculations with those tensors.
/**
* Copyright (c) 2016 European Organisation for Nuclear Research (CERN), All Rights Reserved.
*/
package org.tensorics.core.functional.expressions;
import java.util.List;
import org.tensorics.core.functional.FiniteArgumentFunction;
import org.tensorics.core.functional.FuncN;
import org.tensorics.core.tree.domain.AbstractDeferredExpression;
import org.tensorics.core.tree.domain.Expression;
import com.google.common.collect.ImmutableList;
/**
* Expression that evaluates using a {@link FuncN} function. This is a lambda-like expression.
*
* @see FiniteArgumentFunction
* @param the type of the result of the expression
*/
public class FunctionalExpression extends AbstractDeferredExpression {
private final List> children;
private final FuncN func;
public FunctionalExpression(List> children, FuncN func) {
this.children = ImmutableList.copyOf(children);
this.func = func;
}
@Override
public List> getChildren() {
return this.children;
}
public FuncN function() {
return func;
}
}