#include <hom.h>
An instance of Hom is a homomorphism from a ring of type Source to a ring (usually field) of type Target. The intended use is that it will be a natural mapping. For instance:
Hom<Unparametric<Integers>, Modular<integer> >(Z, Zp) nat; // is the mod p mapping.
Hom<<NTL_ZZp, Modular<integer> >(Zp, Mp) nat;
// is an isomorphism, provided the Zp and Mp have same characteristic. Hom<Unparametric<NTL_ZZp, Unparameteric<NTL_ZZpEx> >(Z3, Z27) nat; // is the embedding of the prime field in the extension.
Public Member Functions | |
Hom (const Source &S, const Target &T) | |
Elt & | image (Elt &t, const SrcElt &s) |
SrcElt & | preimage (SrcElt &s, const Elt &t) |
|
Construct a homomorphism from a specific source ring S and target field T with Hom(S, T). Specializations define all actual homomorphisms. |
|
image(t, s) implements the homomorphism, assigning the t the value of the image of s under the mapping. The default behaviour goes through integers. |
|
If possible, preimage(s,t) assigns a value to s such that the image of s is t. Otherwise behaviour is unspecified. An error may be thrown, a conventional value may be set, or an arb value set. The default behaviour goes through integers. |