-std=gnu++0x
All the unit tests Daniel put in have been a lifesaver.
I went with the backward-compatible refactor, so the
distributions and error checking code should all work
exactly the same as it did before.
I also checked that it still compiles under clang++
version 2.9.
I don't have other hardware to test on here, but at
least Jenkins didn't balk at the changes with its current
settings.
g++ 4.2.1 sure is slow relative to clang++ version 2.9
(both at optimization level 0).
- Bob
MATLAB looks nicer than R/BUGS/JAGS for matrix
operation syntax, because the basic arithmetic
ops have their natural translation to corresponding
matrix ops.
A * B matrix multiply
A .* B elementwise multiply
A ./ B elementwise divide
A + B matrix and elementwise add
A - B matrix and elementwise subtract
+A matrix positive (no op)
-A matrix negation
A ^ n matrix power
A .^ B elementwise power
The only thing I don't like is:
A' complex conjugate transpose
A.' transpose
But I suppose we can write A' since it has the same
behavior as A' for real-valued matrices. Matt -- what's
the convention in MATLAB -- do people just write A'
for real matrix transposes, too?
This brings up the issue of logical operations on
matrices like (A && B) and any(A). We don't really have
booleans yet, but if we add conditionals (which I think
we eventually should), then we'll need boolean types, and
then it'll make sense to have logical operations.
Anyway, let's not turn this into a bikeshed issue. There's
apparently even a name for bikeshedding on programming
language syntax, namely "Wadler's Law". See:
http://en.wikipedia.org/wiki/Parkinson's_Law_of_Triviality
Andrew: this topic looks ripe for blogging. You've mentioned
Parkinson's First Law, but not his Law of Triviality as far
as I could search.
- Bob
I didn't want to sound partisan, but I'm inclined to agree that
Matlab's matrix operator syntax seems a little more well thought out
than R's. As one would hope, given that MATLAB is short for MATrix
LABoratory.
Matt