[patch] Fix for lvalue_proxy's of complex types.

Jules Bergmann jules at codesourcery.com
Thu Feb 2 17:57:30 UTC 2006


When trying to compile the library with split storage of complex for 
Dense blocks, instances of 'view(index)' syntax that previously used 
true lvalues now started using proxy lvalues.  This uncovered some 
problems with proxies of complex values (for example, simple things like 
'a += view(i)' didn't work!).

See comment in regr_complex_proxy.cpp below for my attempt at describe 
the problem.  The solution is to have Lvalue_proxy derive from 
std::complex<T> when proxying a complex<T> value.  This isn't efficient 
or pretty, but it appears to work OK (with both GCC and ICC).

I extended the existing lvalue-proxy test to cover the problems even 
when the library is compiled with interleaved storage of complex, and 
added a new regression to test the problem cases directly.

In general, we should avoid using the 'view(index)' syntax from within 
the library and in high-performance code (esp for views of complex 
values).  It is OK to continue using the 'view(index)' syntax in our 
tests cases (it is easier to read and it helps shake out Lvalue_proxy 
functionality).

Any concerns with this approach?

				-- Jules
-------------- next part --------------
A non-text attachment was scrubbed...
Name: proxy.diff
Type: text/x-patch
Size: 23162 bytes
Desc: not available
URL: <http://sourcerytools.com/pipermail/vsipl++/attachments/20060202/81c76dae/attachment.bin>


More information about the vsipl++ mailing list