![]() |
Blitz Support : |
From: Russell L. Carter (rcarter_at_[hidden])
Date: 2005-04-15 18:36:13
Hi,
I'm quite new to blitz++, but not generic programming nor
Golub and Van Loan. After extensively reviewing what's
available I've decided to implement my current project
in blitz++. First steps are building blitz++ wrappers
for the lapack stuff implemented in atlas. For the test
functionality I first needed a 1-norm for matrices (Array<double, 2>).
I see there is a norm1 in the Vector class, but no mention
of Vector in the docs, nor much in google. It appears to
be old code, so something is up here. Oh well. So I wrote
my own:
for (int j = 0, norm1 = 0; j < M.columns(); ++j) {
norm1 = max(norm1, sum(abs(M(Range::all(), j))));
}
I see in the mail archives that (as usual) performance
is very sensitive to implementation, so since I'm a newbie,
if this isn't optimal, how does one do it in the best
blitzian way?
Second puzzle is how to efficiently permute the rows of a
matrix, given say an Array<int,1> of permuted rows
handed back by lapack routines. I see transpose and reindex
but these appear to reorder dimensions, not rows.
Any hints?
Thanks,
Russell