Boost logo

Ublas :

From: Georg Baum (Georg.Baum_at_[hidden])
Date: 2006-07-25 07:29:06


Am Dienstag, 25. Juli 2006 13:15 schrieb Neal Becker:
> When porting legacy code, it is very helpful if the matrix class supports
> the old C/Fortran notation: A[i][j].

Well, the Fortran notation is A(i, j).

> It seems ublas doesn't support this, but uses A(i,j). Unfortunate. Is
> this too difficult to implement?

AFAIK there is a preprocessor define that enables this notation, but you
have to be careful: A[i] calls the operator[] of the matrix, and that
returns a proxy of row i, so A[i][j] will give the correct value but is
more expensive than A(i, j). Normally you don't want it.

Georg