Changeset 1327a0 in git for kernel/tgb_internal.h
 Timestamp:
 Oct 19, 2011, 4:37:28 PM (11 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
 Children:
 780e112edff75c0cf87a2cbc679791d1307e3f7e
 Parents:
 b093b052098cc93a629eb7fd0bad51349ec7ddaf
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

kernel/tgb_internal.h
rb093b0 r1327a0 956 956 int idx=idx_array[i]; 957 957 assume(bpos<256); 958 assume(!(npIsZero((number) buffer[bpos])));959 temp_array[idx]=F4mat_to_number_type(npAddM((number) temp_array[idx], (number) buffer[bpos++]));958 assume(!(npIsZero((number)(long) buffer[bpos]))); 959 temp_array[idx]=F4mat_to_number_type(npAddM((number)(long) temp_array[idx], (number)(long) buffer[bpos++])); 960 960 assume(idx<temp_size); 961 961 } … … 998 998 assume(bpos<256); 999 999 //assume(!(npIsZero((number) buffer[bpos]))); 1000 temp_array[i]=F4mat_to_number_type(npAddM((number) temp_array[i], (number) buffer[bpos++]));1000 temp_array[i]=F4mat_to_number_type(npAddM((number)(long) temp_array[i], (number)(long) buffer[bpos++])); 1001 1001 assume(i<temp_size); 1002 1002 } … … 1038 1038 { 1039 1039 1040 temp_array[i]=F4mat_to_number_type(npSubM((number) temp_array[i], (number) row[i]));1040 temp_array[i]=F4mat_to_number_type(npSubM((number)(long) temp_array[i], (number)(long) row[i])); 1041 1041 assume(i<temp_size); 1042 1042 } … … 1054 1054 { 1055 1055 int idx=idx_array[j]; 1056 temp_array[idx]=F4mat_to_number_type( (number_type)(long)npAddM((number) temp_array[idx],(number) coef_array[j]));1056 temp_array[idx]=F4mat_to_number_type( (number_type)(long)npAddM((number) (long)temp_array[idx],(number)(long) coef_array[j])); 1057 1057 assume(idx<temp_size); 1058 1058 } … … 1068 1068 { 1069 1069 int idx=idx_array[j]; 1070 temp_array[idx]=F4mat_to_number_type( (number_type)(long) npSubM((number) temp_array[idx],(number) coef_array[j]));1070 temp_array[idx]=F4mat_to_number_type( (number_type)(long) npSubM((number) (long)temp_array[idx],(number)(long) coef_array[j])); 1071 1071 assume(idx<temp_size); 1072 1072 } … … 1093 1093 if (row>idx_array) 1094 1094 { 1095 if (!((coef==(number) 1)(coef==minus_one)))1095 if (!((coef==(number)(long) 1)(coef==minus_one))) 1096 1096 { 1097 1097 add_coef_times_sparse(temp_array,temp_size,row,coef); … … 1099 1099 else 1100 1100 { 1101 if (coef==(number) 1)1101 if (coef==(number)(long) 1) 1102 1102 { 1103 1103 add_sparse(temp_array,temp_size,row); … … 1111 1111 else 1112 1112 //TODO: treat, 1,1 1113 if (!((coef==(number) 1)(coef==minus_one)))1113 if (!((coef==(number)(long) 1)(coef==minus_one))) 1114 1114 { 1115 1115 add_coef_times_dense(temp_array,temp_size,row>coef_array,row>len,coef); … … 1117 1117 else 1118 1118 { 1119 if (coef==(number) 1)1119 if (coef==(number)(long)1) 1120 1120 add_dense(temp_array,temp_size,row>coef_array,row>len); 1121 1121 else … … 1131 1131 if (red.ref>value_len==NoroCache<number_type>::backLinkCode) 1132 1132 { 1133 temp_array[red.ref>term_index]=F4mat_to_number_type( npAddM((number) temp_array[red.ref>term_index],red.coef));1133 temp_array[red.ref>term_index]=F4mat_to_number_type( npAddM((number)(long) temp_array[red.ref>term_index],red.coef)); 1134 1134 } 1135 1135 else … … 1179 1179 assume(coef_array[j]!=0); 1180 1180 CoefIdx<number_type> ci; 1181 ci.coef=F4mat_to_number_type(npMultM((number) coef,(number) coef_array[j]));1181 ci.coef=F4mat_to_number_type(npMultM((number)(long) coef,(number)(long) coef_array[j])); 1182 1182 ci.idx=idx_array[j]; 1183 1183 pairs[pos++]=ci; … … 1194 1194 assume(coef_array[j]!=0); 1195 1195 CoefIdx<number_type> ci; 1196 ci.coef=F4mat_to_number_type(npMultM((number) coef,(number) coef_array[j]));1196 ci.coef=F4mat_to_number_type(npMultM((number)(long) coef,(number)(long) coef_array[j])); 1197 1197 assume(ci.coef!=0); 1198 1198 ci.idx=j; … … 1229 1229 assume(coef_array[j]!=0); 1230 1230 CoefIdx<number_type> ci; 1231 ci.coef=F4mat_to_number_type(npNegM((number) coef_array[j]));1231 ci.coef=F4mat_to_number_type(npNegM((number)(long) coef_array[j])); 1232 1232 assume(ci.coef!=0); 1233 1233 ci.idx=j; … … 1364 1364 else 1365 1365 { 1366 pairs[act].coef=F4mat_to_number_type(npAddM((number) pairs[act].coef,(number)pairs[i].coef));1366 pairs[act].coef=F4mat_to_number_type(npAddM((number)(long)pairs[act].coef,(number)(long)pairs[i].coef)); 1367 1367 } 1368 1368 } … … 1464 1464 poly t=terms[j]; 1465 1465 t=p_LmInit(t,r); 1466 p_SetCoeff(t,(number) row[j],r);1466 p_SetCoeff(t,(number)(long) row[j],r); 1467 1467 pNext(t)=h; 1468 1468 h=t; … … 1531 1531 for(i=startIndices[row];i<ncols;i++) 1532 1532 { 1533 row_array[i]=F4mat_to_number_type(npMult((number) row_array[i],(number) coef));1533 row_array[i]=F4mat_to_number_type(npMult((number)(long) row_array[i],(number)(long) coef)); 1534 1534 } 1535 1535 } … … 1543 1543 assume(start<ncols); 1544 1544 int other_row; 1545 assume(!(npIsZero((number) row_array[start])));1546 if (!(npIsOne((number) coef)))1547 multiplyRow(r,F4mat_to_number_type(npInvers((number) coef)));1548 assume(npIsOne((number) row_array[start]));1545 assume(!(npIsZero((number)(long) row_array[start]))); 1546 if (!(npIsOne((number)(long) coef))) 1547 multiplyRow(r,F4mat_to_number_type(npInvers((number)(long) coef))); 1548 assume(npIsOne((number)(long) row_array[start])); 1549 1549 int lastIndex=modP_lastIndexRow(row_array, ncols); 1550 1550 number minus_one=npInit(1, currRing); … … 1556 1556 int i; 1557 1557 number_type* other_row_array=rows[other_row]; 1558 number coef2=npNeg((number) other_row_array[start]);1558 number coef2=npNeg((number)(long) other_row_array[start]); 1559 1559 if (coef2==minus_one) 1560 1560 { … … 1562 1562 { 1563 1563 if (row_array[i]!=zero) 1564 other_row_array[i]=F4mat_to_number_type(npSubM((number) other_row_array[i], (number) row_array[i]));1564 other_row_array[i]=F4mat_to_number_type(npSubM((number)(long) other_row_array[i], (number)(long) row_array[i])); 1565 1565 } 1566 1566 } … … 1571 1571 { 1572 1572 if (row_array[i]!=zero) 1573 other_row_array[i]=F4mat_to_number_type(npAddM(npMult(coef2,(number) row_array[i]),(number)other_row_array[i]));1573 other_row_array[i]=F4mat_to_number_type(npAddM(npMult(coef2,(number)(long) row_array[i]),(number) (long)other_row_array[i])); 1574 1574 } 1575 1575 } 1576 1576 updateStartIndex(other_row,start); 1577 assume(npIsZero((number) other_row_array[start]));1577 assume(npIsZero((number)(long) other_row_array[start])); 1578 1578 } 1579 1579 } … … 1582 1582 { 1583 1583 number_type* row_array=rows[row]; 1584 assume((lower_bound<0)(npIsZero((number) row_array[lower_bound])));1584 assume((lower_bound<0)(npIsZero((number)(long) row_array[lower_bound]))); 1585 1585 int i; 1586 1586 //number_type zero=npInit(0); … … 1637 1637 for(i=startIndices[row];i<ncols;i++) 1638 1638 { 1639 row_array[i]= F4mat_to_number_type(npMult((number) row_array[i],(number) coef));1639 row_array[i]=(number_type)(long)(npMult((number)(long) row_array[i],(number)(long) coef)); 1640 1640 } 1641 1641 } … … 1665 1665 { 1666 1666 assume(startIndices[i]<ncols); 1667 assume(!(npIsZero((number) rows[i][startIndices[i]])));1667 assume(!(npIsZero((number)(long) rows[i][startIndices[i]]))); 1668 1668 assume(startIndices[i]>=i); 1669 1669 updateLastReducibleIndex(i,nonZeroUntil+1); … … 1694 1694 number_type zero=0;//npInit(0); 1695 1695 number_type* row_array=rows[r]; 1696 assume((!(npIsZero((number) row_array[start]))));1696 assume((!(npIsZero((number)(long) row_array[start])))); 1697 1697 assume(start<ncols); 1698 1698 int other_row; 1699 if (!(npIsOne((number) row_array[r])))1699 if (!(npIsOne((number)(long) row_array[r]))) 1700 1700 { 1701 1701 //it should be one, but this safety is not expensive 1702 multiplyRow(r, F4mat_to_number_type(npInvers((number) row_array[start])));1702 multiplyRow(r, (number_type)(long)(npInvers((number)(long) row_array[start]))); 1703 1703 } 1704 1704 int lastIndex=modP_lastIndexRow(row_array, ncols); … … 1711 1711 { 1712 1712 number_type* other_row_array=rows[other_row]; 1713 number coef=npNeg((number) other_row_array[start]); 1713 number coef=((number)(long) other_row_array[start]); 1714 coef=npNeg(coef); 1714 1715 assume(!(npIsZero(coef))); 1715 1716 int i; … … 1718 1719 { 1719 1720 if (row_array[i]!=zero) 1720 other_row_array[i]= F4mat_to_number_type(npAddM(npMult(coef,(number)row_array[i]),(number)other_row_array[i]));1721 other_row_array[i]=(number_type)(long)(npAddM(npMult(coef,(number)(long)row_array[i]),(number)(long)other_row_array[i])); 1721 1722 } 1722 1723 updateLastReducibleIndex(other_row,r);
Note: See TracChangeset
for help on using the changeset viewer.