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

Function rDefault

Singular/ipshell.cc:1643–1696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1641}
1642
1643idhdl rDefault(const char *s)
1644{
1645 idhdl tmp=NULL;
1646
1647 if (s!=NULL) tmp = enterid(s, myynest, RING_CMD, &IDROOT);
1648 if (tmp==NULL) return NULL;
1649
1650 if (sLastPrinted.RingDependend())
1651 {
1652 sLastPrinted.CleanUp();
1653 }
1654
1655 ring r = IDRING(tmp) = (ring) omAlloc0Bin(sip_sring_bin);
1656
1657 #ifndef TEST_ZN_AS_ZP
1658 r->cf = nInitChar(n_Zp, (void*)32003); // r->cf->ch = 32003;
1659 #else
1660 mpz_t modBase;
1661 mpz_init_set_ui(modBase, (long)32003);
1662 ZnmInfo info;
1663 info.base= modBase;
1664 info.exp= 1;
1665 r->cf=nInitChar(n_Zn,(void*) &info);
1666 r->cf->is_field=1;
1667 r->cf->is_domain=1;
1668 r->cf->has_simple_Inverse=1;
1669 #endif
1670 r->N = 3;
1671 /*r->P = 0; Alloc0 in idhdl::set, ipid.cc*/
1672 /*names*/
1673 r->names = (char **) omAlloc0(3 * sizeof(char_ptr));
1674 r->names[0] = omStrDup("x");
1675 r->names[1] = omStrDup("y");
1676 r->names[2] = omStrDup("z");
1677 /*weights: entries for 3 blocks: NULL*/
1678 r->wvhdl = (int **)omAlloc0(3 * sizeof(int_ptr));
1679 /*order: dp,C,0*/
1680 r->order = (rRingOrder_t *) omAlloc(3 * sizeof(rRingOrder_t *));
1681 r->block0 = (int *)omAlloc0(3 * sizeof(int *));
1682 r->block1 = (int *)omAlloc0(3 * sizeof(int *));
1683 /* ringorder dp for the first block: var 1..3 */
1684 r->order[0] = ringorder_dp;
1685 r->block0[0] = 1;
1686 r->block1[0] = 3;
1687 /* ringorder C for the second block: no vars */
1688 r->order[1] = ringorder_C;
1689 /* the last block: everything is 0 */
1690 r->order[2] = (rRingOrder_t)0;
1691
1692 /* complete ring intializations */
1693 rComplete(r);
1694 rSetHdl(tmp);
1695 return currRingHdl;
1696}
1697
1698static idhdl rSimpleFindHdl(const ring r, const idhdl root, const idhdl n);
1699idhdl rFindHdl(ring r, idhdl n)

Callers 15

jjRING_PLFunction · 0.70
grammar.ccFile · 0.70
rInitFunction · 0.70
iiAssignCRFunction · 0.70
mainFunction · 0.70
ssiReadRingFunction · 0.50
minkowksiFunction · 0.50
equmabFunction · 0.50
decode_ring_rawFunction · 0.50
id_Sat_principalFunction · 0.50
TestGBEngineFunction · 0.50
TestSimpleRingArithmetcsFunction · 0.50

Calls 8

enteridFunction · 0.85
omAlloc0BinFunction · 0.85
nInitCharFunction · 0.85
omAlloc0Function · 0.85
rCompleteFunction · 0.85
rSetHdlFunction · 0.85
RingDependendMethod · 0.80
CleanUpMethod · 0.80

Tested by 15

mainFunction · 0.56
TestGBEngineFunction · 0.40
TestSimpleRingArithmetcsFunction · 0.40
TestGBEngineFunction · 0.40
TestSimpleRingArithmetcsFunction · 0.40
TestGBEngineFunction · 0.40
TestSimpleRingArithmetcsFunction · 0.40
TestGBEngineFunction · 0.40
TestSimpleRingArithmetcsFunction · 0.40
TestGBEngineFunction · 0.40
TestSimpleRingArithmetcsFunction · 0.40
TestGBEngineFunction · 0.40