Changeset 39a208 in git
 Timestamp:
 May 6, 2005, 4:12:35 PM (18 years ago)
 Branches:
 (u'spielwiese', '91fdef05f09f54b8d58d92a472e9c4a43aa4656f')
 Children:
 e6fb5315eb32da00236163ce10f9bdafaaa0bd47
 Parents:
 b07a6d9646920374a6d44fdc59880be8c437d21b
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

kernel/ring.cc
rb07a6d9 r39a208 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ring.cc,v 1.3 7 20050504 15:25:45 Singular Exp $ */4 /* $Id: ring.cc,v 1.38 20050506 14:12:35 Singular Exp $ */ 5 5 6 6 /* … … 343 343 for (i = 1; i<r>N; i++) 344 344 { 345 346 347 348 349 350 351 352 353 354 345 for (j = i+1; j<=r>N; j++) 346 { 347 nl = nIsOne(p_GetCoeff(MATELEM(r>nc>C,i,j),r)); 348 if ( (MATELEM(r>nc>D,i,j)!=NULL)  (!nl) ) 349 { 350 Print("\n// %s%s=",r>names[j1],r>names[i1]); 351 pl = MATELEM(r>nc>MT[UPMATELEM(i,j,r>N)],1,1); 352 pWrite0(pl); 353 } 354 } 355 355 } 356 356 } … … 1106 1106 #ifdef HAVE_PLURAL 1107 1107 ring old_ring = currRing; 1108 rChangeCurrRing(sum);1109 1108 BOOLEAN R1_is_nc = rIsPluralRing(r1); 1110 1109 BOOLEAN R2_is_nc = rIsPluralRing(r2); … … 1132 1131 if (sum>nc>type == nc_undef) /* not yet done */ 1133 1132 { 1134 switch (t1) 1133 switch (t1) 1135 1134 { 1136 1135 case nc_comm: 1137 1136 sum>nc>type = t2; 1138 1137 break; 1139 1138 case nc_lie: 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1139 switch(t2) 1140 { 1141 case nc_skew: 1142 sum>nc>type = nc_general; break; 1143 case nc_comm: 1144 sum>nc>type = nc_lie; break; 1145 default: 1146 /*sum>nc>type = nc_undef;*/ break; 1147 } 1148 break; 1150 1149 case nc_skew: 1151 1152 1153 1154 1155 1156 1157 1158 1159 1150 switch(t2) 1151 { 1152 case nc_lie: 1153 sum>nc>type = nc_lie; break; 1154 case nc_comm: 1155 sum>nc>type = nc_skew; break; 1156 default: 1157 /*sum>nc>type = nc_undef;*/ break; 1158 } 1160 1159 default: 1161 1160 /*sum>nc>type = nc_undef;*/ … … 1191 1190 for (j= i+1; j<= rVar(R1) + rVar(R2); j++) 1192 1191 { 1193 1192 MATELEM(C,i,j) = pOne(); 1194 1193 } 1195 1194 } … … 1199 1198 { 1200 1199 1201 1202 1203 1204 1205 1200 MATELEM(C,i,j) = pPermPoly(MATELEM(C1,i,j),perm1,R1,nMap1,par_perm1,rPar(R1)); 1201 if (MATELEM(D1,i,j) != NULL) 1202 { 1203 MATELEM(D,i,j) = pPermPoly(MATELEM(D1,i,j),perm1,R1,nMap1,par_perm1,rPar(R1)); 1204 } 1206 1205 } 1207 1206 } … … 1211 1210 { 1212 1211 MATELEM(C,rVar(R1)+i,rVar(R1)+j) = pPermPoly(MATELEM(C2,i,j),perm2,R2,nMap2,par_perm2,rPar(R2)); 1213 1214 1215 1216 1212 if (MATELEM(D2,i,j) != NULL) 1213 { 1214 MATELEM(D,rVar(R1)+i,rVar(R1)+j) = pPermPoly(MATELEM(D2,i,j),perm2,R2,nMap2,par_perm2,rPar(R2)); 1215 } 1217 1216 } 1218 1217 } … … 1232 1231 if (par_perm1!=NULL) omFree((ADDRESS)par_perm1); 1233 1232 if (par_perm2!=NULL) omFree((ADDRESS)par_perm2); 1234 if ( old_ring != NULL) 1235 rChangeCurrRing(old_ring); 1233 rChangeCurrRing(old_ring); 1236 1234 } 1237 1235 #endif 1236 ideal Q=NULL; 1237 ideal Q1=NULL, Q2=NULL; 1238 1238 ring old_ring2 = currRing; 1239 rChangeCurrRing(sum);1240 ideal Q=NULL;1241 ideal Q1, Q2;1242 1239 if (r1>qideal!=NULL) 1243 1240 { 1241 rChangeCurrRing(sum); 1244 1242 // if (r2>qideal!=NULL) 1245 1243 // { 1246 // WerrorS("todo: qring+qring"); 1244 // WerrorS("todo: qring+qring"); 1247 1245 // return 1; 1248 1246 // } … … 1254 1252 if (rPar(r1)!=0) par_perm1=(int *)omAlloc0((rPar(r1)+1)*sizeof(int)); 1255 1253 maFindPerm(r1>names, rVar(r1), r1>parameter, rPar(r1), 1256 1257 1254 sum>names, rVar(sum), sum>parameter, rPar(sum), 1255 perm1, par_perm1, sum>ch); 1258 1256 nMapFunc nMap1 = nSetMap(r1); 1259 1257 Q1 = idInit(IDELEMS(r1>qideal),1); … … 1262 1260 omFree((ADDRESS)perm1); 1263 1261 } 1264 else1265 {1266 Q1 = NULL;1267 }1268 1262 1269 1263 if (r2>qideal!=NULL) 1270 1264 { 1265 if (currRing!=sum) 1266 rChangeCurrRing(sum); 1271 1267 int *perm2 = (int *)omAlloc0((rVar(r2)+1)*sizeof(int)); 1272 1268 int *par_perm2 = NULL; 1273 1269 if (rPar(r2)!=0) par_perm2=(int *)omAlloc0((rPar(r2)+1)*sizeof(int)); 1274 1270 maFindPerm(r2>names, rVar(r2), r2>parameter, rPar(r2), 1275 1276 1271 sum>names, rVar(sum), sum>parameter, rPar(sum), 1272 perm2, par_perm2, sum>ch); 1277 1273 nMapFunc nMap2 = nSetMap(r2); 1278 1274 Q2 = idInit(IDELEMS(r2>qideal),1); … … 1281 1277 omFree((ADDRESS)perm2); 1282 1278 } 1283 else1284 {1285 Q2 = NULL;1286 }1287 1279 if ( (Q1!=NULL)  ( Q2!=NULL)) 1280 { 1288 1281 Q = idSimpleAdd(Q1,Q2); 1289 sum>qideal = Q;1290 if ( old_ring2 != NULL)1291 1282 rChangeCurrRing(old_ring2); 1283 } 1284 sum>qideal = Q; 1292 1285 return 1; 1293 1286 } 1287 1294 1288 /*2 1295 1289 * create a copy of the ring r, which must be equivalent to currRing … … 3668 3662 { 3669 3663 int t=w[j]; 3670 w[j]=w[lj]; 3671 w[lj]=t; 3664 w[j]=w[lj]; 3665 w[lj]=t; 3672 3666 } 3673 3667 } … … 3724 3718 // { 3725 3719 // case ro_dp: 3726 // // 3720 // // 3727 3721 // t=r>typ[i].data.dp.start; 3728 3722 // r>typ[i].data.dp.start=rOppVar(r,r>typ[i].data.dp.end); … … 3781 3775 break; 3782 3776 case ringorder_dp: /* dp > a(1..1),ls */ 3783 { 3777 { 3784 3778 l=rRealloc1(r,src,l,j); 3785 3779 r>order[j]=ringorder_a; … … 3795 3789 j++; 3796 3790 break; 3797 } 3791 } 3798 3792 case ringorder_Dp: /* Dp > a(1..1),rp */ 3799 { 3793 { 3800 3794 l=rRealloc1(r,src,l,j); 3801 3795 r>order[j]=ringorder_a; … … 3811 3805 j++; 3812 3806 break; 3813 } 3807 } 3814 3808 case ringorder_wp: /* wp > a(...),ls */ 3815 { 3809 { 3816 3810 l=rRealloc1(r,src,l,j); 3817 3811 r>order[j]=ringorder_a; … … 3826 3820 j++; 3827 3821 break; 3828 } 3822 } 3829 3823 case ringorder_Wp: /* Wp > a(...),rp */ 3830 { 3824 { 3831 3825 l=rRealloc1(r,src,l,j); 3832 3826 r>order[j]=ringorder_a; … … 3841 3835 j++; 3842 3836 break; 3843 } 3837 } 3844 3838 case ringorder_M: /* M > M */ 3845 { 3839 { 3846 3840 r>order[j]=ringorder_M; 3847 3841 r>block0[j]=rOppVar(r, src>block1[i]); … … 3857 3851 } 3858 3852 case ringorder_a: /* a(...),ls > wp/dp */ 3859 { 3853 { 3860 3854 r>block0[j]=rOppVar(r, src>block1[i]); 3861 3855 r>block1[j]=rOppVar(r, src>block0[i]); … … 3889 3883 break; 3890 3884 } 3891 } 3885 } 3892 3886 rComplete(r); 3893 3887 #ifdef RDEBUG … … 4005 3999 if (MATELEM(D0,i,j) != NULL) 4006 4000 { 4007 4008 4009 4010 4001 p = prCopyR(MATELEM(D0,i,j), src>nc>basering, dest); 4002 MATELEM(D,i,j) = nc_p_CopyPut(p, dest); 4003 p_Delete(&p, dest); 4004 p = NULL; 4011 4005 } 4012 4006 } … … 4040 4034 { 4041 4035 r>order[i]=ringorder_a64; 4042 4043 4044 4045 4046 4047 4036 int *w=r>wvhdl[i]; 4037 int64 *w64=(int64 *)omAlloc((r>block1[i]r>block0[i]+1)*sizeof(int64)); 4038 for(j=r>block1[i]r>block0[i];j>=0;j) 4039 w64[j]=(int64)w[j]; 4040 r>wvhdl[i]=(int*)w64; 4041 omFreeSize(w,(r>block1[i]r>block0[i]+1)*sizeof(int)); 4048 4042 } 4049 4043 i++;
Note: See TracChangeset
for help on using the changeset viewer.