com.accelad.math.nilgiri.autodiff.Negative Maven / Gradle / Ivy
The newest version!
package com.accelad.math.nilgiri.autodiff;
import java.util.List;
import com.accelad.math.nilgiri.Field;
public class Negative> extends AbstractUnaryFunction {
public Negative(DifferentialFunction i_v) {
super(i_v);
}
@Override
public X getValue() {
return arg().getValue().negate();
}
@Override
public double getReal() {
return -arg().getReal();
}
@Override
public DifferentialFunction diff(Variable i_v) {
return (arg().diff(i_v)).negate();
}
@Override
public String toString() {
return "-" + arg().toString();
}
@Override
public String getFormula(List> variables) {
return "-" + arg().getFormula(variables);
}
@Override
public DifferentialFunction negate() {
return arg();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy