Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.maple > #238

Re: Supressing Set statements

From Joe Riel <joer@san.rr.com>
Newsgroups comp.soft-sys.math.maple
Subject Re: Supressing Set statements
Date 2011-09-16 15:41 -0700
Organization A noiseless patient Spider
Message-ID <87ty8c2jqi.fsf@san.rr.com> (permalink)
References <1316204866.109484@athprx04>

Show all headers | View raw


"I.N. Galidakis" <morpheus@olympus.mons> writes:

> Hi everyone,
>
> Does anyone know how to suppress set statements on the output?
>
> I have the following declarations in Maple 9:
>
> E:={}:#board encodings
>
> and later on, in a procedure, I augment E by the current board encoding:
>
>> move:=proc(p,q,n,c1,r1,c2,r2)
>> global E;
>> if p[c1,r1]<>[] then
>>  if n<>0 then rotate(p,c1,r1,n);fi;
>>  if fits(p,q,c1,r1,c2,r2) then
>>   q[c2,r2]:=p[c1,r1];#set to puzzle
>>   p[c1,r1]:=[];#remove from board
>>   print("moving:",n,c1,r1,"->",c2,r2);
>>   stack[push]([n,c1,r1,c2,r2], S);#push into stack of moves
>>   E:=E union {enc(q)}:#add new state to set of states
>>  else
>>   print("Illegal move!");
>>  fi;
>> else
>>  print("Source is empty!");
>> fi;
>> end:
>
> In my loop, I call:
>
>> while pef(q)<202 do
>> gen(p,q);#creates G
>>  while G=[] do
>>   undo(p,q):
>>   gen(p,q):
>>  od;
>>  bm:=pick(p,q):
>>  while bm=0 do
>>   undo(p,q):
>>   gen(p,q):
>>   bm:=pick(p,q):
>>  od;
>>  #print("Picking move in G:",bm,nops(NE));
>>  #print("Generated:",G);print("New States:",NE);
>>  move(p,q,G[bm][1],G[bm][2],G[bm][3],G[bm][4],G[bm][5]):
>> od;
>
> When I run the above loop, I get a repeated and growing set E on the output,
> DESPITE having supressed all statements relating to E, which I don't want to see
> (unless I am debugging) because it contains very big numbers, is very big in
> size and slows Maple down a lot, because this is a puzzle search, so it can take
> zillions of tries.
>
> How can I suppress the output of the set E?
>
> Maybe if I declare it as something else? A list?

A colon as line terminator to suppress output only has an effect
at the outermost level.  Here you would suppress all output in the
loop by terminating the final 'od' with a colon.  The colons 
on the statements inside the loop might as well be semicolons.


-- 
Joe Riel

Back to comp.soft-sys.math.maple | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Supressing Set statements "I.N. Galidakis" <morpheus@olympus.mons> - 2011-09-16 23:27 +0300
  Re: Supressing Set statements Joe Riel <joer@san.rr.com> - 2011-09-16 15:41 -0700
    Re: Supressing Set statements "I.N. Galidakis" <morpheus@olympus.mons> - 2011-09-17 02:13 +0300
  Re: Supressing Set statements Philo D <doozy@earthling.net.invalid> - 2011-09-17 07:54 -0600

csiph-web