- Timestamp:
- Oct 26, 1999, 2:38:57 PM (25 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'fc741b6502fd8a97288eaa3eba6e5220f3c3df87')
- Children:
- d6681d7c1532c8fdeadf659cf2603fd00f949139
- Parents:
- 70433b5a54091cef5a9460d2a25a863a310e7319
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/sparsmat.cc
r70433b5 r3ce7b6 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: sparsmat.cc,v 1.1 5 1999-10-22 11:14:17 obachmanExp $ */4 /* $Id: sparsmat.cc,v 1.16 1999-10-26 12:38:57 pohl Exp $ */ 5 5 6 6 /* … … 1008 1008 smpoly r = red; // row to reduce 1009 1009 smpoly res, a, b; 1010 poly ha, hr, gc,x, y;1010 poly ha, hr, x, y; 1011 1011 int e, ip, ir, ia, lev; 1012 1012 … … 1046 1046 else 1047 1047 { 1048 y = NULL;1049 x = hr;1050 1048 ha = a->m; 1051 1049 ia = a->e; 1052 if (ir > ia) 1053 { 1054 gc = SM_MULT(ha, m_res[ir]->m, m_res[ia]->m); 1050 if (ir >= ia) 1051 { 1052 if (ir > ia) 1053 { 1054 x = SM_MULT(ha, m_res[ir]->m, m_res[ia]->m); 1055 pDelete(&ha); 1056 ha = x; 1057 if (ia) SM_DIV(ha, m_res[ia]->m); 1058 ia = ir; 1059 } 1060 x = SM_MULT(ha, gp, m_res[ia]->m); 1055 1061 pDelete(&ha); 1056 ha = gc; 1062 y = SM_MULT(b->m, hr, m_res[ia]->m); 1063 } 1064 else if (ir >= ip) 1065 { 1066 if (ia < crd) 1067 { 1068 x = SM_MULT(ha, m_res[crd]->m, m_res[ia]->m); 1069 pDelete(&ha); 1070 ha = x; 1071 SM_DIV(ha, m_res[ia]->m); 1072 } 1073 y = hp; 1074 if(ir > ip) 1075 { 1076 y = SM_MULT(y, m_res[ir]->m, m_res[ip]->m); 1077 if (ip) SM_DIV(y, m_res[ip]->m); 1078 } 1079 ia = ir; 1080 x = SM_MULT(ha, y, m_res[ia]->m); 1081 if (y != hp) pDelete(&y); 1082 pDelete(&ha); 1083 y = SM_MULT(b->m, hr, m_res[ia]->m); 1084 } 1085 else 1086 { 1087 x = SM_MULT(hr, m_res[ia]->m, m_res[ir]->m); 1088 if (ir) SM_DIV(x, m_res[ir]->m); 1089 y = SM_MULT(b->m, x, m_res[ia]->m); 1090 pDelete(&x); 1091 x = SM_MULT(ha, gp, m_res[ia]->m); 1092 pDelete(&ha); 1093 } 1094 ha = pAdd(x, y); 1095 if (ha != NULL) 1096 { 1057 1097 if (ia) SM_DIV(ha, m_res[ia]->m); 1058 ia = ir; 1059 } 1060 else if (ir < ia) 1061 { 1062 if (ip < ia) 1063 { 1064 gc = SM_MULT(ha, m_res[crd]->m, m_res[ia]->m); 1065 pDelete(&ha); 1066 ha = gc; 1067 if (ia) SM_DIV(ha, m_res[ia]->m); 1068 y = hp; 1069 ia = ip; 1070 if (ir > ia) 1071 { 1072 y = SM_MULT(y, m_res[ir]->m, m_res[ia]->m); 1073 if (ia) SM_DIV(y, m_res[ia]->m); 1074 ia = ir; 1075 } 1076 else if (ir < ia) 1077 { 1078 x = SM_MULT(x, m_res[ia]->m, m_res[ir]->m); 1079 if (ir) SM_DIV(x, m_res[ir]->m); 1080 } 1081 } 1082 else 1083 { 1084 x = SM_MULT(x, m_res[ia]->m, m_res[ir]->m); 1085 if (ir) SM_DIV(x, m_res[ir]->m); 1086 } 1087 } 1088 if (y == NULL) y = gp; 1089 gc = SM_MULT(ha, y, m_res[ia]->m); 1090 pDelete(&ha); 1091 x = SM_MULT(x, b->m, m_res[ia]->m); 1092 x = pAdd(x, gc); 1093 if (x != NULL) 1094 { 1095 if (ia) SM_DIV(x, m_res[ia]->m); 1096 a->m = x; 1098 a->m = ha; 1097 1099 a->e = e; 1098 1100 a->f = smPolyWeight(a);
Note: See TracChangeset
for help on using the changeset viewer.