Skip to content

Commit

Permalink
Reformat function declarations to appease CRAN; bump to version 3; re…
Browse files Browse the repository at this point in the history
…ady for CRAN
  • Loading branch information
baddstats committed Oct 22, 2022
1 parent 62fdae7 commit eb3d273
Show file tree
Hide file tree
Showing 49 changed files with 1,367 additions and 1,154 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: spatstat.geom
Version: 2.999-999.006
Date: 2022-10-07
Version: 3.0-0
Date: 2022-10-22
Title: Geometrical Functionality of the 'spatstat' Family
Authors@R: c(person("Adrian", "Baddeley",
role = c("aut", "cre"),
Expand All @@ -22,8 +22,8 @@ Authors@R: c(person("Adrian", "Baddeley",
person("Dominic", "Schuhmacher", role = "ctb"),
person("Rasmus", "Waagepetersen", role = "ctb"))
Maintainer: Adrian Baddeley <[email protected]>
Depends: R (>= 3.5.0), spatstat.data (>= 2.2-0.003), stats, graphics, grDevices, utils, methods
Imports: spatstat.utils (>= 2.3-1.003), deldir (>= 1.0-2), polyclip (>= 1.10-0)
Depends: R (>= 3.5.0), spatstat.data (>= 3.0), stats, graphics, grDevices, utils, methods
Imports: spatstat.utils (>= 3.0), deldir (>= 1.0-2), polyclip (>= 1.10-0)
Suggests: spatstat.random, spatstat.explore, spatstat.model, spatstat.linnet, maptools (>= 0.9-9), spatial, fftwtools (>= 0.9-8), spatstat (>= 2.0-0)
Additional_repositories: https://spatstat.r-universe.dev
Description: Defines spatial data types and supports geometrical operations
Expand Down
8 changes: 7 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
CHANGES IN spatstat.geom VERSION 2.999-999.006
CHANGES IN spatstat.geom VERSION 3.0-0

OVERVIEW

o Minor improvements and bug fixes.

o Changes to package dependence

NEW FUNCTIONS

o is.linnet
Expand All @@ -14,6 +16,10 @@ NEW FUNCTIONS

SIGNIFICANT USER-VISIBLE CHANGES

o Package dependence
spatstat.geom now suggests the new packages spatstat.explore and
spatstat.model, which have replaced spatstat.core.

o crosspairs.ppp
New argument 'periodic' specifies whether to use
periodic (toroidal) distances.
Expand Down
2 changes: 1 addition & 1 deletion inst/doc/packagesizes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ date version nhelpfiles nobjects ndatasets Rlines srclines
"2021-12-10" "2.3-1" 440 1176 0 34643 15173
"2022-02-12" "2.3-2" 440 1176 0 34657 15173
"2022-03-28" "2.4-0" 441 1178 0 34804 15188
"2022-10-07" "2.999-999.006" 442 1182 0 35107 15325
"2022-10-22" "3.0-0" 442 1182 0 35107 15531
3 changes: 2 additions & 1 deletion man/applynbd.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@

The format of the argument \code{current} is as follows.
If \code{X} is an unmarked point pattern, then \code{current} is a
vector of length 2 containing the coordinates of the current point.
list of length 2 with entries \code{current$x} and \code{current$y}
containing the coordinates of the current point.
If \code{X} is marked, then \code{current} is a point pattern
containing exactly one point, so that \code{current$x} is its
\eqn{x}-coordinate and \code{current$marks} is its mark value.
Expand Down
66 changes: 36 additions & 30 deletions src/areadiff.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Copyright (C) Adrian Baddeley, Ege Rubak and Rolf Turner 2001-2018
Licence: GNU Public Licence >= 2
$Revision: 1.15 $ $Date: 2018/12/18 02:43:11 $
$Revision: 1.16 $ $Date: 2022/10/20 06:36:12 $
A(x,r) = area of disc b(0,r) not covered by discs b(x_i,r) for x_i in x
Expand Down Expand Up @@ -36,15 +36,16 @@
*/

void
areadiff(rad,x,y,nn,ngrid,answer)
/* inputs */
double *rad; /* radius */
double *x, *y; /* coordinate vectors for point pattern */
int *nn; /* length of vectors x and y */
int *ngrid; /* dimensions of point-counting grid */
/* output */
double *answer; /* computed area */
{
areadiff(
/* inputs */
double *rad, /* radius */
double *x,
double *y, /* coordinate vectors for point pattern */
int *nn, /* length of vectors x and y */
int *ngrid, /* dimensions of point-counting grid */
/* output */
double *answer /* computed area */
) {
double dx, dy, xg, yg, r, r2, a2, b2, xdif, ydif;
int i, j, k, m, n, count, covered;
r = *rad;
Expand Down Expand Up @@ -107,16 +108,17 @@ areadiff(rad,x,y,nn,ngrid,answer)
/* similar function, handles multiple values of 'r' */

void
areadifs(rad,nrads,x,y,nxy,ngrid,answer)
/* inputs */
double *rad; /* vector of radii */
int *nrads; /* length of 'rads' */
double *x, *y; /* coordinate vectors for point pattern */
int *nxy; /* length of vectors x and y */
int *ngrid; /* dimensions of point-counting grid */
/* output */
double *answer; /* computed areas (vector of length 'nrads') */
{
areadifs(
/* inputs */
double *rad, /* vector of radii */
int *nrads, /* length of 'rads' */
double *x,
double *y, /* coordinate vectors for point pattern */
int *nxy, /* length of vectors x and y */
int *ngrid, /* dimensions of point-counting grid */
/* output */
double *answer /* computed areas (vector of length 'nrads') */
) {
double dx, dy, xg, yg, r, r2, a2, b2, xdif, ydif;
int i, j, k, l, m, n, nr, m0, count, covered, maxchunk;

Expand Down Expand Up @@ -199,17 +201,21 @@ areadifs(rad,nrads,x,y,nxy,ngrid,answer)
*/

void
areaBdif(rad,nrads,x,y,nxy,ngrid,x0,y0,x1,y1,answer)
areaBdif(
/* inputs */
double *rad; /* vector of radii */
int *nrads; /* length of 'rads' */
double *x, *y; /* coordinate vectors for point pattern */
int *nxy; /* length of vectors x and y */
int *ngrid; /* dimensions of point-counting grid */
double *x0,*y0,*x1,*y1; /* constraint rectangle */
/* output */
double *answer; /* computed areas (vector of length 'nrads') */
{
double *rad, /* vector of radii */
int *nrads, /* length of 'rads' */
double *x,
double *y, /* coordinate vectors for point pattern */
int *nxy, /* length of vectors x and y */
int *ngrid, /* dimensions of point-counting grid */
double *x0,
double *y0,
double *x1,
double *y1, /* constraint rectangle */
/* output */
double *answer /* computed areas (vector of length 'nrads') */
) {
double dx, dy, xg, yg, r, r2, a, a2, b2, xdif, ydif;
double xleft, xright, ylow, yhigh;
double xmin, ymin, xmax, ymax;
Expand Down
16 changes: 9 additions & 7 deletions src/bdrymask.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Copyright (C) Adrian Baddeley, Rolf Turner and Ege Rubak 2014
Licence: GPL >= 2
$Revision: 1.3 $ $Date: 2016/02/02 01:29:50 $
$Revision: 1.4 $ $Date: 2022/10/20 10:57:43 $
*/
Expand All @@ -16,12 +16,14 @@
#include <R_ext/Utils.h>
#include <math.h>

void bdrymask(nx, ny, m, b)
/* inputs */
int *nx, *ny, *m;
/* outputs */
int *b;
{
void bdrymask(
/* inputs */
int *nx,
int *ny,
int *m,
/* outputs */
int *b
) {
int Nxcol, Nyrow, Nx1, Ny1;
int i, j, mij;

Expand Down
120 changes: 73 additions & 47 deletions src/closepair.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
closepair.c
$Revision: 1.35 $ $Date: 2020/11/30 10:59:58 $
$Revision: 1.38 $ $Date: 2022/10/22 02:44:48 $
Copyright (C) Adrian Baddeley, Ege Rubak and Rolf Turner 2001-2018
Licence: GNU Public Licence >= 2
Expand Down Expand Up @@ -52,14 +52,15 @@ double sqrt();

/* count TOTAL number of close pairs */

void paircount(nxy, x, y, rmaxi, count)
/* inputs */
int *nxy; /* number of (x,y) points */
double *x, *y; /* (x,y) coordinates */
double *rmaxi; /* maximum distance */
/* output */
int *count;
{
void paircount(
/* inputs */
int *nxy, /* number of (x,y) points */
double *x,
double *y, /* (x,y) coordinates */
double *rmaxi, /* maximum distance */
/* output */
int *count
) {
int n, maxchunk, i, j, counted;
double xi, yi, rmax, r2max, dx, dy, a;

Expand Down Expand Up @@ -126,13 +127,18 @@ void paircount(nxy, x, y, rmaxi, count)
*/


void crosscount(nn1, x1, y1, nn2, x2, y2, rmaxi, count)
/* inputs */
int *nn1, *nn2;
double *x1, *y1, *x2, *y2, *rmaxi;
/* output */
int *count;
{
void crosscount(
/* inputs */
int *nn1,
double *x1,
double *y1,
int *nn2,
double *x2,
double *y2,
double *rmaxi,
/* output */
int *count
) {
int n1, n2, maxchunk, i, j, jleft, counted;
double x1i, y1i, rmax, r2max, xleft, dx, dy, a;

Expand Down Expand Up @@ -196,13 +202,14 @@ void crosscount(nn1, x1, y1, nn2, x2, y2, rmaxi, count)
*/


void duplicatedxy(n, x, y, out)
/* inputs */
int *n;
double *x, *y;
/* output */
int *out; /* logical vector */
{
void duplicatedxy(
/* inputs */
int *n,
double *x,
double *y,
/* output */
int *out /* logical vector */
) {
int m, i, j;
double xi, yi;
m = *n;
Expand All @@ -219,18 +226,26 @@ void duplicatedxy(n, x, y, out)

/* ............... fixed output length .............. */

void Fclosepairs(nxy, x, y, r, noutmax,
nout, iout, jout,
xiout, yiout, xjout, yjout, dxout, dyout, dout,
status)
/* inputs */
int *nxy, *noutmax;
double *x, *y, *r;
/* outputs */
int *nout, *iout, *jout;
double *xiout, *yiout, *xjout, *yjout, *dxout, *dyout, *dout;
int *status;
{
void Fclosepairs(
/* inputs */
int *nxy,
double *x,
double *y,
double *r,
int *noutmax,
/* outputs */
int *nout,
int *iout,
int *jout,
double *xiout,
double *yiout,
double *xjout,
double *yjout,
double *dxout,
double *dyout,
double *dout,
int *status
) {
int n, k, kmax, maxchunk, i, j;
double xi, yi, rmax, r2max, dx, dy, dx2, d2;

Expand Down Expand Up @@ -326,18 +341,29 @@ void Fclosepairs(nxy, x, y, r, noutmax,
*nout = k;
}

void Fcrosspairs(nn1, x1, y1, nn2, x2, y2, rmaxi, noutmax,
nout, iout, jout,
xiout, yiout, xjout, yjout, dxout, dyout, dout,
status)
/* inputs */
int *nn1, *nn2, *noutmax;
double *x1, *y1, *x2, *y2, *rmaxi;
/* outputs */
int *nout, *iout, *jout;
double *xiout, *yiout, *xjout, *yjout, *dxout, *dyout, *dout;
int *status;
{
void Fcrosspairs(
/* inputs */
int *nn1,
double *x1,
double *y1,
int *nn2,
double *x2,
double *y2,
double *rmaxi,
int *noutmax,
/* outputs */
int *nout,
int *iout,
int *jout,
double *xiout,
double *yiout,
double *xjout,
double *yjout,
double *dxout,
double *dyout,
double *dout,
int *status
) {
int n1, n2, maxchunk, k, kmax, i, j, jleft;
double x1i, y1i, rmax, r2max, xleft, dx, dy, dx2, d2;

Expand Down
Loading

0 comments on commit eb3d273

Please sign in to comment.