´

m_skn_mp

synopsis: INT m_skn_mp( OP s,k,n,e)

description:

Make a monopoly whose self is s, coefficient is k and next is n. b_skn_mp uses the objects supplied as arguments, while m_skn_mp uses copies of them.

return:

OK or ERROR (!)

example:

 Making the monopoly corresponding to -1 * x : 10 + 4 * x : 17.
 It is assumed that all OP identifiers point to objects created by callocobject.

 (1)
 m_i_i(17L,b);
 m_i_i(4L,c);
 b_skn_mp(b,c,d,a);
 b = callocobject(); /* need new objects for these pointers */
 c = callocobject();
 m_i_i(10L,b);
 m_i_i(-1L,c);
 b_skn_mp(b,c,NULL,d); /* at this stage the monopoly is complete */

 The statement 'println(a);' causes the output 4 17 -1 10

 The statement 'objectwrite(stdout,a);' causes the output where, for convenience,
 some lines have been joined and the components have been annotated:
 126 1 21 1 4 1 17 1
 MONOPOLY nonNULL MONOM INTEGER   value INTEGER   value more terms
 126 1 21 1 -1 1 10 0
 MONOPOLY nonNULL MONOM INTEGER   value INTEGER   value no more terms

 (2) The following creates the same monopoly, the insert routine carries
 out some sorting.

 init(MONOPOLY,a);
 m_i_i(10L,b);
 m_i_i(-1L,c);
 h = callocobject();
 m_sk_mo(b,c,h);
 insert(h,a,add_koeff,NULL);
 m_i_i(17L,b);
 m_i_i(4L,c);
 h = callocobject();
 m_sk_mo(b,c,h);
 insert(h,a,add_koeff,NULL);

 The statement 'println(a);' causes the output -1 10 4 17

 The statement 'objectwrite(stdout,a);' causes the output:ce,
 126 1 21 1 -1 1 10 1 126 1 21 1 4 1 17 0


Send comments or suggestions to:
symmetrica (at) symmetrica.de

this page was automatically generated on So Jan 4 10:35:30 CET 2009 on the machine btn6xf

University of Bayreuth -