Changeset d914cf0 in git
- Timestamp:
- Aug 12, 2011, 7:25:13 PM (13 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
- Children:
- 77bb59200a4a6c29f96eb37fb6da3b221d283eba
- Parents:
- c10515350d72537c759f372977e1d69188eed976
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-08-12 19:25:13+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 13:24:02+01:00
- Files:
-
- 1 added
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
Singular/iparith.cc
rc10515 rd914cf0 31 31 #include <kernel/kstd1.h> 32 32 #include <kernel/timer.h> 33 34 #include <kernel/preimage.h> 35 33 36 #include <polys/monomials/ring.h> 34 37 #include <Singular/subexpr.h> -
kernel/makefile
rc10515 rd914cf0 83 83 tgb.cc tgbgauss.cc ringgb.cc f5data.cc f5lists.cc f5gb.cc \ 84 84 f5c.cc ratgring.cc shiftgb.cc gfan.cc \ 85 linearAlgebra.cc nc.cc 85 linearAlgebra.cc nc.cc preimage.cc 86 86 87 CXXSOURCES2 = SingularBuilder.cpp 87 88 … … 115 116 mmalloc.h \ 116 117 semic.h \ 117 gfan.h 118 gfan.h preimage.h 118 119 119 120 DISTFILES=${SOURCES} ${HEADERS} ${ESOURCES} \ -
kernel/preimage.cc
rc10515 rd914cf0 1 // ideal maGetPreimage(ring theImageRing, map theMap,ideal id); 1 #include "mod2.h" 2 3 #include <omalloc/omalloc.h> 4 #include <misc/auxiliary.h> 5 #include <misc/options.h> 6 #include <misc/intvec.h> 7 8 #include <polys/polys.h> 9 #include <polys/monomials/ring.h> 10 11 12 #include <kernel/febase.h> 13 #include <kernel/ideals.h> 14 #include <kernel/kstd1.h> 15 #include <kernel/khstd.h> 16 17 #include <kernel/kutil.h> 18 19 20 #ifdef HAVE_PLURAL 21 #include <polys/nc/nc.h> 22 #endif 23 24 /*2 25 *shifts the variables between minvar and maxvar of p \in p_ring to the 26 *first maxvar-minvar+1 variables in the actual ring 27 *be carefull: there is no range check for the variables of p 28 */ 29 static poly pChangeSizeOfPoly(ring p_ring, poly p,int minvar,int maxvar, const ring dst_r) 30 { 31 int i; 32 poly result = NULL,resultWorkP; 33 number n; 34 35 if (p==NULL) return result; 36 else result = p_Init(dst_r); 37 resultWorkP = result; 38 while (p!=NULL) 39 { 40 for (i=minvar;i<=maxvar;i++) 41 p_SetExp(resultWorkP,i-minvar+1,p_GetExp(p,i,p_ring),dst_r); 42 p_SetComp(resultWorkP,p_GetComp(p,p_ring),dst_r); 43 n=n_Copy(pGetCoeff(p),dst_r->cf); 44 p_SetCoeff(resultWorkP,n,dst_r); 45 p_Setm(resultWorkP,dst_r); 46 pIter(p); 47 if (p!=NULL) 48 { 49 pNext(resultWorkP) = p_Init(dst_r); 50 pIter(resultWorkP); 51 } 52 } 53 return result; 54 } 55 56 2 57 3 58 /*2 … … 57 112 { 58 113 p = p_SortMerge( 59 pChangeSizeOfPoly(theImageRing,theMap->m[i],1,imagepvariables,tmpR),60 tmpR);114 pChangeSizeOfPoly(theImageRing, theMap->m[i], 1, imagepvariables, tmpR), 115 tmpR); 61 116 p=p_Add_q(p,q,tmpR); 62 117 } … … 70 125 for (i=sourcering->N;i<sourcering->N+j0;i++) 71 126 { 72 temp1->m[i] = p_SortMerge(pChangeSizeOfPoly(theImageRing, 73 id->m[i-sourcering->N],1,imagepvariables,tmpR),tmpR); 127 temp1->m[i] = p_SortMerge( 128 pChangeSizeOfPoly(theImageRing, id->m[i-sourcering->N], 1, imagepvariables, tmpR), 129 tmpR); 74 130 } 75 131 for (i=sourcering->N+j0;i<sourcering->N+j;i++) 76 132 { 77 temp1->m[i] = p_SortMerge( pChangeSizeOfPoly(theImageRing,78 theImageRing->qideal->m[i-sourcering->N-j0],79 1,imagepvariables,tmpR),tmpR);133 temp1->m[i] = p_SortMerge( 134 pChangeSizeOfPoly(theImageRing, theImageRing->qideal->m[i-sourcering->N-j0], 1, imagepvariables, tmpR), 135 tmpR); 80 136 } 81 137 // we ignore here homogenity - may be changed later: … … 84 140 for (i=0;i<IDELEMS(temp2);i++) 85 141 { 86 if (p LowVar(temp2->m[i])<imagepvariables) p_Delete(&(temp2->m[i]),tmpR);142 if (p_LowVar(temp2->m[i], currRing)<imagepvariables) p_Delete(&(temp2->m[i]),tmpR); 87 143 } 88 144 … … 96 152 if (p!=NULL) 97 153 { 98 q = p_SortMerge(pChangeSizeOfPoly(tmpR, p,imagepvariables+1,N),sourcering); 154 q = p_SortMerge( 155 pChangeSizeOfPoly(tmpR, p, imagepvariables+1, N, sourcering), 156 sourcering); 99 157 if (j>=IDELEMS(temp1)) 100 158 { -
kernel/test.cc
rc10515 rd914cf0 149 149 // #include "PowerSeries.h" // Too old? 150 150 151 #include "preimage.h" 151 152 152 153 #include "nc.h" -
libpolys/polys/monomials/maps.cc
rc10515 rd914cf0 159 159 return result; 160 160 } 161 162 /*2163 *shifts the variables between minvar and maxvar of p \in p_ring to the164 *first maxvar-minvar+1 variables in the actual ring165 *be carefull: there is no range check for the variables of p166 */167 static poly pChangeSizeOfPoly(ring p_ring, poly p,int minvar,int maxvar, const ring dst_r)168 {169 int i;170 poly result = NULL,resultWorkP;171 number n;172 173 if (p==NULL) return result;174 else result = p_Init(dst_r);175 resultWorkP = result;176 while (p!=NULL)177 {178 for (i=minvar;i<=maxvar;i++)179 p_SetExp(resultWorkP,i-minvar+1,p_GetExp(p,i,p_ring),dst_r);180 p_SetComp(resultWorkP,p_GetComp(p,p_ring),dst_r);181 n=n_Copy(pGetCoeff(p),dst_r->cf);182 p_SetCoeff(resultWorkP,n,dst_r);183 p_Setm(resultWorkP,dst_r);184 pIter(p);185 if (p!=NULL)186 {187 pNext(resultWorkP) = p_Init(dst_r);188 pIter(resultWorkP);189 }190 }191 return result;192 }193 194 161 195 162 void maFindPerm(char **preim_names, int preim_n, char **preim_par, int preim_p, -
libpolys/polys/monomials/p_polys.h
rc10515 rd914cf0 1920 1920 1921 1921 /*----------------------------------------------------*/ 1922 int p_Var(poly mi, const ring r);1922 int p_Var(poly mi, const ring r); 1923 1923 /// the minimal index of used variables - 1 1924 int p_LowVar (poly p );1924 int p_LowVar (poly p, const ring r); 1925 1925 1926 1926 /*----------------------------------------------------*/
Note: See TracChangeset
for help on using the changeset viewer.