All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.accelad.math.nilgiri.autodiff.Negative Maven / Gradle / Ivy

There is a newer version: 1.16
Show 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