[patch] Fix freqswap errata

Jules Bergmann jules at codesourcery.com
Tue Jun 10 15:46:58 UTC 2008


This patch fixes a couple of bugs in freqswap that broke the cheby 
window test:

  - In-place freqswap was broken for odd vector and matrix sizes.
    For vectors, this was straight forward to fix.

    For matrices, this requires either creating temporary vectors
    approximately the size of the number of rows and columns of the
    matrix, or doing the swap in two phases.  Under the rationale that
    memory allocation is to be avoided outside of early binding, I
    implemented the two phase swap.

    The vector fix was enough to get the cheby window test to pass.
    However, I also optimized cheby to use an out-of-place freqswap
    to avoid a copy, which turned up another bug:

  - Freqswap_functor stored the referee block as a reference.
    This works for by-reference blocks, but not by-value blocks,
    such as expressions.  Fixed by using appropriate View_block_storage
    traits.

This patch also extends the freqswap test to cover the in-place and RHS 
expression cases.

Patch applied.

				-- Jules

-- 
Jules Bergmann
CodeSourcery
jules at codesourcery.com
(650) 331-3385 x705
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fs.diff
URL: <http://sourcerytools.com/pipermail/vsipl++/attachments/20080610/1bee920e/attachment.ksh>


More information about the vsipl++ mailing list