1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-07-02 14:04:09 +00:00

add c++14 constexpr spectrum and wave genarator algorithms

This commit is contained in:
bolero-MURAKAMI 2014-04-20 15:25:25 +09:00
parent d1fc657c1f
commit cc48f3585a
29 changed files with 506 additions and 77 deletions

View file

@ -16,8 +16,8 @@
#include <sprout/iterator/next.hpp>
#include <sprout/iterator/prev.hpp>
#include <sprout/iterator/distance.hpp>
#include <sprout/numeric/dft/fixed/triangle.hpp>
#include <sprout/utility/swap.hpp>
#include <sprout/numeric/dft/detail/triangle.hpp>
namespace sprout {
//
@ -97,7 +97,7 @@ namespace sprout {
}
SPROUT_CONSTEXPR reference operator*() const {
return amplitude_ == 0 ? 0
: amplitude_ * sprout::fixed::detail::triangle_value(frequency_ * value_type(index_) + phase_)
: sprout::detail::triangle_value(frequency_, amplitude_, phase_, index_)
;
}
SPROUT_CONSTEXPR pointer operator->() const {
@ -139,7 +139,7 @@ namespace sprout {
}
SPROUT_CONSTEXPR reference operator[](difference_type n) const {
return amplitude_ == 0 ? 0
: amplitude_ * sprout::fixed::detail::triangle_value(frequency_ * value_type(index_ + n) + phase_)
: sprout::detail::triangle_value(frequency_, amplitude_, phase_, index_ + n)
;
}
SPROUT_CONSTEXPR triangle_iterator next() const {