org.rubato.math.module.morphism
Class EmbeddingMorphism

java.lang.Object
  extended by org.rubato.math.module.morphism.ModuleMorphism
      extended by org.rubato.math.module.morphism.EmbeddingMorphism
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<ModuleMorphism>, XMLInputOutput<ModuleMorphism>

public abstract class EmbeddingMorphism
extends ModuleMorphism

Morphism that embeds one module into another. The following embeddings are covered:
- embeddings within the number hierarchy Z -> Q -> R -> C
- embeddings of number rings in polynomial rings
- embeddings between polynomial rings
- embeddings of number rings in string rings
- embeddings between string rings
- embeddings of rings in product rings
- embeddings between product rings
- embeddings between free modules if their rings embed

Author:
Gérard Milmeister
See Also:
Serialized Form

Method Summary
 int compareTo(ModuleMorphism object)
          Compares two module morphisms.
 boolean equals(java.lang.Object object)
          Returns true iff this morphism is equal to object.
 ModuleMorphism fromXML(XMLReader reader, org.w3c.dom.Element element)
          Reads XML representation from reader starting with element.
 java.lang.String getElementTypeName()
          Returns the value of the type attribute for this class.
 ModuleMorphism getRingMorphism()
          Returns the the ring morphism that transforms between the rings of the domain and codomain modules.
static XMLInputOutput<ModuleMorphism> getXMLInputOutput()
           
 boolean isModuleHomomorphism()
          Embeddings are always module homomorphisms, except for embeddings of a Z_n ring into another ring.
 boolean isRingHomomorphism()
          If true, then this is a ring homomorphism.
static ModuleMorphism make(Module domain, Module codomain)
          Creates an embedding from a module domain into a module codomain.
static EmbeddingMorphism makeProductRingEmbedding(Ring domain, ProductRing codomain, int index)
          Creates an embedding of a ring in a product ring, but only into one of the factors
 ModuleElement map(ModuleElement x)
          Maps the element x.
abstract  ModuleElement mapValue(ModuleElement element)
          The low-level map method.
 java.lang.String toString()
          Returns a string representation of this morphism.
 void toXML(XMLWriter writer)
          Outputs XML representation to writer.
 
Methods inherited from class org.rubato.math.module.morphism.ModuleMorphism
atZero, clone, composable, compose, difference, getCodomain, getConstantMorphism, getConstantMorphism, getDomain, getIdentityMorphism, inDomain, isConstant, isIdentity, isLinear, isRingMorphism, power, scaled, sum
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

make

public static ModuleMorphism make(Module domain,
                                  Module codomain)
Creates an embedding from a module domain into a module codomain.

Returns:
null if no embedding of the requested kind can be built

map

public final ModuleElement map(ModuleElement x)
                        throws MappingException
Description copied from class: ModuleMorphism
Maps the element x. This must be implemented for each specific morphism type.

Specified by:
map in class ModuleMorphism
Returns:
the result of mapping element x
Throws:
MappingException - if mapping of element fails

mapValue

public abstract ModuleElement mapValue(ModuleElement element)
The low-level map method. This must be implemented by subclasses.


isModuleHomomorphism

public boolean isModuleHomomorphism()
Embeddings are always module homomorphisms, except for embeddings of a Z_n ring into another ring.

Overrides:
isModuleHomomorphism in class ModuleMorphism

isRingHomomorphism

public boolean isRingHomomorphism()
Description copied from class: ModuleMorphism
If true, then this is a ring homomorphism.

Overrides:
isRingHomomorphism in class ModuleMorphism

getRingMorphism

public ModuleMorphism getRingMorphism()
Description copied from class: ModuleMorphism
Returns the the ring morphism that transforms between the rings of the domain and codomain modules.

Specified by:
getRingMorphism in class ModuleMorphism

compareTo

public final int compareTo(ModuleMorphism object)
Description copied from class: ModuleMorphism
Compares two module morphisms. Checks first for equality. The default comparison is on names, subclasses may implement a more meaningful comparison.

Specified by:
compareTo in interface java.lang.Comparable<ModuleMorphism>
Overrides:
compareTo in class ModuleMorphism

equals

public final boolean equals(java.lang.Object object)
Description copied from class: ModuleMorphism
Returns true iff this morphism is equal to object. In general it is not possible to determine whether to functions are the same, so this returns true iff both morphisms have the same structure.

Specified by:
equals in class ModuleMorphism

toString

public final java.lang.String toString()
Description copied from class: ModuleMorphism
Returns a string representation of this morphism. This string is used for generic comparison.

Specified by:
toString in class ModuleMorphism

toXML

public void toXML(XMLWriter writer)
Description copied from interface: XMLInputOutput
Outputs XML representation to writer.


fromXML

public ModuleMorphism fromXML(XMLReader reader,
                              org.w3c.dom.Element element)
Description copied from interface: XMLInputOutput
Reads XML representation from reader starting with element.

Returns:
an object of type T or null if parsing failed

getXMLInputOutput

public static XMLInputOutput<ModuleMorphism> getXMLInputOutput()

getElementTypeName

public java.lang.String getElementTypeName()
Description copied from interface: XMLInputOutput
Returns the value of the type attribute for this class.


makeProductRingEmbedding

public static final EmbeddingMorphism makeProductRingEmbedding(Ring domain,
                                                               ProductRing codomain,
                                                               int index)
Creates an embedding of a ring in a product ring, but only into one of the factors

Parameters:
domain - a ring
codomain - a product ring
index - the index of the codomain factor where the ring should be embedded
Returns:
an embedding or null if such an embedding cannot be constructed