summaryrefslogtreecommitdiff
path: root/log_get_energy.cpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2025-05-08 18:11:35 -0300
committerJaron Kent-Dobias <jaron@kent-dobias.com>2025-05-08 18:11:35 -0300
commit73f4eaba3a08a5e1b85512868c3916c7fd4e4571 (patch)
tree999ceaa31419e37590309e3ccb4a8e9ec0a9c536 /log_get_energy.cpp
parent21a99431f02e799de9a811f9f02ad006fe27df6d (diff)
downloadcode-73f4eaba3a08a5e1b85512868c3916c7fd4e4571.tar.gz
code-73f4eaba3a08a5e1b85512868c3916c7fd4e4571.tar.bz2
code-73f4eaba3a08a5e1b85512868c3916c7fd4e4571.zip
Updated to work with shift
Diffstat (limited to 'log_get_energy.cpp')
-rw-r--r--log_get_energy.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/log_get_energy.cpp b/log_get_energy.cpp
index ae17f6f..b01034c 100644
--- a/log_get_energy.cpp
+++ b/log_get_energy.cpp
@@ -15,6 +15,8 @@ int main(int argc, char* argv[]) {
unsigned log2n = 8;
Real Δτ = 0.1;
Real k = 0.1;
+ unsigned pad = 2;
+ Real shift = 0.5;
/* Iteration parameters */
Real β₀ = 0;
@@ -23,7 +25,7 @@ int main(int argc, char* argv[]) {
int opt;
- while ((opt = getopt(argc, argv, "p:s:2:T:t:b:d:k:D:0:")) != -1) {
+ while ((opt = getopt(argc, argv, "p:s:2:T:t:b:d:k:D:0:h:")) != -1) {
switch (opt) {
case 'p':
p = atoi(optarg);
@@ -46,6 +48,9 @@ int main(int argc, char* argv[]) {
case 'k':
k = atof(optarg);
break;
+ case 'h':
+ shift = atof(optarg);
+ break;
case 'D':
Δτ = atof(optarg);
break;
@@ -59,7 +64,7 @@ int main(int argc, char* argv[]) {
unsigned N = pow(2, log2n);
- LogarithmicFourierTransform fft(N, k, Δτ, 4);
+ LogarithmicFourierTransform fft(N, k, Δτ, pad, shift);
std::vector<Real> C(N);
std::vector<Real> R(N);
@@ -71,7 +76,7 @@ int main(int argc, char* argv[]) {
std::cout << std::setprecision(16);
while (β += Δβ, β <= βₘₐₓ) {
- if (logFourierLoad(C, R, Ct, Rt, p, s, λ, τ₀, β, log2n, Δτ, k)) {
+ if (logFourierLoad(C, R, Ct, Rt, p, s, λ, τ₀, β, log2n, Δτ, shift)) {
Real e = energy(fft, C, R, p, s, λ, β);