Tuesday, January 18, 2011
I'm a backward GIT
I just noticed I've been using GIT all wrong. I had started a project so it made sense to make a branch every time I had a functional stopping point. Now there are some working versions, and I can actually keep one as the 'master' branch. Now it makes sense to develop on a branch and then update the master whenever I have a tested, working version.
Labels:
backwards git
Thursday, January 6, 2011
Saturday, October 16, 2010
R and parallel BLAS
Running R with parallel BLAS seems to be as easy under Gentoo ~amd64 as: eselect blas set atlas-threads. Sweet.
update: and rebuild Matrix / MCMCglmm within R, since those are outside portage
update: ... rebuild R with +threads use flag...
update: MCMCglmm uses CSparse so no speed-up, but JAGS should like it.
update: and rebuild Matrix / MCMCglmm within R, since those are outside portage
update: ... rebuild R with +threads use flag...
update: MCMCglmm uses CSparse so no speed-up, but JAGS should like it.
Wednesday, March 10, 2010
Minimal Gentoo EBuild for simuPOP
Works on a Gentoo ~amd64
In this directory, in a file called "simuPOP-1.0.0-r1.ebuild" put:
Then add:
at the end of make.conf... or if you already define PORTDIR_OVERLAY, it's
something like (I hear...):
Then it should build/install with:
mkdir /usr/local/portage/sci-biology/simuPOP/files -p cd /usr/local/portage/sci-biology/simuPOP/
In this directory, in a file called "simuPOP-1.0.0-r1.ebuild" put:
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
DESCRIPTION="simuPOP is a general-purpose individual-based forward-time
population genetics simulation environment."
SRC_URI="http://downloads.sourceforge.net/project/simupop/simupop/${PV}/${P}-src.tar.gz"
HOMEPAGE="http://simupop.sourceforge.net/"
KEYWORDS="~x86 ~amd64"
SLOT="0"
LICENSE="GPL-3"
IUSE=""
DEPEND="
dev-lang/python
dev-libs/boost
dev-lang/swig
dev-util/scons"
RDEPEND=""
DOCS="README"
inherit distutils
Then add:
PORTDIR_OVERLAY="/usr/local/portage"
at the end of make.conf... or if you already define PORTDIR_OVERLAY, it's
something like (I hear...):
PORTDIR_OVERLAY="$PORTDIR_OVERLAY:/usr/local/portage"
Then it should build/install with:
ebuild simuPOP manifest emerge simuPOP
Friday, February 26, 2010
R LOL
R protects the objects "TRUE" and "FALSE" so this fails:
Which turns out to return FALSE. I'm sure there is some legacy code which relies on this behavior so we can't change it.
We need an R-3.0
TRUE <- FALSEThe short forms "T" and "F" are defined by default, but they are not protected, so this works:
T <- FALSEThen we can ask:
isTRUE(T)
Which turns out to return FALSE. I'm sure there is some legacy code which relies on this behavior so we can't change it.
We need an R-3.0
Monday, December 14, 2009
Marxists
One would assume that the original article on metapopulations from Richard Levins would be accessible freely somewhere on teh interwebs. No such luck.
Wednesday, December 2, 2009
R difficulties
A project implementing individual-based simulations in R has been starting to stink a little. I did some design work to get the basic things that happen in an ecological simulation under control. How time moves forward, when the simulation state is recorded, and what kinds of data are recorded is pretty well defined via an S4 class and an associated method definition for the 'simulate' function (which already happened to have a generic).
My current problem is that the S4 class references a bunch of environments where data is kept in order to avoid copying large objects whenever the simulation iterates. The object also holds a list of functions, and a call order. The functions are called in order to modify data held in environments referenced by the object, and then time is iterated before doing it all over again. The enforcement of good behavior by the functions is pretty minimal and will come back to bite me once other people start writing functions using this setup.
The simplest answer I can come up with is to make an S4 class wrapper class for the functions this object will use. The wrapper class will have a slot for the function which operates on the object, and it will have two additional slots: one which states which parts of the object will be required, and another which states which parts of the object will be modified. Sort of like promises and requirements. It'll then require a method which checks for the requirements in the object first, and runs the function, and checks the object was only modified where stated...
My current problem is that the S4 class references a bunch of environments where data is kept in order to avoid copying large objects whenever the simulation iterates. The object also holds a list of functions, and a call order. The functions are called in order to modify data held in environments referenced by the object, and then time is iterated before doing it all over again. The enforcement of good behavior by the functions is pretty minimal and will come back to bite me once other people start writing functions using this setup.
The simplest answer I can come up with is to make an S4 class wrapper class for the functions this object will use. The wrapper class will have a slot for the function which operates on the object, and it will have two additional slots: one which states which parts of the object will be required, and another which states which parts of the object will be modified. Sort of like promises and requirements. It'll then require a method which checks for the requirements in the object first, and runs the function, and checks the object was only modified where stated...
Subscribe to:
Posts (Atom)