Installation

Pre-requisites

In order to use this library, it is necessary to install these additional packages:

Voro++

Voro++ is a library for carrying out three-dimensional computations of the Voronoi tessellation, needed by several darkmix functions. To install it, follow the instructions in their website.

Additional R packages

A few additional R packages are needed to run the darkmix code. These can be installed from within R using:

packages <- c("spatstat", "spatstat.utils", "LaplacesDemon", "expint", "plotrix", "misc3d", "moments")
install.packages(packages)

Compiling the code

The darkmix consists of a series of functions contained in darkmix.R that can be directly loaded and used locally. These functions rely on a series of C++ programmes that should be previously compiled.

After downloading and unpacking the code, access the Code folder:

cd PATH/darkmix/Code

A Makefile has been created for convenience. Modify it if any change is needed for your local configuration, and compile the code using:

make all

Note

Note that the kernel_lambda.cpp programme is parallelised using OpenMP. If your compiler does not support this option, just change the corresponding line in the Makefile to

CFLAGS_OPENMP =

This should create the three needed executables: kernel_lambda, kernel_absolute_residuals and kernel_fourier_residuals.

R setup

Once the code is compiled, to use the darkmix functions from within R, we need to set the working directory and load the darkmix.R functions:

setwd("~/PATH/darkmix/")
source("Code/darkmix.R")