Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-03-25 21:26:13


Wow, this looks pretty sweet to me!
-Dave
----- Original Message -----
From: "Doug Gregor" <gregod_at_[hidden]>
> How about:
>
> A[1 <= stride(1) < 2, 2 <= stride(2) <= 8]
>
> Specifying intervals using function notation is unfortunate in C++ because
> the use of parentheses or brackets doesn't match the mathematical
notation.
> The range (a, b) expressed mathematically is unambiguous, but if we have a
> C++ functoin call interval(a, b) the user will always be sent back to the
> documentation to figure out what happens at the endpoints. Using
relational
> operators it is unambiguous.
>
> While I'm throwing out random syntax, an interface between the lambda
library
> and the multidim array/matrix/linear algebra library could allow for some
> really nice code:
>
> // A is M x N, B is N x R
> indexer<int> i, j, k;
> C[i, j] = sum(A[i, k] * B[k, j], for_all(0 <= k < N)),
> for_all(0 <= i < M, 0 <= j < R);
>
> And for a really neat trick, have the library tile this loop nest :)
>
> Doug
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk