Read-only forum archive

Some questions

Some questions

Hossein Movasati · Thu Aug 11, 2005 5:33 pm

Hi

I have written some proceedures and I have observed that
they work well when I restart Singular; Otherwise they just
start doing something and when I want to interupt them then I get:

//**Interupt at cmd: $INVALID$ in line .....

and some times

//**Interupt at cmd: return(aa) ....

(In aa there is no calculations going on; it contains a polynomial)


Another Question: If inside a proceedure one wants
to add a new parameter to the basering (outside the proceedure)
and do some calculations and then export some data
(without containing the new parameter) to the basering,
which combination of commands one must use?


Bests
.

email: movasati@mathematik.tu-darmstadt.de
Posted in old Singular Forum on: 2005-08-03 09:37:31+02

Some questions

lossen · Tue Oct 04, 2005 2:27 pm

Dear Hossein,

concerning your second question, you should try something like this:

Code:
proc testp (poly p)
{
  def BR = basering;
 
  // Set up new ring and make it the active ring:
  //====================================
  list L = ringlist(basering);
  int s = size(L[2]);   // number of variables
  L[2][s+1] = "@t";     // add new variable with name @t
  int m = size(L[3]);   // number of blocks in def. of ordering
  L[3][m+1] = list("lp",intvec(1));  // implement product ordering
  def newRing = ring(L);
  setring newRing;

  // Compute in the new basering:
  //=========================
  ideal I = @t^2*imap(BR,p), @t^2+var(1)+var(2);
  I = eliminate(I,@t);  // output does not depend on @t
             
  // Transfer results to the previous basering:
  //==================================
  setring BR;
  ideal I = imap(newRing,I);

  return(I);
}


Christoph Lossen
(SINGULAR Team)

Some questions

hannes · Fri Nov 11, 2005 4:31 pm

Concerning your first question:
factorize and therefor commands using factorize run sometimes into an infinite
loop:
Solution: update to version 3-0-1.