Index and notes for C++ code used in Avoidance project

These pages are provided for those that would like to peruse the organisation and details of the C++ code used in two projects: simulating the Conditioned Avoidance Response (CAR) and its variants; and Expectation-Minimisation analysis of mathematical models of the Beads-in-a-Jar task. The latter uses experimental data from Corcoran et al 2008 (Corcoran, R., Rowse, G., Moore, R., Blackwood, N., Kinderman, P., Howard, R., et al. (2008). A transdiagnostic investigation of 'theory of mind' and 'jumping to conclusions' in patients with persecutory delusions. Psychol Med, 38(11), 1577-83).

The files provided are basically plain text, with a bit of html "top and tail" code, so that they can be easily perused, downloaded and then copy-pasted as desired. I have therefore made no attempt to alter C++ text features (such as angle brackets) that html doesn't render well, so you may want to refer to the page source code for details such as some matrix object declarations or include files. These projects also used auxiliary code (e.g. for error messages or vector manipulation), especially for the Condioned Avoidance simulations; the code for these is either mine or was taken from "Numerical Recipes in C" (Press et al, 1988) and "Scientific C++" (Buzzi-Ferraris, 1993) and are not included here. The Numerical Recipes and Scientific C++ code has been superseded by the Blitz++ libraries that were used a lot more extensively, especially in the Beads-in-a-Jar / Jumping to Conclusions projects; If you would like to compile the code provided here please get in touch with me about the auxiliary code. All my own code is provided under the GNU General Public License (GPL).


  1. Examples of Makefiles used.

  2. Header files

  3. Methods files