Changeset 89abbe0 in git


Ignore:
Timestamp:
Mar 2, 2011, 2:19:52 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b9f50b373314e74e83c7c060a651dd2913e1f033')
Children:
32bd40b31e0076ebec70b5bdec0b6cbb3b63df1e
Parents:
c6a3eb2acc5dd32736025e8cccb2ec85c75a4fbe
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-03-02 14:19:52+01:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 11:59:33+01:00
Message:
FIX: preimage of a map needs a GB -> separated into preimage.cc
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    rc6a3eb2 r89abbe0  
    2222x86_64-Linux/*
    2323ix86Mac-darwin/*
    24 libpolys/Makefile.in
    25 libpolys/misc/auxiliary.h
    26 libpolys/coeffs/test
    27 libpolys/*/COPYING
    28 libpolys/*/INSTALL
    2924omalloc/Makefile.in
    3025omalloc/omConfig.h.in
  • libpolys/polys/monomials/maps.cc

    rc6a3eb2 r89abbe0  
    190190}
    191191
    192 
    193 /*2
    194 *returns the preimage of id under theMap,
    195 *if id is empty or zero the kernel is computed
    196 * (assumes) that both ring have the same coeff.field
    197 */
    198 ideal maGetPreimage(ring theImageRing, map theMap, ideal id, const ring dst_r)
    199 {
    200   ring sourcering = dst_r;
    201 
    202 #ifdef HAVE_PLURAL
    203   if (rIsPluralRing(theImageRing))
    204   {
    205     if ((rIsPluralRing(sourcering)) && (ncRingType(sourcering)!=nc_comm))
    206     {
    207       Werror("Sorry, not yet implemented for noncomm. rings");
    208       return NULL;
    209     }
    210   }
    211 #endif
    212  
    213   int i,j;
    214   poly p,pp,q;
    215   ideal temp1;
    216   ideal temp2;
    217 
    218   int imagepvariables = rVar(theImageRing);
    219   int N = rVar(dst_r)+imagepvariables;
    220 
    221   ring tmpR;
    222   if (rSumInternal(theImageRing,sourcering,tmpR,FALSE,TRUE)!=1)
    223   {
    224      WerrorS("error in rSumInternal");
    225      return NULL;
    226   }
    227 
    228   if (n_SetMap(theImageRing->cf,dst_r->cf) != ndCopyMap)
    229   {
    230     Werror("Coefficient fields/rings must be equal");
    231     return NULL;
    232   }
    233 
    234   if (id==NULL)
    235     j = 0;
    236   else
    237     j = IDELEMS(id);
    238   int j0=j;
    239   if (theImageRing->qideal!=NULL) j+=IDELEMS(theImageRing->qideal);
    240   temp1 = idInit(sourcering->N+j,1);
    241   for (i=0;i<sourcering->N;i++)
    242   {
    243     q = p_ISet(-1,tmpR);
    244     p_SetExp(q,i+1+imagepvariables,1,tmpR);
    245     p_Setm(q,tmpR);
    246     if ((i<IDELEMS(theMap)) && (theMap->m[i]!=NULL))
    247     {
    248       p = p_SortMerge(
    249         pChangeSizeOfPoly(theImageRing,theMap->m[i],1,imagepvariables,tmpR),
    250         tmpR);
    251       p=p_Add_q(p,q,tmpR);
    252     }
    253     else
    254     {
    255       p = q;
    256     }
    257     temp1->m[i] = p;
    258   }
    259   idTest(temp1);
    260   for (i=sourcering->N;i<sourcering->N+j0;i++)
    261   {
    262     temp1->m[i] = p_SortMerge(pChangeSizeOfPoly(theImageRing,
    263                          id->m[i-sourcering->N],1,imagepvariables,tmpR),tmpR);
    264   }
    265   for (i=sourcering->N+j0;i<sourcering->N+j;i++)
    266   {
    267     temp1->m[i] = p_SortMerge(pChangeSizeOfPoly(theImageRing,
    268                               theImageRing->qideal->m[i-sourcering->N-j0],
    269                               1,imagepvariables,tmpR),tmpR);
    270   }
    271   // we ignore here homogenity - may be changed later:
    272   temp2 = kStd(temp1,NULL,isNotHomog,NULL);
    273   id_Delete(&temp1,tmpR);
    274   for (i=0;i<IDELEMS(temp2);i++)
    275   {
    276     if (pLowVar(temp2->m[i])<imagepvariables) p_Delete(&(temp2->m[i]),tmpR);
    277   }
    278 
    279   // let's get back to the original ring
    280   //rChangeCurrRing(sourcering);
    281   temp1 = idInit(5,1);
    282   j = 0;
    283   for (i=0;i<IDELEMS(temp2);i++)
    284   {
    285     p = temp2->m[i];
    286     if (p!=NULL)
    287     {
    288       q = p_SortMerge(pChangeSizeOfPoly(tmpR, p,imagepvariables+1,N),sourcering);
    289       if (j>=IDELEMS(temp1))
    290       {
    291         pEnlargeSet(&(temp1->m),IDELEMS(temp1),5);
    292         IDELEMS(temp1)+=5;
    293       }
    294       temp1->m[j] = q;
    295       j++;
    296     }
    297   }
    298   id_Delete(&temp2, tmpR);
    299   idSkipZeroes(temp1);
    300   rKill(tmpR);
    301   return temp1;
    302 }
    303192
    304193void maFindPerm(char **preim_names, int preim_n, char **preim_par, int preim_p,
  • libpolys/polys/monomials/maps.h

    rc6a3eb2 r89abbe0  
    1919map maCopy(map theMap, const ring dst_ring);
    2020
    21 ideal maGetPreimage(ring theImageRing, map theMap,ideal id);
    22 
    2321poly maIMap(ring src_ring, ring dst_ring, poly p);
    2422
Note: See TracChangeset for help on using the changeset viewer.