R
Rex_chaos
Hi there,
I have a question about using expression template. We know that the
final calculation in expression template will end up with a series of
element-by-element operations. The concept can be explained with
W = X o Y o Z; (here o denotes any operator)
W.operator = LOR(LOR<X, o, Y>, o, Z);
and in W.operator=, we have
for ( int i=0; i<length_of_W; i++ ) W = X o Y o Z;
The expression above confusing me!!! How can we check if the operands
are "valid"? For example, we are suming up three vectors W = X+Y+Z;
How can we know if both of the vectors are of the same dimension?
Maybe it is still a open issue. I have a look at the source of
stl::valarray. I found no code has been added to check such validity.
I have a question about using expression template. We know that the
final calculation in expression template will end up with a series of
element-by-element operations. The concept can be explained with
W = X o Y o Z; (here o denotes any operator)
W.operator = LOR(LOR<X, o, Y>, o, Z);
and in W.operator=, we have
for ( int i=0; i<length_of_W; i++ ) W = X o Y o Z;
The expression above confusing me!!! How can we check if the operands
are "valid"? For example, we are suming up three vectors W = X+Y+Z;
How can we know if both of the vectors are of the same dimension?
Maybe it is still a open issue. I have a look at the source of
stl::valarray. I found no code has been added to check such validity.