本文整理汇总了C++中PolyRing::myHomCtor方法的典型用法代码示例。如果您正苦于以下问题:C++ PolyRing::myHomCtor方法的具体用法?C++ PolyRing::myHomCtor怎么用?C++ PolyRing::myHomCtor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolyRing
的用法示例。
在下文中一共展示了PolyRing::myHomCtor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EvalHom
RingHom EvalHom(const PolyRing& Rx, const BigRat& q) // Maps f in R[x] into f(q) in R
{
if (NumIndets(Rx) != 1) CoCoA_ERROR(ERR::BadArg, "EvalHom(Rx,N)");
const ring& R = CoeffRing(Rx);
const vector<RingElem> IndetImage(1, RingElem(R,q));
return Rx->myHomCtor(R, IdentityHom(R), IndetImage);
}
示例2: PolyRingHom
// Rx is the domain, S is the codomain
RingHom PolyRingHom(const PolyRing& Rx, const ring& S, RingHom CoeffHom, const std::vector<RingElem>& IndetImages)
{
const char* const FnName = "PolyRingHom(Rx,S,CoeffHom,IndetImages)";
if (domain(CoeffHom) != CoeffRing(Rx))
CoCoA_ERROR(ERR::MixedCoeffRings, FnName);
if (IsPolyRing(S) && codomain(CoeffHom) == CoeffRing(S))
CoeffHom = CoeffEmbeddingHom(S)(CoeffHom);
if (codomain(CoeffHom) != S)
CoCoA_ERROR(ERR::BadCodomain, FnName);
if (NumIndets(Rx) != len(IndetImages))
CoCoA_ERROR(ERR::BadPolyRingHomImages, FnName);
for (long i=0; i < NumIndets(Rx); ++i)
if (owner(IndetImages[i]) != S)
CoCoA_ERROR(ERR::BadPolyRingHomImages, FnName);
return Rx->myHomCtor(S, CoeffHom, IndetImages);
}
示例3: PolyAlgebraHom
RingHom PolyAlgebraHom(const PolyRing& Rx, const ring& Ry, const std::vector<RingElem>& IndetImages)
{
const char* const FnName = "PolyAlgebraHom(Rx,Ry,IndetImages)";
// Check that IndetImages are sensible...
if (NumIndets(Rx) != len(IndetImages))
CoCoA_ERROR(ERR::BadPolyRingHomImages, FnName);
for (long i=0; i < NumIndets(Rx); ++i)
if (owner(IndetImages[i]) != Ry)
CoCoA_ERROR(ERR::BadPolyRingHomImages, FnName);
// // Special case: codomain is coeff ring.
// if (Ry == CoeffRing(Rx))
// return Rx->myHomCtor(Ry, IdentityHom(Ry), IndetImages);
// // General case: codomain must be a poly ring with same coeffs
// if (!IsPolyRing(Ry))
// CoCoA_ERROR(ERR::BadCodomain, FnName);
// if (CoeffRing(Rx) != CoeffRing(Ry))
// CoCoA_ERROR(ERR::MixedCoeffRings, FnName);
// return Rx->myHomCtor(Ry, CoeffEmbeddingHom(Ry), IndetImages);
return Rx->myHomCtor(Ry, CanonicalHom(CoeffRing(Rx),Ry), IndetImages);
}