org.rubato.math.module
Interface ZnFreeElement

All Superinterfaces:
java.lang.Cloneable, java.lang.Comparable<ModuleElement>, FreeElement, java.lang.Iterable<RingElement>, ModuleElement, java.io.Serializable, XMLInputOutput<ModuleElement>
All Known Implementing Classes:
ZnElement, ZnProperFreeElement

public interface ZnFreeElement
extends FreeElement

The interface for elements in a free module of integers mod n.

Author:
Gérard Milmeister
See Also:
ZnFreeModule

Method Summary
 ZnFreeElement clone()
          Returns a deep copy of this module element.
 ZnFreeElement difference(ModuleElement element)
          Returns the difference of this module element and element.
 ZnElement getComponent(int i)
          Returns the i-th component of this free element.
 ZnElement getRingElement(int i)
          Returns the i-th ring component of this free element.
 ZnFreeElement negated()
          Returns the negative of this module element.
 ZnFreeElement resize(int n)
          Returns this free element resized to length n.
 ZnFreeElement scaled(RingElement element)
          Returns the product of this element with element.
 ZnFreeElement sum(ModuleElement element)
          Returns the sum of this module element and element.
 
Methods inherited from interface org.rubato.math.module.FreeElement
getLength, iterator, multiplyCW, productCW
 
Methods inherited from interface org.rubato.math.module.ModuleElement
add, cast, compareTo, equals, fold, getModule, hashCode, isZero, negate, scale, stringRep, subtract, toString
 
Methods inherited from interface org.rubato.xml.XMLInputOutput
fromXML, getElementTypeName, toXML
 

Method Detail

sum

ZnFreeElement sum(ModuleElement element)
                  throws DomainException
Description copied from interface: ModuleElement
Returns the sum of this module element and element.

Specified by:
sum in interface ModuleElement
Throws:
DomainException - if element is not in domain

difference

ZnFreeElement difference(ModuleElement element)
                         throws DomainException
Description copied from interface: ModuleElement
Returns the difference of this module element and element.

Specified by:
difference in interface ModuleElement
Throws:
DomainException - if element is not in domain

negated

ZnFreeElement negated()
Description copied from interface: ModuleElement
Returns the negative of this module element.

Specified by:
negated in interface ModuleElement

scaled

ZnFreeElement scaled(RingElement element)
                     throws DomainException
Description copied from interface: ModuleElement
Returns the product of this element with element.

Specified by:
scaled in interface ModuleElement
Throws:
DomainException - if element is not in domain

resize

ZnFreeElement resize(int n)
Description copied from interface: FreeElement
Returns this free element resized to length n. If the new length n is greater than the old length, the new values are filled with the zero of the underlying ring. If the new length n is less than the old length, the vector of values is simply truncated.

Specified by:
resize in interface FreeElement

getComponent

ZnElement getComponent(int i)
Description copied from interface: FreeElement
Returns the i-th component of this free element.

Specified by:
getComponent in interface FreeElement
Specified by:
getComponent in interface ModuleElement

getRingElement

ZnElement getRingElement(int i)
Description copied from interface: FreeElement
Returns the i-th ring component of this free element.

Specified by:
getRingElement in interface FreeElement

clone

ZnFreeElement clone()
Description copied from interface: ModuleElement
Returns a deep copy of this module element.

Specified by:
clone in interface ModuleElement