[GAP Forum] ADD_TO_LIST_ENTRIES_PLIST_RANGE

Steve Linton sal at dcs.st-and.ac.uk
Wed Aug 30 19:53:49 BST 2006


Dear GAP Forum,

On Wed, 30 Aug 2006 12:20:09 EDT
KnDMcT at aol.com wrote:

>  
> I sent the following question to support at gap-system.org yesterday, but  it 
> bounced back as undeliverable. Can anyone on the forum mail list help?

Sorry about the bounce, we have had some problems with our mail server.

>  
> Is it possible to get a brief description of the GAP function  
> ADD_TO_LIST_ENTRIES_PLIST_RANGE which occurs in the FactInt package file  mpqs.gi as:
>  
>        ADD_TO_LIST_ENTRIES_PLIST_RANGE
> (Sieve,[Pos1,Pos1 + qi..Pos1 +  RangeTable[i]],-Weight);
> if   Pos2  <> Pos1 
> then  ADD_TO_LIST_ENTRIES_PLIST_RANGE
> (Sieve,[Pos2,Pos2 + qi..Pos2 + RangeTable[i]],-Weight); fi;
>  
> I'm trying to decipher this call and have been unable to locate anything in  
> the manual or on the GAP web site. I assume that it manipulates the first  
> argument which is a list of integers, but can find no documentation. The second  
> argument appears to be a list of indices into the first argument, but I have 
> no  clue what the third argument is.
>  
> Thanks,
>  
> Doug McTavish
> GAP novice
> 

First a couple of warnings. This function is undocumented, meaning that it
might be removed or changed in a future release of GAP, and its name is all in
capitals, which is almost always a clue that something is an internal
function not really intended for public use. Such functions may, for
performance reasons, do things like not checking their arguments but crashing
or corrupting the GAP session if called with the wrong types of arguments.

You have been warned.

In fact ADD_TO_LIST_ENTRIES_LIST_RANGE( <list>, <range>, <value> )
will, provided that <list> is a plain list, <range> a range and <value> a
small integer (between -2^28 and 2^28-1 on 32 bit systems) do the same as the
GAP loop

for i in <range> do
	<list>[i] := <list>[i]+<value>;
od;

but faster.


	Steve

-- 
Steve Linton	School of Computer Science  &
      Centre for Interdisciplinary Research in Computational Algebra
	     University of St Andrews 	 Tel   +44 (1334) 463269
http://www.dcs.st-and.ac.uk/~sal	 Fax   +44 (1334) 463278   



More information about the Forum mailing list