mikera.vectorz.ops
Class Sqrt
- java.lang.Object
-
- mikera.vectorz.Op
-
- mikera.vectorz.ops.AFunctionOp
-
- mikera.vectorz.ops.Sqrt
-
- All Implemented Interfaces:
- IOperator
public class Sqrt extends AFunctionOp
-
-
Constructor Summary
Constructors Constructor and Description Sqrt()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubleapply(double x)Applies this operator to a single value, returning the resultdoubleapplyInverse(double y)Applies the inverse of this Op.voidapplyTo(AVector a)Applies this operator to a mutable vector.voidapplyTo(double[] data, int offset, int length)Applies this operator to the specified range within a double[] array.voidapplyTo(INDArray a)Applies this operator to every element of a target array.doubleaverageValue()doublederivative(double x)Returns the derivative of this Op for a given input value x i.e.doublederivativeForOutput(double y)Returns the derivative of this Op for a given output value y i.e.OpgetDerivativeOp()Gets an operator which represents the derivative of this operator.OpgetInverse()Gets the inverse of this operator.booleanhasDerivative()Returns true if this operator supports computing the derivative for a given inputbooleanhasInverse()Returns true if this operator supports computing the inverse for a given outputdoubleminDomain()doubleminValue()-
Methods inherited from class mikera.vectorz.Op
applyTo, applyTo, applyTo, applyTo, applyTo, applyTo, compose, compose, constrainValues, divide, getTransform, hasDerivativeForOutput, isBounded, isDomainBounded, isStochastic, maxDomain, maxValue, product, sum, toString, validateOutput
-
-
-
-
Field Detail
-
INSTANCE
public static final Sqrt INSTANCE
-
-
Method Detail
-
apply
public double apply(double x)
Description copied from interface:IOperatorApplies this operator to a single value, returning the result
-
applyTo
public void applyTo(INDArray a)
Description copied from class:OpApplies this operator to every element of a target array. Mutates the array in place.
-
applyTo
public void applyTo(AVector a)
Description copied from interface:IOperatorApplies this operator to a mutable vector.
-
applyTo
public void applyTo(double[] data, int offset, int length)Description copied from interface:IOperatorApplies this operator to the specified range within a double[] array.
-
averageValue
public double averageValue()
- Overrides:
averageValuein classAFunctionOp
-
derivative
public double derivative(double x)
Description copied from class:OpReturns the derivative of this Op for a given input value x i.e. f'(x) where f is the operator- Overrides:
derivativein classOp- Returns:
-
derivativeForOutput
public double derivativeForOutput(double y)
Description copied from class:OpReturns the derivative of this Op for a given output value y i.e. f'(g(y)) where f is the operator, g is the inverse of f- Overrides:
derivativeForOutputin classOp- Returns:
-
hasDerivative
public boolean hasDerivative()
Description copied from class:OpReturns true if this operator supports computing the derivative for a given input- Overrides:
hasDerivativein classOp- Returns:
-
getDerivativeOp
public Op getDerivativeOp()
Description copied from class:OpGets an operator which represents the derivative of this operator. Returns nil if this cannot be computed or does not exist.- Overrides:
getDerivativeOpin classOp- Returns:
-
hasInverse
public boolean hasInverse()
Description copied from class:OpReturns true if this operator supports computing the inverse for a given output- Overrides:
hasInversein classOp- Returns:
-
getInverse
public Op getInverse()
Description copied from interface:IOperatorGets the inverse of this operator. Returns null if no inverse exists.- Specified by:
getInversein interfaceIOperator- Overrides:
getInversein classOp- Returns:
-
applyInverse
public double applyInverse(double y)
Description copied from class:OpApplies the inverse of this Op. Throws an error if the inverse function does not exist. Returns Double.NaN if no inverse exists for the specific value of y.- Overrides:
applyInversein classOp- Returns:
-
-
DMelt 3.0 © DataMelt by jWork.ORG