Skip to content

Commit

Permalink
addingv recursive harmonics to cache
Browse files Browse the repository at this point in the history
  • Loading branch information
tgiani committed Oct 25, 2024
1 parent ce11227 commit 659fe31
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/ekore/src/harmonics/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ pub enum K {
Sm21e,
/// $S_{-2,1}(N)$ odd moments
Sm21o,
/// recursive harmonics
S1ph,
S2ph,
S3ph,
}

/// Hold all cached values.
Expand Down Expand Up @@ -98,6 +102,9 @@ impl Cache {
K::Sm3o => w3::Sm3o(self.get(K::S3), self.get(K::S3mh)),
K::Sm21e => w3::Sm21e(self.n, self.get(K::S1), self.get(K::Sm1e)),
K::Sm21o => w3::Sm21o(self.n, self.get(K::S1), self.get(K::Sm1o)),
K::S1ph => recursive_harmonic_sum(self.get(K::S1mh), (self.n - 1.) / 2., 1, 1),
K::S2ph => recursive_harmonic_sum(self.get(K::S2mh), (self.n - 1.) / 2., 1, 2),
K::S3ph => recursive_harmonic_sum(self.get(K::S3mh), (self.n - 1.) / 2., 1, 3),
};
// insert
self.m.insert(k, val);
Expand Down

0 comments on commit 659fe31

Please sign in to comment.