Changeset c3f34a in git for Singular/iparith.cc
- Timestamp:
- Feb 1, 2010, 6:53:05 PM (14 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 4a1fb878bfdf0417563882a38427ef60ca87a5ce
- Parents:
- 70395a0628894689bc48f60363faeb0a2166ff8a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/iparith.cc
r70395a rc3f34a 5988 5988 most. (Cached monomials are counted over all cached polynomials.) 5989 5989 */ 5990 const matrix m = (const matrix)v->Data(); 5991 const int mk = (const int)(long)v->next->Data(); 5990 matrix m; 5991 leftv u=v->next; 5992 v->next=NULL; 5993 if (v->Typ()==MATRIX_CMD) 5994 { 5995 m = (const matrix)v->Data(); 5996 } 5997 else 5998 { 5999 // try to convert to MATRIX: 6000 int ii=iiTestConvert(v->Typ(),MATRIX_CMD); 6001 BOOLEAN bo; 6002 sleftv tmp; 6003 if (ii>0) bo=iiConvert(v->Typ(),MATRIX_CMD,ii,v,&tmp); 6004 else bo=TRUE; 6005 if (bo) 6006 { 6007 Werror("cannot convert %s to matrix",Tok2Cmdname(v->Typ())); 6008 return TRUE; 6009 } 6010 m=(matrix)tmp.data; 6011 } 6012 const int mk = (const int)(long)u->Data(); 5992 6013 bool noIdeal = true; bool noK = true; bool noAlgorithm = true; 5993 6014 bool noCacheMinors = true; bool noCacheMonomials = true; … … 5995 6016 5996 6017 /* here come the different cases of correct argument sets */ 5997 if (( v->next->next != NULL) && (v->next->next->Typ() == IDEAL_CMD))5998 { 5999 IasSB = (ideal) v->next->next->Data();6018 if ((u->next != NULL) && (u->next->Typ() == IDEAL_CMD)) 6019 { 6020 IasSB = (ideal)u->next->Data(); 6000 6021 noIdeal = false; 6001 if (( v->next->next->next != NULL) && (v->next->next->next->Typ() == INT_CMD))6002 { 6003 k = (int)(long) v->next->next->next->Data();6022 if ((u->next->next != NULL) && (u->next->next->Typ() == INT_CMD)) 6023 { 6024 k = (int)(long)u->next->next->Data(); 6004 6025 noK = false; 6005 6026 assume(k != 0); 6006 if (( v->next->next->next->next != NULL) && (v->next->next->next->next->Typ() == STRING_CMD))6007 { 6008 algorithm = (char*) v->next->next->next->next->Data();6027 if ((u->next->next->next != NULL) && (u->next->next->next->Typ() == STRING_CMD)) 6028 { 6029 algorithm = (char*)u->next->next->next->Data(); 6009 6030 noAlgorithm = false; 6010 if (( v->next->next->next->next->next != NULL) && (v->next->next->next->next->next->Typ() == INT_CMD))6031 if ((u->next->next->next->next != NULL) && (u->next->next->next->next->Typ() == INT_CMD)) 6011 6032 { 6012 cacheMinors = (int)(long) v->next->next->next->next->next->Data();6033 cacheMinors = (int)(long)u->next->next->next->next->Data(); 6013 6034 noCacheMinors = false; 6014 if (( v->next->next->next->next->next->next != NULL) && (v->next->next->next->next->next->next->Typ() == INT_CMD))6035 if ((u->next->next->next->next->next != NULL) && (u->next->next->next->next->next->Typ() == INT_CMD)) 6015 6036 { 6016 cacheMonomials = (int)(long) v->next->next->next->next->next->next->Data();6037 cacheMonomials = (int)(long)u->next->next->next->next->next->Data(); 6017 6038 noCacheMonomials = false; 6018 6039 } … … 6021 6042 } 6022 6043 } 6023 else if (( v->next->next != NULL) && (v->next->next->Typ() == INT_CMD))6024 { 6025 k = (int)(long) v->next->next->Data();6044 else if ((u->next != NULL) && (u->next->Typ() == INT_CMD)) 6045 { 6046 k = (int)(long)u->next->Data(); 6026 6047 noK = false; 6027 6048 assume(k != 0); 6028 if (( v->next->next->next != NULL) && (v->next->next->next->Typ() == STRING_CMD))6029 { 6030 algorithm = (char*) v->next->next->next->Data();6049 if ((u->next->next != NULL) && (u->next->next->Typ() == STRING_CMD)) 6050 { 6051 algorithm = (char*)u->next->next->Data(); 6031 6052 noAlgorithm = false; 6032 if (( v->next->next->next->next != NULL) && (v->next->next->next->next->Typ() == INT_CMD))6033 { 6034 cacheMinors = (int)(long) v->next->next->next->next->Data();6053 if ((u->next->next->next != NULL) && (u->next->next->next->Typ() == INT_CMD)) 6054 { 6055 cacheMinors = (int)(long)u->next->next->next->Data(); 6035 6056 noCacheMinors = false; 6036 if (( v->next->next->next->next->next != NULL) && (v->next->next->next->next->next->Typ() == INT_CMD))6057 if ((u->next->next->next->next != NULL) && (u->next->next->next->next->Typ() == INT_CMD)) 6037 6058 { 6038 cacheMonomials = (int)(long) v->next->next->next->next->next->Data();6059 cacheMonomials = (int)(long)u->next->next->next->next->Data(); 6039 6060 noCacheMonomials = false; 6040 6061 } … … 6042 6063 } 6043 6064 } 6044 else if (( v->next->next != NULL) && (v->next->next->Typ() == STRING_CMD))6045 { 6046 algorithm = (char*) v->next->next->Data();6065 else if ((u->next != NULL) && (u->next->Typ() == STRING_CMD)) 6066 { 6067 algorithm = (char*)u->next->Data(); 6047 6068 noAlgorithm = false; 6048 if (( v->next->next->next != NULL) && (v->next->next->next->Typ() == INT_CMD))6049 { 6050 cacheMinors = (int)(long) v->next->next->next->Data();6069 if ((u->next->next != NULL) && (u->next->next->Typ() == INT_CMD)) 6070 { 6071 cacheMinors = (int)(long)u->next->next->Data(); 6051 6072 noCacheMinors = false; 6052 if (( v->next->next->next->next != NULL) && (v->next->next->next->next->Typ() == INT_CMD))6053 { 6054 cacheMonomials = (int)(long) v->next->next->next->next->Data();6073 if ((u->next->next->next != NULL) && (u->next->next->next->Typ() == INT_CMD)) 6074 { 6075 cacheMonomials = (int)(long)u->next->next->next->Data(); 6055 6076 noCacheMonomials = false; 6056 6077 } … … 6062 6083 { 6063 6084 if (strcmp(algorithm, "bareiss") == 0) 6064 algorithm = "Bareiss";6085 algorithm = (char*)"Bareiss"; 6065 6086 if (strcmp(algorithm, "laplace") == 0) 6066 algorithm = "Laplace";6087 algorithm = (char*)"Laplace"; 6067 6088 if (strcmp(algorithm, "cache") == 0) 6068 algorithm = "Cache"; 6069 } 6070 6089 algorithm = (char*)"Cache"; 6090 } 6091 6092 v->next=u; 6071 6093 /* here come some tests */ 6072 if ((!noIdeal) && (!hasFlag(v->next->next, FLAG_STD))) 6073 { 6074 WerrorS("Provided ideal is not a standard basis."); 6075 return TRUE; 6094 if (!noIdeal) 6095 { 6096 assumeStdFlag(u->next); 6076 6097 } 6077 6098 if ((!noK) && (k == 0))
Note: See TracChangeset
for help on using the changeset viewer.