Post a reply
Username:
Note:If not registered, provide any username. For more comfort, register here.
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) :( :o :shock: :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen:
Font size:
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation of post
To prevent automated posts the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.
Confirmation code:
Enter the code exactly as it appears. All letters are case insensitive, there is no zero.
   

Topic review - A question about the C interface
Author Message
  Post subject:  Re: A question about the C interface  Reply with quote
Each sequence of pSetExp/p_SetExp/p_SetExpV/p_SetExpVL
mut be followed by pSetm/p_Setm,
and kStd is better called with default arguments:
Code:
...
// create the polynomial 3x^2y^2-2xy^3+3x^2
p1 = p_ISet(3,R);
pSetExp(p1,1,2);
pSetExp(p1,2,2);
pSetm(p1);
p2 = p_ISet(-2,R);
pSetExp(p2,1,1);
pSetExp(p2,2,3);
pSetm(p2);
p1 = p_Add_q(p1, p2, R);
p2 = p_ISet(3,R);
pSetExp(p2,1,2);
pSetm(p2);
p1 = p_Add_q(p1, p2, R);
...
J = kStd(I, NULL, testHomog, NULL);
....
Post Posted: Fri Aug 17, 2018 3:51 pm
  Post subject:  Re: A question about the C interface  Reply with quote
I tried a minimal example for kStd and I didn't get the same answer the interpreter gives. What am I doing wrong? Is it one of the parameters of kStd?

Thanks!

char **nm=(char**)omalloc(3*sizeof(char*));
nm[0]=omStrDup("x");
nm[1]=omStrDup("y");
nm[2]=omStrDup("z");

R=rDefault(0,3,nm);
rChangeCurrRing(R);

// create the polynomial 3x^2y^2-2xy^3+3x^2
p1 = p_ISet(3,R);
pSetExp(p1,1,2);
pSetExp(p1,2,2);
p2 = p_ISet(-2,R);
pSetExp(p2,1,1);
pSetExp(p2,2,3);
p1 = p_Add_q(p1, p2, R);
p2 = p_ISet(3,R);
pSetExp(p2,1,2);
p1 = p_Add_q(p1, p2, R);

// 2x^3y-3x^2y^2+3y^2
p2 = p_ISet(2, R);
pSetExp(p2, 1, 3);
pSetExp(p2, 2, 1);
p3 = p_ISet(-3, R);
pSetExp(p3, 1, 2);
pSetExp(p3, 2, 2);
p2 = p_Add_q(p2, p3, R);
p3 = p_ISet(3, R);
pSetExp(p3, 2, 2);
p2 = p_Add_q(p2, p3, R);

// 2z
p3 = p_ISet(2,R);
pSetExp(p3, 3, 1);

I=idInit(3);
id_InsertPolyWithTests(I, 0, p1, true, true, R);
id_InsertPolyWithTests(I, 1, p2, true, true, R);
id_InsertPolyWithTests(I, 2, p3, true, true, R);

J = kStd(I, NULL, testHomog, NULL, NULL, 0, 0, NULL);
for ( int i = 0; i < idSize(J); i++ )
pWrite(J->m[i]);
Post Posted: Fri Aug 17, 2018 3:00 am
  Post subject:  Re: A question about the C interface  Reply with quote
kStdFac: no, it does not (always) return the irreducible decomposition of an ideal;
it returns a decomposition of the radical (the components need not be irreducible),
which often is already a irreducible decomposition of the radical.
See http://www.singular.uni-kl.de/Manual/4-1-1/sing_240.htm
To get a complete decomposition, use minAssGTZ from primdec.lib

std: corresponds to kStd, see
https://www.singular.uni-kl.de/dox/html/kstd1_8h.html
(for the interface, see jjSTD,
https://www.singular.uni-kl.de/dox/html ... fd713db194
)

dim: corresponds to scDimInt

doxygen-documentation:
https://www.singular.uni-kl.de/dox/html/
Post Posted: Wed Aug 15, 2018 2:36 pm
  Post subject:  A question about the C interface  Reply with quote
Dear all,

I'm trying to solve a system of polynomial equation via the singular C interface (the polynomials I need are quite complicated to generate, and I already have the code to do it in C). I created an ideal which describes the variety of solutions and called kStdfac and got a list of irreducible components (right?). Now I need to find out the dimensions of the components and get the point (if zero) or a simple description of the component (if non-zero, I conjecture all non-zero components are simple x=y, z=w style components).

So, what's the C equivalent of the "std" and "dim" interface commands?

Thanks a lot!

P.S. Is the C interface documented anywhere?
P.P.S. My request to register has been unanswered for a week :cry:
Post Posted: Wed Aug 15, 2018 12:07 pm


It is currently Fri May 13, 2022 10:59 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group