RingType
- Type of Ring that this class can operate upon, usually itself@CodeReview(reviewer="Kevin R. Dixon",date="2008-02-26",changesNeeded=false,comments="Looks good.") @CodeReview(reviewer="Justin Basilico",date="2006-04-25",changesNeeded=false,comments="Interface definition looks good. Edited the spacing of some of the elements.") @PublicationReference(author="Wikipedia", title="Ring (mathematics)", type=WebPage, year=2008, url="http://en.wikipedia.org/wiki/Ring_(mathematics)") public interface Ring<RingType extends Ring<RingType>> extends CloneableSerializable
Modifier and Type | Method and Description |
---|---|
RingType |
clone()
Returns a smart copy of
this , such that changing the values
of the return class will not effect this |
RingType |
dotTimes(RingType other)
Element-wise multiplication of
this and other |
void |
dotTimesEquals(RingType other)
Inline element-wise multiplication of
this and
other |
boolean |
equals(java.lang.Object other)
Determines if two RingType objects are equal
|
boolean |
equals(RingType other,
double effectiveZero)
Determines if two RingType objects are effectively equal
|
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.
|
RingType |
minus(RingType other)
Arithmetic subtraction of
other from this |
void |
minusEquals(RingType other)
Inline arithmetic subtraction of
other from
this |
RingType |
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 |
RingType |
plus(RingType other)
Arithmetic addition of
this and other |
void |
plusEquals(RingType other)
Inline arithmetic addition of
this and other |
RingType |
scale(double scaleFactor)
Element-wise scaling of
this by scaleFactor |
RingType |
scaledMinus(double scaleFactor,
RingType other)
Arithmetic subtraction
other after element-wise scaling of
other by scaleFactor from this . |
void |
scaledMinusEquals(double scaleFactor,
RingType other)
Inline arithmetic subtraction of
other after element-wise
scaling of other by scaleFactor from this . |
RingType |
scaledPlus(double scaleFactor,
RingType other)
Arithmetic addition of
this and other after
element-wise scaling of other by scaleFactor . |
void |
scaledPlusEquals(double scaleFactor,
RingType 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 |
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 ); |
boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- RingType to compare against this
boolean equals(RingType other, double effectiveZero)
other
- RingType to compare against this
effectiveZero
- tolerance threshold for element-wise equalityRingType clone()
this
, such that changing the values
of the return class will not effect this
clone
in interface CloneableSerializable
this
RingType plus(RingType other)
this
and other
other
- object to add to this
this
and other
void plusEquals(RingType other)
this
and other
other
- object to add to this
RingType minus(RingType other)
other
from this
other
- object to subtract from this
this
and other
void minusEquals(RingType other)
other
from
this
other
- object to subtract from this
RingType dotTimes(RingType other)
this
and other
other
- elements of other will be multiplied to the corresponding
elements of this
this
and
other
void dotTimesEquals(RingType other)
this
and
other
other
- elements of other will be multiplied to the corresponding
elements of this
RingType scale(double scaleFactor)
this
by scaleFactor
scaleFactor
- amount to scale the elements of this
this
void scaleEquals(double scaleFactor)
this
by
scaleFactor
scaleFactor
- amount to scale the elements of this
RingType scaledPlus(double scaleFactor, RingType other)
this
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.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.void scaledPlusEquals(double scaleFactor, RingType other)
this
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.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.RingType scaledMinus(double scaleFactor, RingType other)
other
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.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.void scaledMinusEquals(double scaleFactor, RingType other)
other
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.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.RingType negative()
this
, such that
this.plus( this.negative() )
has only zero elements.this
void negativeEquals()
this
void zero()
this
, so that the following are
equivalent
r1.scaleEquals( 0.0 );
and
r1.zero();
Furthermore,
r1.zero(); anything.dotTimes( r1 ).equals( r1 );boolean isZero()
boolean isZero(double effectiveZero)
effectiveZero
- Tolerance threshold for element-wise equality