https://github.com/cran/spatstat
Raw File
Tip revision: 32c7daeb36b6e48fd0356bdcec9580ae124fee5e authored by Adrian Baddeley on 29 December 2015, 22:08:27 UTC
version 1.44-1
Tip revision: 32c7dae
chunkloop.h
/*
  chunkloop.h

  Divide a loop into chunks 

  Convenient for divide-and-recombine,
  and reducing calls to R_CheckUserInterrupt, etc.

  $Revision: 1.2 $  $Date: 2013/05/27 02:09:10 $
  
*/

#define OUTERCHUNKLOOP(IVAR, LOOPLENGTH, ICHUNK, CHUNKSIZE) \
  IVAR = 0; \
  ICHUNK = 0; \
  while(IVAR < LOOPLENGTH) 

#define INNERCHUNKLOOP(IVAR, LOOPLENGTH, ICHUNK, CHUNKSIZE) \
    ICHUNK += CHUNKSIZE; \
    if(ICHUNK > LOOPLENGTH) ICHUNK = LOOPLENGTH; \
    for(; IVAR < ICHUNK; IVAR++) 

#define XOUTERCHUNKLOOP(IVAR, ISTART, IEND, ICHUNK, CHUNKSIZE) \
  IVAR = ISTART; \
  ICHUNK = 0; \
  while(IVAR <= IEND) 

#define XINNERCHUNKLOOP(IVAR, ISTART, IEND, ICHUNK, CHUNKSIZE)	\
    ICHUNK += CHUNKSIZE; \
    if(ICHUNK > IEND) ICHUNK = IEND; \
    for(; IVAR <= IEND; IVAR++) 

#define CHUNKLOOP_H




back to top