
jscl.math.operator.matrix.Trace Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jscl Show documentation
Show all versions of jscl Show documentation
java symbolic computing library and mathematical editor
package jscl.math.operator.matrix;
import jscl.math.Generic;
import jscl.math.Matrix;
import jscl.math.Variable;
import jscl.math.operator.Operator;
public class Trace extends Operator {
public Trace(Generic matrix) {
super("trace",new Generic[] {matrix});
}
public Generic compute() {
if(parameter[0] instanceof Matrix) {
Matrix matrix=(Matrix)parameter[0];
return matrix.trace();
}
return expressionValue();
}
protected Variable newinstance() {
return new Trace(null);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy