Changeset d22802 in git
- Timestamp:
- Mar 19, 2021, 9:47:57 PM (3 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- d5b4b6b74819f9180ae9279cb701e929fb931c12
- Parents:
- 2c5e6915fcb7bea0992cbde73d5924fccef312af
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ipassign.cc
r2c5e69 rd22802 461 461 return FALSE; 462 462 } 463 static inline void jjCheck_FLAG_OTHER_RING(leftv res) 464 { 463 static inline ring jjCheck_FLAG_OTHER_RING(leftv res) 464 { 465 ring old_r=currRing; 465 466 if (Sy_inset(FLAG_RING,res->flag)) 466 467 { … … 469 470 if ((res-1)->data!=NULL) 470 471 { 471 ring rr=(ring)(res-1)->data;472 rr->ref--;472 old_r=(ring)(res-1)->data; 473 old_r->ref--; 473 474 } 474 475 (res-1)->data=currRing; … … 477 478 } 478 479 } 480 res->flag &= ~(Sy_bit(FLAG_OTHER_RING) |Sy_bit(FLAG_RING)); 481 return old_r; 479 482 } 480 483 static BOOLEAN jiA_NUMBER(leftv res, leftv a, Subexpr) 481 484 { 482 void *test_p=a->Data(); // can I access it (newstruct)?485 number p=(number)a->CopyD(NUMBER_CMD); 483 486 if (errorreported) return TRUE; 484 number p=(number)a->CopyD(NUMBER_CMD);485 487 if (res->data!=NULL) nDelete((number *)&res->data); 486 488 nNormalize(p); … … 706 708 static BOOLEAN jiA_LIST_RES(leftv res, leftv a,Subexpr) 707 709 { 708 void *test_p=a->Data(); // can I access it (newstruct)?710 syStrategy r=(syStrategy)a->CopyD(RESOLUTION_CMD); 709 711 if (errorreported) return TRUE; 710 syStrategy r=(syStrategy)a->CopyD(RESOLUTION_CMD);711 712 if (res->data!=NULL) ((lists)res->data)->Clean(); 712 713 int add_row_shift = 0; … … 719 720 static BOOLEAN jiA_LIST(leftv res, leftv a,Subexpr) 720 721 { 721 void *test_p=a->Data(); // can I access it (newstruct)?722 lists l=(lists)a->CopyD(LIST_CMD); 722 723 if (errorreported) return TRUE; 723 // FLAG_OTHER_RING is only set for ring dep. types, so currRing!=NULL724 lists l=(lists)a->CopyD(LIST_CMD);725 724 if (res->data!=NULL) ((lists)res->data)->Clean(); 726 725 res->data=(void *)l; … … 730 729 static BOOLEAN jiA_POLY(leftv res, leftv a,Subexpr e) 731 730 { 732 void *test_p=a->Data(); // can I access it (newstruct)?731 poly p=(poly)a->CopyD(POLY_CMD); 733 732 if (errorreported) return TRUE; 734 poly p=(poly)a->CopyD(POLY_CMD);735 733 pNormalize(p); 736 734 if (e==NULL) … … 828 826 } 829 827 matrix am=(matrix)a->CopyD(MATRIX_CMD); 828 if (errorreported) return TRUE; 830 829 if ((MATROWS(am)!=1) || (MATCOLS(am)!=1)) 831 830 { … … 918 917 // there should be no assign bucket:=bucket, here we have poly:=bucket 919 918 { 920 void *test_p=a->Data(); // can I access it (newstruct)?919 sBucket_pt b=(sBucket_pt)a->CopyD(); 921 920 if (errorreported) return TRUE; 922 sBucket_pt b=(sBucket_pt)a->CopyD();923 921 poly p; int l; 924 922 sBucketDestroyAdd(b,&p,&l); … … 931 929 static BOOLEAN jiA_IDEAL(leftv res, leftv a, Subexpr) 932 930 { 933 void *test_p=a->Data(); // can I access it (newstruct)?931 ideal I=(ideal)a->CopyD(MATRIX_CMD); 934 932 if (errorreported) return TRUE; 935 933 if (res->data!=NULL) idDelete((ideal*)&res->data); 936 res->data=(void *)a->CopyD(MATRIX_CMD);934 res->data=(void*)I; 937 935 if (a->rtyp==IDHDL) id_Normalize((ideal)a->Data(), currRing); 938 else id_Normalize( (ideal)res->data, currRing);936 else id_Normalize(I/*(ideal)res->data*/, currRing); 939 937 jiAssignAttr(res,a); 940 938 if (((res->rtyp==IDEAL_CMD)||(res->rtyp==MODUL_CMD)) 941 && (IDELEMS( (ideal)(res->data))==1)939 && (IDELEMS(I/*(ideal)(res->data)*/)==1) 942 940 && (currRing->qideal==NULL) 943 941 && (!rIsPluralRing(currRing)) … … 955 953 static BOOLEAN jiA_RESOLUTION(leftv res, leftv a, Subexpr) 956 954 { 957 void *test_p=a->Data(); // can I access it (newstruct)?955 syStrategy R=(syStrategy)a->CopyD(RESOLUTION_CMD); 958 956 if (errorreported) return TRUE; 959 957 if (res->data!=NULL) syKillComputation((syStrategy)res->data); 960 res->data=(void *)a->CopyD(RESOLUTION_CMD);958 res->data=(void*)R; 961 959 jiAssignAttr(res,a); 962 960 return FALSE; … … 965 963 /* module = poly */ 966 964 { 967 void *test_p=a->Data(); // can I access it (newstruct)?968 if (errorreported) return TRUE;969 if (res->data!=NULL) idDelete((ideal*)&res->data);970 965 ideal I=idInit(1,1); 971 966 I->m[0]=(poly)a->CopyD(POLY_CMD); 967 if (errorreported) return TRUE; 972 968 if (I->m[0]!=NULL) pSetCompP(I->m[0],1); 973 969 pNormalize(I->m[0]); 970 if (res->data!=NULL) idDelete((ideal*)&res->data); 974 971 res->data=(void *)I; 975 972 if (TEST_V_QRING && (currRing->qideal!=NULL)) … … 982 979 static BOOLEAN jiA_IDEAL_M(leftv res, leftv a, Subexpr) 983 980 { 984 void *test_p=a->Data(); // can I access it (newstruct)?981 matrix m=(matrix)a->CopyD(MATRIX_CMD); 985 982 if (errorreported) return TRUE; 986 if (res->data!=NULL) idDelete((ideal*)&res->data);987 matrix m=(matrix)a->CopyD(MATRIX_CMD);988 983 if (TEST_V_ALLWARN) 989 984 if (MATROWS(m)>1) … … 993 988 MATROWS(m)=1; 994 989 id_Normalize((ideal)m, currRing); 990 if (res->data!=NULL) idDelete((ideal*)&res->data); 995 991 res->data=(void *)m; 996 992 if (TEST_V_QRING && (currRing->qideal!=NULL)) … … 1003 999 static BOOLEAN jiA_IDEAL_Mo(leftv res, leftv a, Subexpr) 1004 1000 { 1005 void *test_p=a->Data(); // can I access it (newstruct)?1001 ideal m=(ideal)a->CopyD(MODUL_CMD); 1006 1002 if (errorreported) return TRUE; 1007 ideal m=(ideal)a->CopyD(MODUL_CMD);1008 1003 if (m->rank>1) 1009 1004 { … … 1049 1044 static BOOLEAN jiA_MAP(leftv res, leftv a, Subexpr) 1050 1045 { 1051 void *test_p=a->Data(); // can I access it (newstruct)?1052 if (errorreported) return TRUE;1053 1046 if (res->data!=NULL) 1054 1047 { … … 1058 1051 } 1059 1052 res->data=(void *)a->CopyD(MAP_CMD); 1053 if (errorreported) return TRUE; 1060 1054 jiAssignAttr(res,a); 1061 1055 return FALSE; … … 1064 1058 static BOOLEAN jiA_MAP_ID(leftv res, leftv a, Subexpr) 1065 1059 { 1066 void *test_p=a->Data(); // can I access it (newstruct)?1067 if (errorreported) return TRUE;1068 1060 map f=(map)res->data; 1069 1061 char *rn=f->preimage; // save the old/already assigned preimage ring name … … 1071 1063 idDelete((ideal *)&f); 1072 1064 res->data=(void *)a->CopyD(IDEAL_CMD); 1065 if (errorreported) return TRUE; 1073 1066 f=(map)res->data; 1074 1067 id_Normalize((ideal)f, currRing); … … 1085 1078 return TRUE; 1086 1079 } 1087 void *test_p=a->Data(); // can I access it (newstruct)?1088 if (errorreported) return TRUE;1089 1080 1090 1081 ring old_ring=(ring)res->Data(); … … 1092 1083 coeffs newcf = currRing->cf; 1093 1084 ideal id = (ideal)a->Data(); //? 1085 if (errorreported) return TRUE; 1094 1086 const int cpos = idPosConstant(id); 1095 1087 if(rField_is_Ring(currRing)) … … 1226 1218 { 1227 1219 coeffs r=(coeffs)a->Data(); 1220 if (errorreported) return TRUE; 1228 1221 if (r==NULL) return TRUE; 1229 1222 if (res->data!=NULL) nKillChar((coeffs)res->data); … … 1916 1909 sleftv tmp; 1917 1910 memset(&tmp,0,sizeof(sleftv)); 1918 tmp.flag=ld->flag;1919 1911 if (/*(ld->rtyp!=LIST_CMD) 1920 1912 &&*/(ld->e==NULL) 1921 1913 && (ld->Typ()!=r->Typ())) 1922 1914 { 1923 jjCheck_FLAG_OTHER_RING(ld);1915 ring old_r=jjCheck_FLAG_OTHER_RING(ld); 1924 1916 tmp.rtyp=DEF_CMD; 1917 tmp.flag=ld->flag; 1925 1918 b=iiAssign(&tmp,r,FALSE); 1926 ld->CleanUp( );1919 ld->CleanUp(old_r); 1927 1920 memcpy(ld,&tmp,sizeof(sleftv)); 1928 1921 } … … 1931 1924 && (ld->Typ()<MAX_TOK)) 1932 1925 { 1933 jjCheck_FLAG_OTHER_RING(ld);1926 ring old_r=jjCheck_FLAG_OTHER_RING(ld); 1934 1927 tmp.rtyp=r->Typ(); 1928 tmp.flag=ld->flag; 1935 1929 tmp.data=(char*)idrecDataInit(r->Typ()); 1936 1930 b=iiAssign(&tmp,r,FALSE); 1937 ld->CleanUp( );1931 ld->CleanUp(old_r); 1938 1932 memcpy(ld,&tmp,sizeof(sleftv)); 1939 1933 }
Note: See TracChangeset
for help on using the changeset viewer.