Changeset 6fc941 in git for Singular/ipconv.cc
- Timestamp:
- May 29, 2006, 6:10:50 PM (18 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 9f738e4e4d9a2396fedb4bf644b5fc7cbac460ad
- Parents:
- 7145030af0d072406bdbbd5f4cbd550cdea8ccba
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ipconv.cc
r714503 r6fc941 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ipconv.cc,v 1.2 8 2005-07-27 15:47:57Singular Exp $ */4 /* $Id: ipconv.cc,v 1.29 2006-05-29 16:10:50 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: automatic type conversions … … 17 17 #include "subexpr.h" 18 18 #include "numbers.h" 19 #include "modulop.h" 20 #include "longalg.h" 19 21 #include "matpol.h" 20 22 #include "silink.h" … … 96 98 return (void *)m; 97 99 } 100 static void * iiBI2N(void *d) 101 { 102 void *r=NULL; 103 if (rField_is_Q()) 104 r=d; 105 else 106 { 107 number n=(number)d; 108 if (rField_is_Zp()) 109 { 110 r=(void *)npMap0(n); 111 } 112 else if (rField_is_Q_a()) 113 { 114 r=(void *)naMap00(n); 115 } 116 else if (rField_is_Zp_a()) 117 { 118 r=(void *)naMap0P(n); 119 } 120 else 121 WerrorS("cannot convert bigint to this field"); 122 nlDelete(&n,NULL); 123 } 124 return r; 125 } 126 127 static void * iiN2P(void *data); 128 static void * iiBI2P(void *d) 129 { 130 void *r=iiBI2N(d); 131 if(errorreported) return NULL; 132 else return iiN2P(r); 133 } 98 134 99 135 static void * iiDummy(void *data) … … 124 160 { 125 161 number n=nInit((int)(long)data); 162 return (void *)n; 163 } 164 165 static void * iiI2BI(void *data) 166 { 167 number n=nlInit((int)(long)data); 126 168 return (void *)n; 127 169 } … … 211 253 { 212 254 // input type output type convert procedure 255 // int -> bigint 256 { INT_CMD, BIGINT_CMD, iiI2BI , NULL }, 213 257 // int -> number 214 258 { INT_CMD, NUMBER_CMD, iiI2N , NULL }, … … 229 273 // intmat -> matrix 230 274 { INTMAT_CMD, MATRIX_CMD, iiIm2Ma , NULL }, 275 // bigint -> number 276 { BIGINT_CMD, NUMBER_CMD, iiBI2N , NULL }, 277 // bigint -> poly 278 { BIGINT_CMD, NUMBER_CMD, iiBI2P , NULL }, 231 279 // number -> poly 232 280 { NUMBER_CMD, POLY_CMD, iiN2P , NULL },
Note: See TracChangeset
for help on using the changeset viewer.