Skip to content

Commit

Permalink
small changes in nn.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
doserjef committed Apr 17, 2024
1 parent 4a16cf3 commit 22bf607
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Type: Package
Title: Univariate and Multivariate Spatial Modeling of Species Abundance
Version: 0.1.3
Authors@R: c(person("Jeffrey", "Doser", role=c("aut", "cre"), email="[email protected]"), person("Andrew", "Finley", role = c("aut")))
Description: Fits single-species (univariate) and multi-species (multivariate) non-spatial and spatial abundance models in a Bayesian framework using Markov Chain Monte Carlo (MCMC). Spatial models are fit using Nearest Neighbor Gaussian Processes (NNGPs). Details on NNGP models are given in Datta, Banerjee, Finley, and Gelfand (2016) <doi:10.1080/01621459.2015.1044091> and Finley, Datta, and Banerjee (2020) <doi:10.18637/jss.v103.i05>. Fits single-species and multi-species spatial and non-spatial versions of generalized linear mixed models (Gaussian, Poisson, Negative Binomial), N-mixture models (Royle 2004 <doi:10.1111/j.0006-341X.2004.00142.x>) and hierarchical distance sampling models (Royle, Dawson, Bates (2004) <doi:10.1890/03-3127>). Multi-species spatial models are fit using a spatial factor modeling approach with NNGPs for computational efficiency.
Description: Fits single-species (univariate) and multi-species (multivariate) non-spatial and spatial abundance models in a Bayesian framework using Markov Chain Monte Carlo (MCMC). Spatial models are fit using Nearest Neighbor Gaussian Processes (NNGPs). Details on NNGP models are given in Datta, Banerjee, Finley, and Gelfand (2016) <doi:10.1080/01621459.2015.1044091> and Finley, Datta, and Banerjee (2022) <doi:10.18637/jss.v103.i05>. Fits single-species and multi-species spatial and non-spatial versions of generalized linear mixed models (Gaussian, Poisson, Negative Binomial), N-mixture models (Royle 2004 <doi:10.1111/j.0006-341X.2004.00142.x>) and hierarchical distance sampling models (Royle, Dawson, Bates (2004) <doi:10.1890/03-3127>). Multi-species spatial models are fit using a spatial factor modeling approach with NNGPs for computational efficiency.
License: GPL (>= 3)
Encoding: UTF-8
LazyData: true
Expand Down
6 changes: 4 additions & 2 deletions src/nn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,10 @@ extern "C" {

int i, iNNIndx, iNN;

int *sIndx = new int[n];
double *u = new double[n];
// int *sIndx = new int[n];
// double *u = new double[n];
int *sIndx = (int *) R_alloc(n, sizeof(int));
double *u = (double *) R_alloc(n, sizeof(double));

for(i = 0; i < n; i++){
sIndx[i] = i;
Expand Down

0 comments on commit 22bf607

Please sign in to comment.