Initial import of new "mcsim" package:

Monte Carlo Simulation software
This commit is contained in:
jtb 2000-11-26 23:02:38 +00:00
parent c967d1056f
commit 8f86379ecf
11 changed files with 433 additions and 0 deletions

33
math/mcsim/Makefile Normal file
View file

@ -0,0 +1,33 @@
# $NetBSD: Makefile,v 1.1.1.1 2000/11/26 23:02:38 jtb Exp $
DISTNAME= mcsim-4.2.0
CATEGORIES= math
MASTER_SITES= ${MASTER_SITE_GNU:=mcsim/}
MAINTAINER= jtb@netbsd.org
WRKSRC= ${WRKDIR}/mcsim
INFO_FILES= mcsim
do-build:
@(cd ${WRKSRC}/mod && ${MAKE})
@(cd ${WRKSRC}/sim && ${MAKE})
@(cd ${WRKSRC}/sim && ${SH} Test_mcsim)
@(cd ${WRKSRC}/doc && makeinfo mcsim.texinfo)
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/mod/mod ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/sim/mcsim ${PREFIX}/bin
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/mcsim
@(cd ${WRKSRC}/doc; \
for i in *.txt MCSim* mcsim.html mcsim.dvi; \
do \
${INSTALL_DATA} $$i ${PREFIX}/share/doc/mcsim; \
done; \
for i in mcsim mcsim-1 mcsim-2 mcsim-3; \
do \
${INSTALL_DATA} $$i ${PREFIX}/info; \
done)
.include "../../mk/bsd.pkg.mk"

3
math/mcsim/files/md5 Normal file
View file

@ -0,0 +1,3 @@
$NetBSD: md5,v 1.1.1.1 2000/11/26 23:02:38 jtb Exp $
MD5 (mcsim-4.2.0.tar.gz) = 57ca9e1f7e372d927baaf19c03e927fe

View file

@ -0,0 +1,7 @@
$NetBSD: patch-sum,v 1.1.1.1 2000/11/26 23:02:38 jtb Exp $
MD5 (patch-aa) = 32c8f56563c90a1486d6e75dbfa5069c
MD5 (patch-ab) = 7a65c756c0b1a7f6d822371e3ecdcb41
MD5 (patch-ac) = e4ff78054d3d3e5f40df928f5a9ae8c6
MD5 (patch-ad) = 1f6434b5a36da5e9667392d7c959d221
MD5 (patch-ae) = 9d6b9d9fdc1bd9e4ed0c0fad0cfdbb1a

View file

@ -0,0 +1,20 @@
$NetBSD: patch-aa,v 1.1.1.1 2000/11/26 23:02:38 jtb Exp $
--- doc/mcsim.texinfo.orig Sat Nov 15 02:14:40 1997
+++ doc/mcsim.texinfo
@@ -1,10 +1,14 @@
\input texinfo @c -*-texinfo-*-
@comment %**start of header (This is for running Texinfo on a region.)
-@setfilename mcsimdoc
+@setfilename mcsim
@settitle MCSim User' Manual
@setchapternewpage odd
@comment %**end of header (This is for running Texinfo on a region.)
+@dircategory Monte Carlo Simulation
+@direntry
+* MCSim: (mcsim). A Monte Carlo Simulation Program.
+@end direntry
@comment the following is just for the texinfo file
@ifinfo

View file

@ -0,0 +1,31 @@
$NetBSD: patch-ab,v 1.1.1.1 2000/11/26 23:02:38 jtb Exp $
--- mod/Makefile.orig Wed Nov 22 22:39:24 2000
+++ mod/Makefile
@@ -97,8 +97,8 @@
#
#>>>> Define the COMPILER name and LINKER name here only.
-CC = gcc
-LINK = gcc
+#CC =
+LINK = $(CC)
#>>>> Define PATHS
# The include path should be a directory containing header
@@ -137,13 +137,13 @@
#>>>> To compile with OPTIMIZATION uncomment the following lines
#
DEBUG_SYMBOLS = -DNDEBUG
-C_OPTIM_FLAG = -O
+C_OPTIM_FLAG = -O2
L_OPTIM_FLAG =
#
#>>>> Include any special warning flags
#
-WARNINGS = -Wall
+WARNINGS = -ansi
#--------------------
#**** You shouldn't need to change these lines. They are dependent

View file

@ -0,0 +1,31 @@
$NetBSD: patch-ac,v 1.1.1.1 2000/11/26 23:02:39 jtb Exp $
--- sim/Makefile.orig Wed Nov 22 22:41:05 2000
+++ sim/Makefile
@@ -62,8 +62,8 @@
#
#>>>> Define the COMPILER name and LINKER name here only.
-CC = gcc
-LINK = gcc
+#CC = gcc
+LINK = $(CC)
#>>>> Define PATHS
# The include path should be a directory containing header
@@ -101,13 +101,13 @@
#>>>> To compile with OPTIMIZATION uncomment the following lines
#
DEBUG_SYMBOLS = -DNDEBUG
-C_OPTIM_FLAG = -O
+C_OPTIM_FLAG = -O2
L_OPTIM_FLAG =
#
#>>>> Include any special warning flags
#
-WARNINGS = -Wall -ansi
+WARNINGS = -ansi
#--------------------
#**** You shouldn't need to change the next 2 lines. They are dependent

View file

@ -0,0 +1,22 @@
$NetBSD: patch-ad,v 1.1.1.1 2000/11/26 23:02:39 jtb Exp $
--- sim/sim.c.orig Wed Nov 22 22:45:45 2000
+++ sim/sim.c
@@ -653,7 +653,7 @@
scanf ("%[^:\f\r\v\n]", *pszFileIn);
getchar();
#else
- gets (*pszFileIn);
+ fgets (*pszFileIn, sizeof(*pszFileIn), stdin);
*pszFileIn = strtok (*pszFileIn, " \t");
#endif
@@ -665,7 +665,7 @@
#ifdef _MACOSLEVEL1_
scanf ("%[^:\f\r\v\n]", *pszFileOut);
#else
- gets (*pszFileOut);
+ fgets (*pszFileOut, sizeof(pszFileOut), stdin);
*pszFileOut = strtok (*pszFileOut, " \t");
#endif
}

259
math/mcsim/patches/patch-ae Normal file
View file

@ -0,0 +1,259 @@
$NetBSD: patch-ae,v 1.1.1.1 2000/11/26 23:02:41 jtb Exp $
--- sim/Test_mcsim.orig Fri Nov 14 15:45:56 1997
+++ sim/Test_mcsim
@@ -1,147 +1,147 @@
# Run diagnostic tests on several features of the program.
# results are compared to prepared files.
-one:
- @echo
- @echo ----------
- @echo
- @echo '* Testing MCSim: this could take a few minutes.'
- @echo '* Creating logfile mcsim.log'
- @touch mcsim.log
- @date >> mcsim.log
-#
- @echo
- @echo ----------
- @echo
- @echo Testing with the tetrachloroethylene model
- @mod perc.model
- @gcc -I . -Wall -ansi -c model.c -o model.o > /dev/null
- @gcc -o mcsim *.o -lm
- @echo
+#one:
+ echo
+ echo ----------
+ echo
+ echo '* Testing MCSim: this could take a few minutes.'
+ echo '* Creating logfile mcsim.log'
+ touch mcsim.log
+ date >> mcsim.log
+#
+ echo
+ echo ----------
+ echo
+ echo Testing with the tetrachloroethylene model
+ ../mod/mod perc.model
+ cc -I . -Wall -ansi -c model.c -o model.o > /dev/null
+ cc -o mcsim *.o -lm
+ echo
#
# perc.lsodes.in
- @echo Testing Lsodes with perc.lsodes.in ...
- @chmod -w perc.lsodes.in perc.lsodes.out
- @mcsim perc.lsodes.in sim.out >> mcsim.log
- @(diff sim.out perc.lsodes.out > .tmp) && echo '-PASSED-'
+ echo Testing Lsodes with perc.lsodes.in ...
+ chmod -w perc.lsodes.in perc.lsodes.out
+ ./mcsim perc.lsodes.in sim.out >> mcsim.log
+ (diff sim.out perc.lsodes.out > .tmp) && echo '-PASSED-'
#
# perc.ndoses.in
- @echo Testing NDoses with perc.ndoses.in ...
- @chmod -w perc.ndoses.in perc.ndoses.out
- @mcsim perc.ndoses.in sim.out >> mcsim.log
- @(diff sim.out perc.ndoses.out > .tmp) && echo '-PASSED-'
+ echo Testing NDoses with perc.ndoses.in ...
+ chmod -w perc.ndoses.in perc.ndoses.out
+ ./mcsim perc.ndoses.in sim.out >> mcsim.log
+ (diff sim.out perc.ndoses.out > .tmp) && echo '-PASSED-'
#
# perc.mtc.in
- @echo Testing Monte Carlo with perc.mtc.in ...
- @chmod -w perc.mtc.in perc.mtc.out
- @mcsim perc.mtc.in sim.out >> mcsim.log
- @(diff sim.out perc.mtc.out > .tmp) && echo '-PASSED-'
+ echo Testing Monte Carlo with perc.mtc.in ...
+ chmod -w perc.mtc.in perc.mtc.out
+ ./mcsim perc.mtc.in sim.out >> mcsim.log
+ (diff sim.out perc.mtc.out > .tmp) && echo '-PASSED-'
#
# perc.setpoint.in
- @echo Testing Set Point run with perc.setpoint.in ...
- @chmod -w perc.setpoint.dat perc.setpoint.in perc.setpoint.out
- @mcsim perc.setpoint.in sim.out >> mcsim.log
- @(diff sim.out perc.setpoint.out > .tmp) && echo '-PASSED-'
-#
- @echo
- @echo ----------
- @echo
- @echo Testing with the 1 compartment model
- @mod 1cpt.model
- @gcc -I . -Wall -ansi -c model.c -o model.o > /dev/null
- @gcc -o mcsim *.o -lm
- @echo
+ echo Testing Set Point run with perc.setpoint.in ...
+ chmod -w perc.setpoint.dat perc.setpoint.in perc.setpoint.out
+ ./mcsim perc.setpoint.in sim.out >> mcsim.log
+ (diff sim.out perc.setpoint.out > .tmp) && echo '-PASSED-'
+#
+ echo
+ echo ----------
+ echo
+ echo Testing with the 1 compartment model
+ ../mod/mod 1cpt.model
+ cc -I . -Wall -ansi -c model.c -o model.o > /dev/null
+ cc -o mcsim *.o -lm
+ echo
#
# 1cpt_no_noise.in
- @echo Testing Lsodes non random output with 1cpt_no_noise.in ...
- @chmod -w 1cpt_no_noise.in 1cpt_no_noise.out
- @mcsim 1cpt_no_noise.in sim.out >> mcsim.log
- @(diff sim.out 1cpt_no_noise.out > .tmp) && echo '-PASSED-'
+ echo Testing Lsodes non random output with 1cpt_no_noise.in ...
+ chmod -w 1cpt_no_noise.in 1cpt_no_noise.out
+ ./mcsim 1cpt_no_noise.in sim.out >> mcsim.log
+ (diff sim.out 1cpt_no_noise.out > .tmp) && echo '-PASSED-'
#
# 1cpt_w._noise.in
- @echo Testing Lsodes randomized output with 1cpt_w._noise.in ...
- @chmod -w 1cpt_w._noise.in 1cpt_w._noise.out
- @mcsim 1cpt_w._noise.in sim.out >> mcsim.log
- @(diff sim.out 1cpt_w._noise.out > .tmp) && echo '-PASSED-'
+ echo Testing Lsodes randomized output with 1cpt_w._noise.in ...
+ chmod -w 1cpt_w._noise.in 1cpt_w._noise.out
+ ./mcsim 1cpt_w._noise.in sim.out >> mcsim.log
+ (diff sim.out 1cpt_w._noise.out > .tmp) && echo '-PASSED-'
#
# 1cpt.MCMC1.in
- @echo Testing MCMC set uncertainties with 1cpt.MCMC1.in ...
- @chmod -w 1cpt.MCMC1.in 1cpt.MCMC1.out
- @mcsim 1cpt.MCMC1.in sim.out >> mcsim.log
- @(diff sim.out 1cpt.MCMC1.out > .tmp) && echo '-PASSED-'
+ echo Testing MCMC set uncertainties with 1cpt.MCMC1.in ...
+ chmod -w 1cpt.MCMC1.in 1cpt.MCMC1.out
+ ./mcsim 1cpt.MCMC1.in sim.out >> mcsim.log
+ (diff sim.out 1cpt.MCMC1.out > .tmp) && echo '-PASSED-'
#
# 1cpt.MCMC2.in
- @echo Testing MCMC estimated uncertainties with 1cpt.MCMC2.in ...
- @chmod -w 1cpt.MCMC2.in 1cpt.MCMC2.out
- @mcsim 1cpt.MCMC2.in sim.out >> mcsim.log
- @(diff sim.out 1cpt.MCMC2.out > .tmp) && echo '-PASSED-'
+ echo Testing MCMC estimated uncertainties with 1cpt.MCMC2.in ...
+ chmod -w 1cpt.MCMC2.in 1cpt.MCMC2.out
+ ./mcsim 1cpt.MCMC2.in sim.out >> mcsim.log
+ (diff sim.out 1cpt.MCMC2.out > .tmp) && echo '-PASSED-'
#
# 1cpt.MCMC3.in
- @echo Testing MCMC print every 2 iterations with 1cpt.MCMC3.in ...
- @chmod -w 1cpt.MCMC3.in 1cpt.MCMC3.out
- @mcsim 1cpt.MCMC3.in sim.out >> mcsim.log
- @(diff sim.out 1cpt.MCMC3.out > .tmp) && echo '-PASSED-'
+ echo Testing MCMC print every 2 iterations with 1cpt.MCMC3.in ...
+ chmod -w 1cpt.MCMC3.in 1cpt.MCMC3.out
+ ./mcsim 1cpt.MCMC3.in sim.out >> mcsim.log
+ (diff sim.out 1cpt.MCMC3.out > .tmp) && echo '-PASSED-'
#
# 1cpt.MCMC4.in
- @echo Testing MCMC estimated bounds on F with 1cpt.MCMC4.in ...
- @chmod -w 1cpt.MCMC4.in 1cpt.MCMC4.out
- @mcsim 1cpt.MCMC4.in sim.out >> mcsim.log
- @(diff sim.out 1cpt.MCMC4.out > .tmp) && echo '-PASSED-'
+ echo Testing MCMC estimated bounds on F with 1cpt.MCMC4.in ...
+ chmod -w 1cpt.MCMC4.in 1cpt.MCMC4.out
+ ./mcsim 1cpt.MCMC4.in sim.out >> mcsim.log
+ (diff sim.out 1cpt.MCMC4.out > .tmp) && echo '-PASSED-'
#
# 1cpt.MCMC5.in
- @echo Testing MCMC model-computed SDs with 1cpt.MCMC5.in ...
- @chmod -w 1cpt.MCMC5.in 1cpt.MCMC5.out
- @mcsim 1cpt.MCMC5.in sim.out >> mcsim.log
- @(diff sim.out 1cpt.MCMC5.out > .tmp) && echo '-PASSED-'
-#
- @echo
- @echo ----------
- @echo
- @echo Testing with the linear model
- @mod linear.model
- @gcc -I . -Wall -ansi -c model.c -o model.o > /dev/null
- @gcc -o mcsim *.o -lm
- @echo
+ echo Testing MCMC model-computed SDs with 1cpt.MCMC5.in ...
+ chmod -w 1cpt.MCMC5.in 1cpt.MCMC5.out
+ ./mcsim 1cpt.MCMC5.in sim.out >> mcsim.log
+ (diff sim.out 1cpt.MCMC5.out > .tmp) && echo '-PASSED-'
+#
+ echo
+ echo ----------
+ echo
+ echo Testing with the linear model
+ ../mod/mod linear.model
+ cc -I . -Wall -ansi -c model.c -o model.o > /dev/null
+ cc -o mcsim *.o -lm
+ echo
#
# linear.in
- @echo Testing Lsodes with linear.in ...
- @chmod -w linear.in linear.out
- @mcsim linear.in sim.out >> mcsim.log
- @(diff sim.out linear.out > .tmp) && echo '-PASSED-'
+ echo Testing Lsodes with linear.in ...
+ chmod -w linear.in linear.out
+ ./mcsim linear.in sim.out >> mcsim.log
+ (diff sim.out linear.out > .tmp) && echo '-PASSED-'
#
# linear.MCMC1.in
- @echo Testing MCMC 1 experiment with linear.MCMC1.in ...
- @chmod -w linear.MCMC1.in linear.MCMC1.out
- @mcsim linear.MCMC1.in sim.out >> mcsim.log
- @(diff sim.out linear.MCMC1.out > .tmp) && echo '-PASSED-'
+ echo Testing MCMC 1 experiment with linear.MCMC1.in ...
+ chmod -w linear.MCMC1.in linear.MCMC1.out
+ ./mcsim linear.MCMC1.in sim.out >> mcsim.log
+ (diff sim.out linear.MCMC1.out > .tmp) && echo '-PASSED-'
#
# linear.MCMC2.in
- @echo Testing MCMC 1 repeated experiment with linear.MCMC2.in ...
- @chmod -w linear.MCMC2.in linear.MCMC2.out
- @mcsim linear.MCMC2.in sim.out >> mcsim.log
- @(diff sim.out linear.MCMC2.out > .tmp) && echo '-PASSED-'
+ echo Testing MCMC 1 repeated experiment with linear.MCMC2.in ...
+ chmod -w linear.MCMC2.in linear.MCMC2.out
+ ./mcsim linear.MCMC2.in sim.out >> mcsim.log
+ (diff sim.out linear.MCMC2.out > .tmp) && echo '-PASSED-'
#
# linear.H.MCMC1.in
- @echo Testing MCMC hierarchical linear model, 10 exps with \
+ echo Testing MCMC hierarchical linear model, 10 exps with \
linear.H.MCMC1.in ...
- @chmod -w linear.H.MCMC1.in linear.H.MCMC1.out
- @mcsim linear.H.MCMC1.in sim.out >> mcsim.log
- @(diff sim.out linear.H.MCMC1.out > .tmp) && echo '-PASSED-'
+ chmod -w linear.H.MCMC1.in linear.H.MCMC1.out
+ ./mcsim linear.H.MCMC1.in sim.out >> mcsim.log
+ (diff sim.out linear.H.MCMC1.out > .tmp) && echo '-PASSED-'
#
# linear.H.MCMC2.in
- @echo Testing MCMC hierarchical linear model, B1.1 set with \
+ echo Testing MCMC hierarchical linear model, B1.1 set with \
linear.H.MCMC2.in
- @chmod -w linear.H.MCMC2.in linear.H.MCMC2.out
- @mcsim linear.H.MCMC2.in sim.out >> mcsim.log
- @(diff sim.out linear.H.MCMC2.out > .tmp) && echo '-PASSED-'
+ chmod -w linear.H.MCMC2.in linear.H.MCMC2.out
+ ./mcsim linear.H.MCMC2.in sim.out >> mcsim.log
+ (diff sim.out linear.H.MCMC2.out > .tmp) && echo '-PASSED-'
#
# linear.H.MCMC3.in
- @echo Testing MCMC hierarchical model, restart file with \
+ echo Testing MCMC hierarchical model, restart file with \
linear.H.MCMC3.in
- @chmod -w linear.H.MCMC3.in linear.H.MCMC3.out
- @mcsim linear.H.MCMC3.in sim.out >> mcsim.log
- @(diff sim.out linear.H.MCMC3.out > .tmp) && echo '-PASSED-'
-#
- @echo
- @echo Hourra!
- @echo MCSim passed all tests.
+ chmod -w linear.H.MCMC3.in linear.H.MCMC3.out
+ ./mcsim linear.H.MCMC3.in sim.out >> mcsim.log
+ (diff sim.out linear.H.MCMC3.out > .tmp) && echo '-PASSED-'
+#
+ echo
+ echo Hourra!
+ echo MCSim passed all tests.

1
math/mcsim/pkg/COMMENT Normal file
View file

@ -0,0 +1 @@
Monte Carlo Simulation software

7
math/mcsim/pkg/DESCR Normal file
View file

@ -0,0 +1,7 @@
MCSim is a general purpose modeling and simulation program which also
performs standard or Markov chain Monte Carlo simulations. It allows
you to specify a set of linear or nonlinear equations (eventually
differential), and solve them using parameter values you choose or
parameter values sampled from specified statistical distributions.
Simulation outputs can be compared to experimental data for parameter
estimation.

19
math/mcsim/pkg/PLIST Normal file
View file

@ -0,0 +1,19 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2000/11/26 23:02:38 jtb Exp $
bin/mcsim
bin/mod
@unexec install-info --delete --info-dir=%D/info %D/info/mcsim
info/mcsim
@exec install-info --info-dir=%D/info %D/info/mcsim
info/mcsim-1
info/mcsim-2
info/mcsim-3
share/doc/mcsim/About-Datasets.txt
share/doc/mcsim/About-Doc.txt
share/doc/mcsim/About-MCSim.txt
share/doc/mcsim/MCSim-changelog
share/doc/mcsim/MCSim-to-do
share/doc/mcsim/Manual-Update.txt
share/doc/mcsim/Programming-notes.txt
share/doc/mcsim/mcsim.dvi
share/doc/mcsim/mcsim.html
@dirrm share/doc/mcsim