public class MutableDouble extends java.lang.Number implements CloneableSerializable, java.lang.Comparable<MutableDouble>, Field<MutableDouble>, Vectorizable
| Modifier and Type | Field and Description |
|---|---|
double |
value
The value.
|
| Constructor and Description |
|---|
MutableDouble()
Creates an
MutableDouble with an initial value of zero. |
MutableDouble(double value)
Creates an
MutableDouble with the given value. |
MutableDouble(MutableDouble other)
Creates a copy of a
MutableDouble. |
| Modifier and Type | Method and Description |
|---|---|
MutableDouble |
clone()
Creates a new clone (shallow copy) of this object.
|
int |
compareTo(MutableDouble other) |
void |
convertFromVector(Vector parameters)
Converts the object from a Vector of parameters.
|
Vector1 |
convertToVector()
Converts the object to a vector.
|
MutableDouble |
divide(MutableDouble other)
Divides
this value by the other value, returning the
result of the division as a new value. |
void |
divideEquals(MutableDouble other)
Inline divises
this value by the other value, storing
the result inside this. |
MutableDouble |
dotTimes(MutableDouble other)
Element-wise multiplication of
this and other |
void |
dotTimesEquals(MutableDouble other)
Inline element-wise multiplication of
this and
other |
double |
doubleValue() |
boolean |
equals(double other)
Determines if this MutableDouble's value is equal to a given double.
|
boolean |
equals(MutableDouble other)
Determines if this MutableDouble is equal to another MutableDouble.
|
boolean |
equals(MutableDouble other,
double effectiveZero)
Determines if two RingType objects are effectively equal
|
boolean |
equals(java.lang.Object other)
Determines if two RingType objects are equal
|
float |
floatValue() |
double |
getValue()
Gets the value stored in the object.
|
int |
hashCode() |
int |
intValue() |
MutableDouble |
inverse()
Returns the inverse of
this. |
void |
inverseEquals()
Changes this value to be its inverse.
|
boolean |
isZero()
Determines if this ring is equal to zero.
|
boolean |
isZero(double effectiveZero)
Determines if this ring is equal to zero using the element-wise effective
zero value.
|
long |
longValue() |
MutableDouble |
minus(MutableDouble other)
Arithmetic subtraction of
other from this |
void |
minusEquals(MutableDouble other)
Inline arithmetic subtraction of
other from
this |
MutableDouble |
negative()
Returns the element-wise negation of
this, such that
this.plus( this.negative() ) has only zero elements. |
void |
negativeEquals()
Inline element-wise negation of
this |
MutableDouble |
plus(MutableDouble other)
Arithmetic addition of
this and other |
void |
plusEquals(MutableDouble other)
Inline arithmetic addition of
this and other |
MutableDouble |
scale(double scaleFactor)
Element-wise scaling of
this by scaleFactor |
MutableDouble |
scaledMinus(double scaleFactor,
MutableDouble other)
Arithmetic subtraction
other after element-wise scaling of
other by scaleFactor from this. |
void |
scaledMinusEquals(double scaleFactor,
MutableDouble other)
Inline arithmetic subtraction of
other after element-wise
scaling of other by scaleFactor from this. |
MutableDouble |
scaledPlus(double scaleFactor,
MutableDouble other)
Arithmetic addition of
this and other after
element-wise scaling of other by scaleFactor. |
void |
scaledPlusEquals(double scaleFactor,
MutableDouble other)
Inline arithmetic addition of
this and other after
element-wise scaling of other by scaleFactor. |
void |
scaleEquals(double scaleFactor)
Inline element-wise scaling of
this by
scaleFactor |
void |
setValue(double value)
Sets the value stored in the object.
|
MutableDouble |
times(MutableDouble other)
Multiplies
this value by the other value, returning the
result of the multiplication as a new value. |
void |
timesEquals(MutableDouble other)
Inline multiplies
this value by the other value,
storing the result inside this. |
java.lang.String |
toString() |
void |
zero()
Zeros out all elements of
this, so that the following are
equivalent
r1.scaleEquals( 0.0 );
and
r1.zero();
Furthermore,
r1.zero(); anything.dotTimes( r1 ).equals( r1 ); |
public double value
public MutableDouble()
MutableDouble with an initial value of zero.public MutableDouble(double value)
MutableDouble with the given value.value - The value to store in the object.public MutableDouble(MutableDouble other)
MutableDouble.other - The other value.public MutableDouble clone()
CloneableSerializableclone in interface Vectorizableclone in interface Ring<MutableDouble>clone in interface CloneableSerializableclone in class java.lang.Objectpublic boolean equals(java.lang.Object other)
Ringequals in interface Ring<MutableDouble>equals in class java.lang.Objectother - RingType to compare against thispublic boolean equals(MutableDouble other)
other - The other value.public boolean equals(double other)
other - A double.public int compareTo(MutableDouble other)
compareTo in interface java.lang.Comparable<MutableDouble>public int hashCode()
hashCode in class java.lang.Objectpublic int intValue()
intValue in class java.lang.Numberpublic long longValue()
longValue in class java.lang.Numberpublic float floatValue()
floatValue in class java.lang.Numberpublic double doubleValue()
doubleValue in class java.lang.Numberpublic double getValue()
public void setValue(double value)
value - The value.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(MutableDouble other, double effectiveZero)
Ringequals in interface Ring<MutableDouble>other - RingType to compare against thiseffectiveZero - tolerance threshold for element-wise equalitypublic MutableDouble plus(MutableDouble other)
Ringthis and otherplus in interface Ring<MutableDouble>other - object to add to thisthis and otherpublic void plusEquals(MutableDouble other)
Ringthis and otherplusEquals in interface Ring<MutableDouble>other - object to add to thispublic MutableDouble minus(MutableDouble other)
Ringother from thisminus in interface Ring<MutableDouble>other - object to subtract from thisthis and otherpublic void minusEquals(MutableDouble other)
Ringother from
thisminusEquals in interface Ring<MutableDouble>other - object to subtract from thispublic MutableDouble times(MutableDouble other)
EuclideanRingthis value by the other value, returning the
result of the multiplication as a new value.times in interface EuclideanRing<MutableDouble>other - The other value.public void timesEquals(MutableDouble other)
EuclideanRingthis value by the other value,
storing the result inside this.timesEquals in interface EuclideanRing<MutableDouble>other - The other value.public MutableDouble divide(MutableDouble other)
EuclideanRingthis value by the other value, returning the
result of the division as a new value.divide in interface EuclideanRing<MutableDouble>other - The other value.public void divideEquals(MutableDouble other)
EuclideanRingthis value by the other value, storing
the result inside this.divideEquals in interface EuclideanRing<MutableDouble>other - The other value.public MutableDouble dotTimes(MutableDouble other)
Ringthis and otherdotTimes in interface Ring<MutableDouble>other - elements of other will be multiplied to the corresponding
elements of thisthis and
otherpublic void dotTimesEquals(MutableDouble other)
Ringthis and
otherdotTimesEquals in interface Ring<MutableDouble>other - elements of other will be multiplied to the corresponding
elements of thispublic MutableDouble scale(double scaleFactor)
Ringthis by scaleFactorscale in interface Ring<MutableDouble>scaleFactor - amount to scale the elements of thisthispublic void scaleEquals(double scaleFactor)
Ringthis by
scaleFactorscaleEquals in interface Ring<MutableDouble>scaleFactor - amount to scale the elements of thispublic MutableDouble scaledPlus(double scaleFactor, MutableDouble other)
Ringthis and other after
element-wise scaling of other by scaleFactor.
If this is x, other is y, and scaleFactor is a, then this method is
equivalent to x + a * y. It is typically a more efficient way of doing
this.plus(other.scale(scaleFactor)) since it can avoid
intermediate object creation.scaledPlus in interface Ring<MutableDouble>scaleFactor - The scale factor to multiply by the elements of other before
adding to the elements of this.other - Object to scale and then add to this.public void scaledPlusEquals(double scaleFactor,
MutableDouble other)
Ringthis and other after
element-wise scaling of other by scaleFactor.
If this is x, other is y, and scaleFactor is a, then this method is
equivalent to x += a * y. It is typically a more efficient way of doing
this.plusEquals(other.scale(scaleFactor)) since it can avoid
intermediate object creation.scaledPlusEquals in interface Ring<MutableDouble>scaleFactor - The scale factor to multiply by the elements of other before
adding to the elements of this.other - Object to scale and then add to this.public MutableDouble scaledMinus(double scaleFactor, MutableDouble other)
Ringother after element-wise scaling of
other by scaleFactor from this.
If this is x, other is y, and scaleFactor is a, then this method is
equivalent to x - a * y. It is typically a more efficient way of doing
this.minus(other.scale(scaleFactor)) since it can avoid
intermediate object creation.scaledMinus in interface Ring<MutableDouble>scaleFactor - The scale factor to multiply by the elements of other before
subtracting from the elements of this.other - Object to scale and then subtract from this.public void scaledMinusEquals(double scaleFactor,
MutableDouble other)
Ringother after element-wise
scaling of other by scaleFactor from this.
If this is x, other is y, and scaleFactor is a, then this method is
equivalent to x -= a * y. It is typically a more efficient way of doing
this.minusEquals(other.scale(scaleFactor)) since it can avoid
intermediate object creation.scaledMinusEquals in interface Ring<MutableDouble>scaleFactor - The scale factor to multiply by the elements of other before
adding to the elements of this.other - Object to scale and then add to this.public MutableDouble negative()
Ringthis, such that
this.plus( this.negative() ) has only zero elements.negative in interface Ring<MutableDouble>thispublic void negativeEquals()
RingthisnegativeEquals in interface Ring<MutableDouble>public MutableDouble inverse()
Fieldthis.inverse in interface Field<MutableDouble>public void inverseEquals()
FieldinverseEquals in interface Field<MutableDouble>public void zero()
Ringthis, so that the following are
equivalent
r1.scaleEquals( 0.0 );
and
r1.zero();
Furthermore,
r1.zero(); anything.dotTimes( r1 ).equals( r1 );zero in interface Ring<MutableDouble>public boolean isZero()
RingisZero in interface Ring<MutableDouble>public boolean isZero(double effectiveZero)
RingisZero in interface Ring<MutableDouble>effectiveZero - Tolerance threshold for element-wise equalitypublic Vector1 convertToVector()
VectorizableconvertToVector in interface Vectorizablepublic void convertFromVector(Vector parameters)
VectorizableconvertFromVector in interface Vectorizableparameters - The parameters to incorporate.