Skip to content

Commit

Permalink
use q=0 when 0-eps<q<0+eps
Browse files Browse the repository at this point in the history
  • Loading branch information
stfbnc committed Nov 12, 2023
1 parent 08e6cee commit 2aa7b47
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
fathon (v1.3.2)
fathon (v1.3.3)
***************

Current version is available for Linux (x86_64 and ARM64), macOS (x86_64), and Windows (64bit).
Expand Down
2 changes: 1 addition & 1 deletion fathon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
and related algorithms.
"""

__version__ = '1.3.2'
__version__ = '1.3.3'
__author__ = 'Stefano Bianchi'
__git_repo__ = 'https://github.com/stfbnc/fathon'
19 changes: 11 additions & 8 deletions fathon/cLoops.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
#include "cLoops.h"
#include "omp.h"

#define LQ -3.0e-15
#define HQ 3.0e-15

//main loop for unbiased DFA
void flucUDFACompute(double *y_vec, double *t_vec, int y_len, int *wins_vec, int num_wins, int pol, double *f_vec)
{
Expand Down Expand Up @@ -246,7 +249,7 @@ void flucMFDFAForwCompute(double *y, double *t, int N, int *wins, int n_wins, do
rms += pow(var, 2.0);
}

if(q == 0.0)
if((q >= LQ) && (q <= HQ))
{
f += log(rms / (double)curr_win_size);
}
Expand All @@ -258,7 +261,7 @@ void flucMFDFAForwCompute(double *y, double *t, int N, int *wins, int n_wins, do
free(fit_coeffs);
}

if(q == 0.0)
if((q >= LQ) && (q <= HQ))
{
f_vec[iq * n_wins + i] = exp(f / (double)(2 * N_s));
}
Expand Down Expand Up @@ -331,7 +334,7 @@ void flucMFDFAForwBackwCompute(double *y, double *t, int N, int *wins, int n_win
rms2 += pow(var_2, 2.0);
}

if(q == 0.0)
if((q >= LQ) && (q <= HQ))
{
f += (log(rms1 / (double)curr_win_size) + log(rms2 / (double)curr_win_size));
}
Expand All @@ -343,7 +346,7 @@ void flucMFDFAForwBackwCompute(double *y, double *t, int N, int *wins, int n_win
free(fit_coeffs);
}

if(q == 0.0)
if((q >= LQ) && (q <= HQ))
{
f_vec[iq * n_wins + i] = exp(f / (double)(4 * N_s));
}
Expand Down Expand Up @@ -763,7 +766,7 @@ void flucMFDCCAForwCompute(double *y1, double *y2, double *t, int N, int *wins,
rms += fabs(var_1 * var_2);
}

if(q == 0.0)
if((q >= LQ) && (q <= HQ))
{
f += log(rms / (double)curr_win_size);
}
Expand All @@ -776,7 +779,7 @@ void flucMFDCCAForwCompute(double *y1, double *y2, double *t, int N, int *wins,
free(fit_coeffs_2);
}

if(q == 0.0)
if((q >= LQ) && (q <= HQ))
{
f_vec[iq * n_wins + i] = exp(f / (double)(2 * N_s));
}
Expand Down Expand Up @@ -856,7 +859,7 @@ void flucMFDCCAForwBackwCompute(double *y1, double *y2, double *t, int N, int *w
rms2 += fabs(var_1 * var_2);
}

if(q == 0.0)
if((q >= LQ) && (q <= HQ))
{
f += (log(rms1 / (double)curr_win_size) + log(rms2 / (double)curr_win_size));
}
Expand All @@ -869,7 +872,7 @@ void flucMFDCCAForwBackwCompute(double *y1, double *y2, double *t, int N, int *w
free(fit_coeffs_2);
}

if(q == 0.0)
if((q >= LQ) && (q <= HQ))
{
f_vec[iq * n_wins + i] = exp(f / (double)(4 * N_s));
}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def get_extension(module_name, src_name, current_os):
readme_file.close()

setup(name="fathon",
version="1.3.2",
version="1.3.3",
author="Stefano Bianchi",
author_email="fathon.package@gmail.com",
url="https://github.com/stfbnc/fathon.git",
Expand Down

0 comments on commit 2aa7b47

Please sign in to comment.