Changeset 86016d in git for kernel/ring.cc
- Timestamp:
- Feb 1, 2007, 12:51:25 AM (17 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- c591ad0eb4ed9f5be86c0c85d2412be2ad6be556
- Parents:
- 1cc61e18c0d6c70b177099c23a52159afb280bb4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/ring.cc
r1cc61e r86016d 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ring.cc,v 1.5 5 2007-01-29 18:08:21 SingularExp $ */4 /* $Id: ring.cc,v 1.56 2007-01-31 23:51:24 motsak Exp $ */ 5 5 6 6 /* … … 26 26 #ifdef HAVE_PLURAL 27 27 #include "gring.h" 28 #include "sca.h" 28 29 #endif 29 30 #include "maps.h" … … 390 391 else PrintS(" ..."); 391 392 #ifdef PDEBUG 392 Print("\n// noncommutative type:%d", r->nc->type);393 Print("\n// noncommutative type:%d", (int)ncRingType(r)); 393 394 Print("\n// is skew constant:%d",r->nc->IsSkewConstant); 395 if( rIsSCA(r) ) 396 { 397 Print("\n// alternating variables: [%d, %d]", scaFirstAltVar(r), scaLastAltVar(r)); 398 const ideal Q = r->nc->SCAQuotient(); // resides within r! 399 if (Q!=NULL) 400 { 401 PrintS("\n// quotient of sca by ideal"); 402 if (r==currRing) 403 { 404 PrintLn(); 405 iiWriteMatrix((matrix)Q,"__",1); 406 } 407 else PrintS(" ..."); 408 } 409 } 394 410 Print("\n// ref:%d",r->nc->ref); 395 411 #endif … … 1157 1173 if ( !R2_is_nc ) nc_rCreateNCcomm(R2); 1158 1174 /* nc->type's */ 1159 sum->nc->type = nc_undef;1160 nc_type t1 = R1->nc->type, t2 = R2->nc->type;1161 if ( t1==t2) sum->nc->type = t1;1175 ncRingType(sum, nc_undef); 1176 nc_type t1 = ncRingType(R1), t2 = ncRingType(R2); 1177 if ( t1==t2) ncRingType(sum, t1); 1162 1178 else 1163 1179 { 1164 if ( (t1==nc_general) || (t2==nc_general) ) sum->nc->type = nc_general;1165 } 1166 if ( sum->nc->type== nc_undef) /* not yet done */1180 if ( (t1==nc_general) || (t2==nc_general) ) ncRingType(sum, nc_general); 1181 } 1182 if (ncRingType(sum) == nc_undef) /* not yet done */ 1167 1183 { 1168 1184 switch (t1) 1169 1185 { 1170 1186 case nc_comm: 1171 sum->nc->type = t2;1187 ncRingType(sum, t2); 1172 1188 break; 1173 1189 case nc_lie: … … 1175 1191 { 1176 1192 case nc_skew: 1177 sum->nc->type = nc_general; break;1193 ncRingType(sum, nc_general); break; 1178 1194 case nc_comm: 1179 sum->nc->type = nc_lie; break;1195 ncRingType(sum, nc_lie); break; 1180 1196 default: 1181 1197 /*sum->nc->type = nc_undef;*/ break; … … 1186 1202 { 1187 1203 case nc_lie: 1188 sum->nc->type = nc_lie; break;1204 ncRingType(sum, nc_lie); break; 1189 1205 case nc_comm: 1190 sum->nc->type = nc_skew; break;1206 ncRingType(sum, nc_skew); break; 1191 1207 default: 1192 1208 /*sum->nc->type = nc_undef;*/ break; … … 1197 1213 } 1198 1214 } 1199 if ( sum->nc->type== nc_undef)1215 if (ncRingType(sum) == nc_undef) 1200 1216 WarnS("Error on recognizing nc types"); 1201 1217 /* multiplication matrices business: */ … … 3950 3966 r->nc->ref = 1; /* in spite of rCopy(src)? */ 3951 3967 r->nc->basering = r; 3952 r->nc->type = src->nc->type;3968 ncRingType(r, ncRingType(src)); 3953 3969 int *perm = (int *)omAlloc0((rVar(r)+1)*sizeof(int)); 3954 3970 int *par_perm = NULL;
Note: See TracChangeset
for help on using the changeset viewer.