Files
mercury/extras/monte/doit.m
Zoltan Somogyi 07a0dc8937 Add the files of this example program.
Estimated hours taken: 0.1
Branches: main

extras/monte/*:
	Add the files of this example program.
2010-08-09 02:25:50 +00:00

34 lines
944 B
Mathematica

%-----------------------------------------------------------------------------%
% vim: ft=mercury ts=4 sw=4 et
%-----------------------------------------------------------------------------%
% Copyright (C) 2010 The University of Melbourne.
% This file may only be copied under the terms of the GNU General
% Public License - see the file COPYING in the Mercury distribution.
%-----------------------------------------------------------------------------%
:- module doit.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
:- import_module hg.
:- import_module geom.
:- import_module monte.
:- import_module rnd.
:- import_module float.
:- import_module int.
:- import_module list.
:- import_module string.
main(!IO) :-
NumPoints = 1000000,
monte(hgBox, hg, NumPoints, Volume),
io.format("The computed volume after testing %d points is %f\n",
[i(NumPoints), f(Volume)], !IO).