| 138 | //} |
| 139 | |
| 140 | void *idrecDataInit(int t) |
| 141 | { |
| 142 | switch (t) |
| 143 | { |
| 144 | //the type with init routines: |
| 145 | #ifdef SINGULAR_4_2 |
| 146 | case CNUMBER_CMD: |
| 147 | return (void*)n2Init(0,NULL); |
| 148 | case CPOLY_CMD: |
| 149 | return (void*)p2Init(0,NULL); |
| 150 | case CMATRIX_CMD: |
| 151 | #endif |
| 152 | case BIGINTMAT_CMD: |
| 153 | return (void *)new bigintmat(); |
| 154 | case BIGINTVEC_CMD: |
| 155 | return (void *)new bigintmat(1,0,coeffs_BIGINT); |
| 156 | case BUCKET_CMD: |
| 157 | if (currRing!=NULL) |
| 158 | return (void*)sBucketCreate(currRing); |
| 159 | else |
| 160 | { |
| 161 | WerrorS("need basering for polyBucket"); |
| 162 | return NULL; |
| 163 | } |
| 164 | case INTVEC_CMD: |
| 165 | case INTMAT_CMD: |
| 166 | return (void *)new intvec(); |
| 167 | case NUMBER_CMD: |
| 168 | { |
| 169 | if (currRing!=NULL) return (void *) nInit(0); |
| 170 | else return NULL; |
| 171 | } |
| 172 | case BIGINT_CMD: |
| 173 | return (void *) n_Init(0, coeffs_BIGINT); |
| 174 | case IDEAL_CMD: |
| 175 | case MODUL_CMD: |
| 176 | case MATRIX_CMD: |
| 177 | case SMATRIX_CMD: |
| 178 | return (void*) idInit(1,1); |
| 179 | case MAP_CMD: |
| 180 | { |
| 181 | map m = (map)idInit(1,1); |
| 182 | m->preimage = omStrDup(IDID(currRingHdl)); |
| 183 | return (void *)m; |
| 184 | } |
| 185 | case STRING_CMD: |
| 186 | return (void *)omAlloc0(1); |
| 187 | case LIST_CMD: |
| 188 | { |
| 189 | lists l=(lists)omAllocBin(slists_bin); |
| 190 | l->Init(); |
| 191 | return (void*)l; |
| 192 | } |
| 193 | //the types with the standard init: set the struct to zero |
| 194 | case LINK_CMD: |
| 195 | return (void*) omAlloc0Bin(sip_link_bin); |
| 196 | case PACKAGE_CMD: |
| 197 | { |
no test coverage detected