

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
RingType
 Type of Ring that this class can operate upon, usually itself@CodeReviews(reviews={@CodeReview(reviewer="Kevin R. Dixon",date="20080226",changesNeeded=false,comments="Looks good."),@CodeReview(reviewer="Justin Basilico",date="20060425",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>>
Defines something similar to a mathematical ring. Specifies: equality, elementwise multiplication, addition, subtraction, scaling, negation, deep copy, as well as inline versions of each of these.
Method Summary  

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)
Elementwise multiplication of this and other 
void 
dotTimesEquals(RingType other)
Inline elementwise multiplication of this and
other 
boolean 
equals(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 elementwise 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 elementwise negation of this , such that
this.plus( this.negative() ) has only zero elements. 
void 
negativeEquals()
Inline elementwise 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)
Elementwise scaling of this by scaleFactor 
RingType 
scaledMinus(double scaleFactor,
RingType other)
Arithmetic subtraction other after elementwise scaling of
other by scaleFactor from this . 
void 
scaledMinusEquals(double scaleFactor,
RingType other)
Inline arithmetic subtraction of other after elementwise
scaling of other by scaleFactor from this . 
RingType 
scaledPlus(double scaleFactor,
RingType other)
Arithmetic addition of this and other after
elementwise scaling of other by scaleFactor . 
void 
scaledPlusEquals(double scaleFactor,
RingType other)
Inline arithmetic addition of this and other after
elementwise scaling of other by scaleFactor . 
void 
scaleEquals(double scaleFactor)
Inline elementwise 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 ); 
Method Detail 

boolean equals(Object other)
equals
in class Object
other
 RingType to compare against this
boolean equals(RingType other, double effectiveZero)
other
 RingType to compare against this
effectiveZero
 tolerance threshold for elementwise equality
RingType 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
elementwise 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
elementwise 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 elementwise 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 elementwise
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 elementwise equality


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 