From: Pavel Chikulaev (pavel.chikulaev_at_[hidden])
Date: 2005-03-08 05:52:00
"Tobias Schwinger" <tschwinger_at_[hidden]> wrote in message
> - Custom per element operations
double d = transpose(m); //
It's not yet supported, but I think I can do it.
> - It should not be limited to operators but work with any functions
N-Arity Functions are already supported. It is so called custom operations.
Transpose function is example from sample usage.
same class Matrix
Matrix(LAZY_CUSTOM_OP(product_tag, (2, (Matrix_, Matrix_)));
LAZY_ENABLE_CUSTOM_OP(product, Matrix_ =
Matrix::Matrix(LAZY_CUSTOM_OP(product_tag, (2, (Matrix_, Matrix_)) op)
//first matrix accessed via op._1
//second matrix accessed via op._2
Matrix a, b, c;
a = product(b, c); //No temporaries
The only drawback of such approach is that I can't add a lazy function
changing class. But I'm working on it. I think it's not necessary to change
Eurika! I know how to do it.
Template specialiation will help me again.
> The design should allow to optionally replace operations to make use of
> SIMD hardware.
Library also supports it. AFAIK It's template specialization of lazy
operator, isn't it?
-- Pavel Chikulaev
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk