Skip to content

Commit

Permalink
Remove conjugate_view
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Jan 20, 2024
1 parent 4b92b3e commit 1b39e72
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 39 deletions.
11 changes: 6 additions & 5 deletions src/neo/fft/experimental/rfft.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <neo/fft/direction.hpp>
#include <neo/fft/reference/bitrevorder.hpp>
#include <neo/fft/reference/c2c_dit2_plan.hpp>
#include <neo/fft/reference/conjugate_view.hpp>
#include <neo/fft/twiddle.hpp>

#include <cmath>
Expand Down Expand Up @@ -106,7 +105,8 @@ struct c2c_dit2_plan

c2c_dit2_plan(from_order_tag /*tag*/, size_type order)
: _order{order}
, _w{neo::fft::make_twiddle_lut_radix2<std::complex<Float>>(size(), direction::forward)}
, _wf{neo::fft::make_twiddle_lut_radix2<std::complex<Float>>(size(), direction::forward)}
, _wb{neo::fft::make_twiddle_lut_radix2<std::complex<Float>>(size(), direction::backward)}
{}

[[nodiscard]] auto order() const noexcept -> size_type { return _order; }
Expand All @@ -122,16 +122,17 @@ struct c2c_dit2_plan
_rev(x);

if (dir == direction::forward) {
detail::c2c_kernel{}(x, _w.to_mdspan());
detail::c2c_kernel{}(x, _wf.to_mdspan());
} else {
detail::c2c_kernel{}(x, conjugate_view{_w.to_mdspan()});
detail::c2c_kernel{}(x, _wb.to_mdspan());
}
}

private:
size_type _order;
bitrevorder_plan _rev{_order};
stdex::mdarray<std::complex<Float>, stdex::dextents<std::size_t, 1>> _w;
stdex::mdarray<std::complex<Float>, stdex::dextents<std::size_t, 1>> _wf;
stdex::mdarray<std::complex<Float>, stdex::dextents<std::size_t, 1>> _wb;
};

template<std::floating_point Float>
Expand Down
10 changes: 6 additions & 4 deletions src/neo/fft/reference/c2c_dit2_plan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <neo/fft/direction.hpp>
#include <neo/fft/order.hpp>
#include <neo/fft/reference/bitrevorder.hpp>
#include <neo/fft/reference/conjugate_view.hpp>
#include <neo/fft/reference/kernel/c2c_dit2.hpp>
#include <neo/fft/twiddle.hpp>
#include <neo/math/polar.hpp>
Expand Down Expand Up @@ -41,9 +40,12 @@ struct c2c_dit2_plan
size_type _order;
size_type _size{fft::size(order())};
bitrevorder_plan _reorder{static_cast<size_t>(_order)};
stdex::mdarray<Complex, stdex::dextents<size_type, 1>> _twiddles{
stdex::mdarray<Complex, stdex::dextents<size_type, 1>> _wf{
make_twiddle_lut_radix2<Complex>(_size, direction::forward),
};
stdex::mdarray<Complex, stdex::dextents<size_type, 1>> _wb{
make_twiddle_lut_radix2<Complex>(_size, direction::backward),
};
};

template<typename Complex, typename Kernel>
Expand Down Expand Up @@ -84,9 +86,9 @@ auto c2c_dit2_plan<Complex, Kernel>::operator()(Vec x, direction dir) noexcept -
_reorder(x);

if (auto const kernel = Kernel{}; dir == direction::forward) {
kernel(x, _twiddles.to_mdspan());
kernel(x, _wf.to_mdspan());
} else {
kernel(x, conjugate_view{_twiddles.to_mdspan()});
kernel(x, _wb.to_mdspan());
}
}

Expand Down
30 changes: 0 additions & 30 deletions src/neo/fft/reference/conjugate_view.hpp

This file was deleted.

0 comments on commit 1b39e72

Please sign in to comment.