Class Variable
java.lang.Object
org.wpilib.math.autodiff.Variable
- All Implemented Interfaces:
AutoCloseable
An autodiff variable pointing to an expression node.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVariable()Constructs a linear Variable with a value of zero.Variable(double value) Constructs a Variable from a floating point type.Variable(int value) Constructs a Variable from an integral type.Variable(Variable.Handle handleTypeTag, long handle) Constructs a Variable from the given handle. -
Method Summary
Modifier and TypeMethodDescriptionstatic VariableMath.abs() for Variables.static VariableMath.acos() for Variables.static VariableMath.asin() for Variables.static VariableMath.atan() for Variables.static VariableMath.atan2() for Variables.static VariableMath.atan2() for Variables.static VariableMath.atan2() for Variables.static VariableMath.cbrt() for Variables.voidclose()static VariableMath.cos() for Variables.static VariableMath.cosh() for Variables.div(double rhs) Variable-Variable division operator.Variable-Variable division operator.static VariableMath.exp() for Variables.longReturns internal handle.static VariableMath.hypot() for Variables.static VariableMath.hypot() for Variables.static VariableMath.hypot() for Variables.static VariableMath.hypot() for Variables.static VariableMath.hypot() for Variables.static VariableMath.hypot() for Variables.static VariableMath.hypot() for Variables.static VariableMath.hypot() for Variables.static VariableMath.hypot() for Variables.static VariableMath.hypot() for Variables.static VariableMath.log() for Variables.static VariableMath.log10() for Variables.static VariableMath.max() for Variables.static VariableMath.max() for Variables.static VariableMath.max() for Variables.static Variablemin() for Variables.static Variablemin() for Variables.static Variablemin() for Variables.minus(double rhs) Variable-Variable subtraction operator.Variable-Variable subtraction operator.plus(double rhs) Variable-Variable addition operator.Variable-Variable addition operator.static VariableMath.pow() for Variables.static VariableMath.pow() for Variables.static VariableMath.pow() for Variables.voidsetValue(double value) Sets Variable's internal value.static VariableMath.signum() for Variables.static VariableMath.sin() for Variables.static VariableMath.sinh() for Variables.static VariableMath.sqrt() for Variables.static VariableMath.tan() for Variables.static VariableMath.tanh() for Variables.times(double rhs) Variable-Variable multiplication operator.Variable-Variable multiplication operator.static longReturns the total native memory usage of all Variables in bytes.type()Returns the type of this expression (constant, linear, quadratic, or nonlinear).Unary minus operator.Unary plus operator.doublevalue()Returns the value of this variable.
-
Field Details
-
HANDLE
Instance of handle type tag.
-
-
Constructor Details
-
Variable
public Variable()Constructs a linear Variable with a value of zero. -
Variable
Constructs a Variable from a floating point type.- Parameters:
value- The value of the Variable.
-
Variable
Constructs a Variable from an integral type.- Parameters:
value- The value of the Variable.
-
Variable
Constructs a Variable from the given handle.This constructor is for internal use only.
- Parameters:
handleTypeTag- Handle type tag.handle- Variable handle.
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable
-
setValue
Sets Variable's internal value.- Parameters:
value- The value of the Variable.
-
value
-
type
Returns the type of this expression (constant, linear, quadratic, or nonlinear).- Returns:
- The type of this expression.
-
getHandle
-
times
-
times
-
div
-
div
-
plus
-
plus
-
minus
-
minus
-
unaryMinus
-
unaryPlus
-
abs
-
acos
-
asin
-
atan
-
atan2
-
atan2
-
atan2
-
cbrt
-
cos
-
cosh
-
exp
-
hypot
-
hypot
-
hypot
-
hypot
-
hypot
-
hypot
-
hypot
-
hypot
-
hypot
-
hypot
-
log
-
log10
-
max
-
max
-
max
-
min
-
min
-
min
-
pow
-
pow
-
pow
-
signum
-
sin
-
sinh
-
sqrt
-
tan
-
tanh
-
totalNativeMemoryUsage
Returns the total native memory usage of all Variables in bytes.- Returns:
- The total native memory usage of all Variables in bytes.
-