mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-14 15:04:09 +00:00
add compost utility
This commit is contained in:
parent
24d2a229f3
commit
b44f7c8f2a
14 changed files with 670 additions and 29 deletions
|
@ -96,7 +96,9 @@ namespace sprout {
|
|||
}
|
||||
SPROUT_CONSTEXPR reference operator*() const {
|
||||
using sprout::sin;
|
||||
return amplitude_ * sin(d_ * value_type(index_) + phase_);
|
||||
return amplitude_ == 0 ? 0
|
||||
: amplitude_ * sin(d_ * value_type(index_) + phase_)
|
||||
;
|
||||
}
|
||||
SPROUT_CONSTEXPR pointer operator->() const {
|
||||
return &operator*()();
|
||||
|
@ -137,7 +139,9 @@ namespace sprout {
|
|||
}
|
||||
SPROUT_CONSTEXPR reference operator[](difference_type n) const {
|
||||
using sprout::sin;
|
||||
return amplitude_ * sin(d_ * value_type(index_ + n) + phase_);
|
||||
return amplitude_ == 0 ? 0
|
||||
: amplitude_ * sin(d_ * value_type(index_ + n) + phase_)
|
||||
;
|
||||
}
|
||||
SPROUT_CONSTEXPR sinusoid_iterator next() const {
|
||||
return sinusoid_iterator(*this, index_ + 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue