/* ========================================================================== simple.c -- a simple auxiliary program for use with the amcmc package Copyright (c) 2007 by Jeffrey S. Rosenthal (probability.ca/jeff) Instructions for use at: probability.ca/amcmc Licensed for general copying, distribution and modification according to the GNU General Public License (www.gnu.org/copyleft/gpl.html). ========================================================================== */ #include /* Define the dimension to be 1: */ int mydim() { return(1); } /* Define the functional to be the square of the first coordinate: */ double myfunctional( double *theargs ) { return( theargs[0] * theargs[0] ); } /* Define the target density to be of the form: C e^(-x^2 / 2) */ double mydensity( double *theargs ) { return( exp( - theargs[0] * theargs[0] / 2 ) ); }