Changeset 04e6cf in git for libpolys/polys
- Timestamp:
- Feb 6, 2022, 2:03:55 PM (2 years ago)
- Branches:
- (u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
- Children:
- d4f723620e6a8e1eab6e3b1351719895af39a245
- Parents:
- 6a57089b3e776d07691d5d44f2130534d7a2c793
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/monomials/ring.cc
r6a57089 r04e6cf 986 986 #else 987 987 { 988 int l= (r2->block1[0]-r2->block0[0]+1)*sizeof(int);988 int l=r2->block1[0]-r2->block0[0]+1; 989 989 if (r2->order[0]==ringorder_a64) l*=2; 990 tmpR.wvhdl[1]=(int*)omalloc(l); 991 memcpy(tmpR.wvhdl[1],r2->wvhdl[0],l); 990 else if (r2->order[0]==ringorder_M) l=l*l; 991 tmpR.wvhdl[1]=(int*)omalloc(l*sizeof(int)); 992 memcpy(tmpR.wvhdl[1],r2->wvhdl[0],l*sizeof(int)); 992 993 } 993 994 #endif … … 1073 1074 #else 1074 1075 { 1075 int l= (r1->block1[i]-r1->block0[i]+1)*sizeof(int);1076 int l=r1->block1[i]-r1->block0[i]+1; 1076 1077 if (r1->order[i]==ringorder_a64) l*=2; 1077 tmpR.wvhdl[i]=(int*)omalloc(l); 1078 memcpy(tmpR.wvhdl[i],r1->wvhdl[i],l); 1078 else if (r1->order[i]==ringorder_M) l=l*l; 1079 tmpR.wvhdl[i]=(int*)omalloc(l*sizeof(int)); 1080 memcpy(tmpR.wvhdl[i],r1->wvhdl[i],l*sizeof(int)); 1079 1081 } 1080 1082 #endif … … 1102 1104 #else 1103 1105 { 1104 int l= (r2->block1[i]-r2->block0[i]+1)*sizeof(int);1106 int l=r2->block1[i]-r2->block0[i]+1; 1105 1107 if (r2->order[i]==ringorder_a64) l*=2; 1106 tmpR.wvhdl[j]=(int*)omalloc(l); 1107 memcpy(tmpR.wvhdl[j],r2->wvhdl[i],l); 1108 else if (r2->order[i]==ringorder_M) l=l*l; 1109 tmpR.wvhdl[j]=(int*)omalloc(l*sizeof(int)); 1110 memcpy(tmpR.wvhdl[j],r2->wvhdl[i],l*sizeof(int)); 1108 1111 } 1109 1112 #endif … … 1138 1141 #else 1139 1142 { 1140 int l= (r1->block1[i]-r1->block0[i]+1)*sizeof(int);1143 int l=r1->block1[i]-r1->block0[i]+1; 1141 1144 if (r1->order[i]==ringorder_a64) l*=2; 1142 tmpR.wvhdl[i]=(int*)omalloc(l); 1143 memcpy(tmpR.wvhdl[i],r1->wvhdl[i],l); 1145 else if (r1->order[i]==ringorder_M) l=l*l; 1146 tmpR.wvhdl[i]=(int*)omalloc(l*sizeof(int)); 1147 memcpy(tmpR.wvhdl[i],r1->wvhdl[i],l*sizeof(int)); 1144 1148 } 1145 1149 #endif … … 1487 1491 #else 1488 1492 { 1489 int l= (r->block1[j]-r->block0[j]+1)*sizeof(int);1493 int l=r->block1[j]-r->block0[j]+1; 1490 1494 if (r->order[j]==ringorder_a64) l*=2; 1491 res->wvhdl[j]=(int*)omalloc(l); 1492 memcpy(res->wvhdl[j],r->wvhdl[j],l); 1495 else if (r->order[j]==ringorder_M) l=l*l; 1496 res->wvhdl[j]=(int*)omalloc(l*sizeof(int)); 1497 memcpy(res->wvhdl[j],r->wvhdl[j],l*sizeof(int)); 1493 1498 } 1494 1499 #endif … … 1626 1631 #else 1627 1632 { 1628 int l= (r->block1[j]-r->block0[j]+1)*sizeof(int);1633 int l=r->block1[j]-r->block0[j]+1; 1629 1634 if (r->order[j]==ringorder_a64) l*=2; 1630 res->wvhdl[j+1]=(int*)omalloc(l); 1631 memcpy(res->wvhdl[j+1],r->wvhdl[j],l); 1635 else if (r->order[j]==ringorder_M) l=l*l; 1636 res->wvhdl[j+1]=(int*)omalloc(l*sizeof(int)); 1637 memcpy(res->wvhdl[j+1],r->wvhdl[j],l*sizeof(int)); 1632 1638 } 1633 1639 #endif … … 4511 4517 #else 4512 4518 { 4513 int l= (r->block1[j-1]-r->block0[j-1]+1)*sizeof(int);4519 int l=r->block1[j-1]-r->block0[j-1]+1; 4514 4520 if (r->order[j-1]==ringorder_a64) l*=2; 4515 wvhdl[j]=(int*)omalloc(l); 4516 memcpy(wvhdl[j],r->wvhdl[j-1],l); 4521 else if (r->order[j-1]==ringorder_M) l=l*l; 4522 wvhdl[j]=(int*)omalloc(l*sizeof(int)); 4523 memcpy(wvhdl[j],r->wvhdl[j-1],l*sizeof(int)); 4517 4524 } 4518 4525 #endif … … 4698 4705 #else 4699 4706 { 4700 int l= (r->block1[j]-r->block0[j]+1)*sizeof(int);4707 int l=r->block1[j]-r->block0[j]+1; 4701 4708 if (r->order[j]==ringorder_a64) l*=2; 4702 new_r->wvhdl[j]=(int*)omalloc(l); 4703 memcpy(new_r->wvhdl[j],r->wvhdl[j],l); 4709 else if (r->order[j]==ringorder_M) l=l*l; 4710 new_r->wvhdl[j]=(int*)omalloc(l*sizeof(int)); 4711 memcpy(new_r->wvhdl[j],r->wvhdl[j],l*sizeof(int)); 4704 4712 } 4705 4713 #endif … … 4931 4939 #else 4932 4940 { 4933 int l=(r->block1[i]-r->block0[i]+1) *sizeof(int);4941 int l=(r->block1[i]-r->block0[i]+1); 4934 4942 if (r->order[i]==ringorder_a64) l*=2; 4935 wvhdl[j]=(int*)omalloc(l); 4936 memcpy(wvhdl[j],r->wvhdl[i],l); 4943 else if (r->order[i]==ringorder_M) l=l*l; 4944 wvhdl[j]=(int*)omalloc(l*sizeof(int)); 4945 memcpy(wvhdl[j],r->wvhdl[i],l*sizeof(int)); 4937 4946 } 4938 4947 #endif … … 5224 5233 if (r->wvhdl[i] != NULL) 5225 5234 { 5226 int length = r->block1[i] - r->block0[i] ;5235 int length = r->block1[i] - r->block0[i]+1; 5227 5236 int* wvhdl = r->wvhdl[i]; 5228 5237 if (r->order[i] == ringorder_M) length *= length;
Note: See TracChangeset
for help on using the changeset viewer.