MCPcopy Create free account
hub / github.com/Singular/Singular / s_internalCopy

Function s_internalCopy

Singular/subexpr.cc:433–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431}
432
433static inline void * s_internalCopy(const int t, void *d)
434{
435 switch (t)
436 {
437 case CRING_CMD:
438 {
439 coeffs cf=(coeffs)d;
440 cf->ref++;
441 return (void*)d;
442 }
443#ifdef SINGULAR_4_2
444 case CNUMBER_CMD:
445 return (void*)n2Copy((number2)d);
446 case CPOLY_CMD:
447 return (void*)p2Copy((poly2)d);
448 case CMATRIX_CMD: // like BIGINTMAT
449#endif
450 case BIGINTMAT_CMD:
451 case BIGINTVEC_CMD:
452 return (void*)bimCopy((bigintmat *)d);
453 case BUCKET_CMD:
454 return (void*)sBucketCopy((sBucket_pt)d);
455 case INTVEC_CMD:
456 case INTMAT_CMD:
457 return (void *)ivCopy((intvec *)d);
458 case MATRIX_CMD:
459 return (void *)mp_Copy((matrix)d, currRing);
460 case SMATRIX_CMD:
461 case IDEAL_CMD:
462 case MODUL_CMD:
463 return (void *)idCopy((ideal)d);
464 case STRING_CMD:
465 return (void *)omStrDup((char *)d);
466 case PACKAGE_CMD:
467 return (void *)paCopy((package) d);
468 case PROC_CMD:
469 return (void *)piCopy((procinfov) d);
470 case POLY_CMD:
471 case VECTOR_CMD:
472 return (void *)pCopy((poly)d);
473 case INT_CMD:
474 return d;
475 case NUMBER_CMD:
476 return (void *)nCopy((number)d);
477 case BIGINT_CMD:
478 return (void *)n_Copy((number)d, coeffs_BIGINT);
479 case MAP_CMD:
480 return (void *)maCopy((map)d, currRing);
481 case LIST_CMD:
482 return (void *)lCopy((lists)d);
483 case LINK_CMD:
484 return (void *)slCopy((si_link) d);
485 case RING_CMD:
486 {
487 ring r=(ring)d;
488 if (r!=NULL)
489 {
490 rIncRefCnt(r);

Callers 3

CopyMethod · 0.85
CopyDMethod · 0.85
CopyAMethod · 0.85

Calls 15

n2CopyFunction · 0.85
p2CopyFunction · 0.85
bimCopyFunction · 0.85
sBucketCopyFunction · 0.85
ivCopyFunction · 0.85
mp_CopyFunction · 0.85
idCopyFunction · 0.85
paCopyFunction · 0.85
piCopyFunction · 0.85
n_CopyFunction · 0.85
maCopyFunction · 0.85
lCopyFunction · 0.85

Tested by

no test coverage detected