<pre style='margin:0'>
Marius Schamschula (Schamschula) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/269d4d00f56b2160c13a26f5613b326e8101e028">https://github.com/macports/macports-ports/commit/269d4d00f56b2160c13a26f5613b326e8101e028</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 269d4d00f56b2160c13a26f5613b326e8101e028
</span>Author: Marius Schamschula <mschamschula@gmail.com>
AuthorDate: Mon Mar 13 16:09:43 2023 -0500
<span style='display:block; white-space:pre;color:#404040;'> octave packages: patch deprecated error_state issue
</span>---
math/octave-fl-core/Portfile | 2 +-
.../files/patch-src-fl_compose.cc.diff | 23 +-
math/octave-mechanics/Portfile | 5 +-
math/octave-mechanics/files/patch-error_state.diff | 40 +
math/octave-ocs/Portfile | 5 +-
math/octave-ocs/files/of-ocs-6-error_state.patch | 40 +
math/octave-tisean/Portfile | 6 +-
.../files/of-tisean-error_state.patch | 3721 ++++++++++++++++++++
8 files changed, 3826 insertions(+), 16 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/math/octave-fl-core/Portfile b/math/octave-fl-core/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 144f92e8afd..68a5ad6b84d 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/math/octave-fl-core/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/math/octave-fl-core/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4,7 +4,7 @@ PortSystem 1.0
</span> PortGroup octave 1.0
octave.setup fl-core 1.0.0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 9
</span> platforms darwin
license GPL-2+
maintainers {mps @Schamschula} openmaintainer
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/math/octave-fl-core/files/patch-src-fl_compose.cc.diff b/math/octave-fl-core/files/patch-src-fl_compose.cc.diff
</span><span style='display:block; white-space:pre;color:#808080;'>index b8d82184f81..7df0de6ad80 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/math/octave-fl-core/files/patch-src-fl_compose.cc.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/math/octave-fl-core/files/patch-src-fl_compose.cc.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/fl_compose.cc.orig 2020-12-19 10:40:08.000000000 -0600
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/fl_compose.cc 2020-12-19 10:48:55.000000000 -0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/fl_compose.cc.orig 2011-02-06 13:09:03.000000000 -0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/fl_compose.cc 2023-03-10 05:51:47.000000000 -0600
</span> @@ -21,6 +21,7 @@
#include <octave/oct.h>
#include <octave/parse.h>
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -8,7 +8,7 @@
</span>
#define HELP \
"-*- texinfo -*-\n\
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -180,7 +180,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -179,7 +180,7 @@
</span>
// Check if the matrices are both both sparse and set the output matrix to sparse type
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -26,16 +26,21 @@
</span>
// Initialize the number of nonzero elements in the sparse matrix c
int nel = 0;
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -621,7 +621,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -620,11 +621,8 @@
</span> octave_value_list testArgs;
testArgs(0) = 1;
testArgs(1) = 2;
- feval(func,testArgs);
<span style='display:block; white-space:pre;background:#e0ffe0;'>+- if(error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return 1;
</span> + octave::feval(func,testArgs);
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if(error_state)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -724,7 +724,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -723,7 +721,7 @@
</span> octave_value_list fargs;
fargs(0) = octave_value(first);
fargs(1) = octave_value(second);
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -44,7 +49,7 @@
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -735,7 +735,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -734,7 +732,7 @@
</span> octave_value_list fargs;
fargs(0) = octave_value(first);
fargs(1) = octave_value(second);
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/math/octave-mechanics/Portfile b/math/octave-mechanics/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index b290cfc3873..cb67c2e9944 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/math/octave-mechanics/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/math/octave-mechanics/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4,7 +4,7 @@ PortSystem 1.0
</span> PortGroup octave 1.0
octave.setup mechanics 1.3.1
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 9
</span> platforms darwin
license GPL-2+
maintainers {mps @Schamschula} openmaintainer
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -20,4 +20,5 @@ depends_lib-append port:octave-general \
</span> port:octave-geometry \
port:octave-linear-algebra
<span style='display:block; white-space:pre;background:#ffe0e0;'>-patchfiles patch-feval.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles patch-feval.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-error_state.diff
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/math/octave-mechanics/files/patch-error_state.diff b/math/octave-mechanics/files/patch-error_state.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..06395bbd20a
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/math/octave-mechanics/files/patch-error_state.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,40 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- inst/molecularDynamics/src/verletstep_boxed.cc.orig 2023-03-10 05:55:29.000000000 -0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ inst/molecularDynamics/src/verletstep_boxed.cc 2023-03-10 05:59:13.000000000 -0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -69,8 +69,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fcn = args(4).function_value ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval = octave::feval (fcn, newargs, nargout);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ A.insert (retval(0).row_vector_value () +
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -105,8 +103,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fcn = args(4).function_value ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval = octave::feval (fcn, newargs, nargout);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ A.insert (retval(0).row_vector_value () +
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- inst/molecularDynamics/src/verletstep.cc.orig 2023-03-10 05:55:29.000000000 -0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ inst/molecularDynamics/src/verletstep.cc 2023-03-10 05:58:17.000000000 -0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -49,8 +49,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fcn = args(4).function_value ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval = octave::feval (fcn, newargs, nargout);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ A.insert (retval(0).row_vector_value () +
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -86,8 +84,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fcn = args(4).function_value ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval = octave::feval (fcn, newargs, nargout);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ A.insert (retval(0).row_vector_value () +
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/math/octave-ocs/Portfile b/math/octave-ocs/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index f23d4226ee2..50b507f29e8 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/math/octave-ocs/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/math/octave-ocs/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4,7 +4,7 @@ PortSystem 1.0
</span> PortGroup octave 1.0
octave.setup ocs 0.1.5
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 7
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 8
</span> platforms darwin
license GPL-2+
maintainers {mps @Schamschula} openmaintainer
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -18,4 +18,5 @@ checksums rmd160 fcc669049503009e52ac7b7595c7a4248c779b72 \
</span>
# see https://savannah.gnu.org/bugs/?51510
patchfiles patch-src-Mshichmanhodgesmosfet.cc.diff \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- patch-no_break.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patch-no_break.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ of-ocs-6-error_state.patch
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/math/octave-ocs/files/of-ocs-6-error_state.patch b/math/octave-ocs/files/of-ocs-6-error_state.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..dab0b527036
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/math/octave-ocs/files/of-ocs-6-error_state.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,40 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From b33b618b03579438efceeda51c2d1c6eab0ddea9 Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <markus.muetzel@gmx.de>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Sun, 28 Nov 2021 21:29:13 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] Fix compilation with Octave 8 (bug #61577).
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+* src/Mshichmanhodgesmosfet.cc (FMshichmanhodgesmosfet): Remove usage of
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+`error_state`. It was unconditionally set to 0 since about 6 years ago and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+will finally be removed in Octave 8.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ src/Mshichmanhodgesmosfet.cc | 8 ++------
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 1 file changed, 2 insertions(+), 6 deletions(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git a/src/Mshichmanhodgesmosfet.cc b/src/Mshichmanhodgesmosfet.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 4b3e51a..1c0d7c6 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/Mshichmanhodgesmosfet.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/Mshichmanhodgesmosfet.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -342,10 +342,8 @@ the output structures.\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ error("Mshichmanhodgesmosfet: double type value expected as time instant.\n");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- //FIXME: create enum of cases and use switch?
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (eltype == "NMOS")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ //FIXME: create enum of cases and use switch?
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (eltype == "NMOS")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ //FIXME: change parameters to a single map or Octave_map
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* Default n-MOS parameters*/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -543,7 +541,5 @@ the output structures.\n\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ error("Mshichmanhodgesmosfet: unknown element type.\n");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return (retval);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.34.1.windows.1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/math/octave-tisean/Portfile b/math/octave-tisean/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index ae5e0daa602..5a3a1f5254e 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/math/octave-tisean/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/math/octave-tisean/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -5,7 +5,7 @@ PortGroup octave 1.0
</span> PortGroup compilers 1.0
octave.setup tisean 0.2.3
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 9
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 10
</span> platforms darwin
license GPL-2+
maintainers {mps @Schamschula} openmaintainer
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -18,7 +18,9 @@ checksums rmd160 88d9562a685e0d00ea48f068d161b1022f7126c2 \
</span>
# Makefile uses c++ compiler to link object files built with fortran compiler
# ensure that expected fortran libraries (e.g. gfortran) are linked in
<span style='display:block; white-space:pre;background:#ffe0e0;'>-patchfiles-append patch-flib.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#patchfiles-append patch-flib.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles of-tisean-error_state.patch
</span>
compilers.choose fc f77 f90
compilers.setup require_fortran
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/math/octave-tisean/files/of-tisean-error_state.patch b/math/octave-tisean/files/of-tisean-error_state.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..758d15dca4c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/math/octave-tisean/files/of-tisean-error_state.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,3721 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# HG changeset patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# User Markus Mützel <markus.muetzel@gmx.de>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Date 1638189809 -3600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Node ID e40a599d68cf3061d04a9dac30e36751ed20acb2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Parent 71f2c8fde0c59f4942dd22da89bba162e8ae6c97
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Remove usage of `error_state` (bug #61583).
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+* src/pcregexp.cc (many files): Remove usage of `error_state`. It was
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+unconditionally set to 0 since about 6 years ago and will finally be removed in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Octave 8.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__boxcount__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__boxcount__.cc Mon Aug 26 12:51:20 2019 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__boxcount__.cc Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -194,89 +194,85 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ octave_idx_type length=LENGTH-(maxembed-1)*DELAY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ( ! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Calculate output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double heps = EPSMAX*EPSFAKTOR;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type epsi_old = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type k=0;k<EPSCOUNT;k++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Calculate output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double heps = EPSMAX*EPSFAKTOR;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type epsi_old = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type k=0;k<EPSCOUNT;k++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type epsi_test;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ do {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ heps /= EPSFAKTOR;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsi_test=(octave_idx_type)(1./heps);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ } while (epsi_test <= epsi_old);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type epsi = epsi_test;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsi_old = epsi;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ deps[k] = heps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ std::vector <double> histo (maxembed * dimension, 0.0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ start_box(series, which_dims, histo, maxembed, dimension, DELAY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ length, epsi, Q);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type epsi_test;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- do {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- heps /= EPSFAKTOR;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsi_test=(octave_idx_type)(1./heps);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- } while (epsi_test <= epsi_old);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (Q != 1.0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (std::vector<double>::iterator it = histo.begin ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ it != histo.end (); it++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *it = log(*it)/(1.0-Q);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ histo_list.push_back (histo);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create and assign output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ dim_vector dv (maxembed, dimension);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ string_vector keys;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ keys.append (std::string("dim"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ keys.append (std::string("entropy"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_map output (dv, keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type epsi = epsi_test;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsi_old = epsi;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- deps[k] = heps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<maxembed*dimension;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_scalar_map tmp (keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(fHq,"#component = %d embedding = %d\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // which_dims[i][0]+1, which_dims[i][1]+1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tmp.setfield ("dim", which_dims[i][1]+1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create entropy output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix entropy_out (EPSCOUNT, 3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- std::vector <double> histo (maxembed * dimension, 0.0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- start_box(series, which_dims, histo, maxembed, dimension, DELAY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- length, epsi, Q);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (Q != 1.0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (std::vector<double>::iterator it = histo.begin ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- it != histo.end (); it++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *it = log(*it)/(1.0-Q);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- histo_list.push_back (histo);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ std::list<std::vector<double>>::const_iterator it_hist;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ it_hist = histo_list.cbegin ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<EPSCOUNT;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (i == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(fHq,"%e %e %e\n",deps[j]*maxinterval,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // histo_el->hist[i],histo_el->hist[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entropy_out(j,0) = deps[j]*maxinterval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entropy_out(j,1) = (*it_hist)[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entropy_out(j,2) = (*it_hist)[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(fHq,"%e %e %e\n",deps[j]*maxinterval,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // histo_el->hist[i],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // histo_el->hist[i]-histo_el->hist[i-1]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entropy_out(j,0) = deps[j]*maxinterval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entropy_out(j,1) = (*it_hist)[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ entropy_out(j,2) = (*it_hist)[i]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ - (*it_hist)[i-1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ it_hist++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create and assign output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- dim_vector dv (maxembed, dimension);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- string_vector keys;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- keys.append (std::string("dim"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- keys.append (std::string("entropy"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_map output (dv, keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<maxembed*dimension;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_scalar_map tmp (keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(fHq,"#component = %d embedding = %d\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // which_dims[i][0]+1, which_dims[i][1]+1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tmp.setfield ("dim", which_dims[i][1]+1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create entropy output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix entropy_out (EPSCOUNT, 3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tmp.setfield ("entropy",entropy_out);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- std::list<std::vector<double>>::const_iterator it_hist;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- it_hist = histo_list.cbegin ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<EPSCOUNT;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (i == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(fHq,"%e %e %e\n",deps[j]*maxinterval,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // histo_el->hist[i],histo_el->hist[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entropy_out(j,0) = deps[j]*maxinterval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entropy_out(j,1) = (*it_hist)[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entropy_out(j,2) = (*it_hist)[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(fHq,"%e %e %e\n",deps[j]*maxinterval,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // histo_el->hist[i],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // histo_el->hist[i]-histo_el->hist[i-1]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entropy_out(j,0) = deps[j]*maxinterval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entropy_out(j,1) = (*it_hist)[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- entropy_out(j,2) = (*it_hist)[i]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- - (*it_hist)[i-1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- it_hist++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output.assign (idx_vector(which_dims[i][1]),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ idx_vector(which_dims[i][0]),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tmp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tmp.setfield ("entropy",entropy_out);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output.assign (idx_vector(which_dims[i][1]),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- idx_vector(which_dims[i][0]),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tmp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__c1__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src//__c1__.cc.orig 2015-08-14 17:25:52.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src//__c1__.cc 2023-03-09 18:58:35.000000000 -0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -78,65 +78,61 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ octave_idx_type iverb = verbose;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type lines_read = input.rows (); //nmax in d1()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type columns_read = input.columns ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type lines_read = input.rows (); //nmax in d1()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type columns_read = input.columns ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- dim_vector dv (maxdim - mindim + 1, 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- string_vector keys;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- keys.append (std::string("dim"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- keys.append (std::string("c1"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_map output (dv, keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Seed the rand() function for d1()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- F77_XFCN (rand, RAND, (sqrt(seed)));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type m = mindim; m <= maxdim; m++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_scalar_map tmp (keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tmp.setfield ("dim", m);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Creat c1 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix c1_out ((octave_idx_type) ((0 - log (1./(lines_read
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- -(m-1) * delay)) +
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (log (2.) /resolution))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- / (log (2.) /resolution))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- , 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double pr = 0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type current_row = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (double pl = log (1./(lines_read - (m-1)*delay));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pl <= 0.0; pl += log (2.) / resolution)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double pln = pl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double rln;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- F77_XFCN (d1, D1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (lines_read, columns_read, lines_read,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- input.fortran_vec (), delay, m, cmin,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pr, pln, rln, tmin, kmax, iverb));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (pln != pr)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pr = pln;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- c1_out(current_row,0) = exp (rln);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- c1_out(current_row,1) = exp (pln);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- current_row += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Resize output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- c1_out.resize (current_row, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tmp.setfield ("c1", c1_out);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output.assign (idx_vector(m-mindim), tmp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ dim_vector dv (maxdim - mindim + 1, 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ string_vector keys;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ keys.append (std::string("dim"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ keys.append (std::string("c1"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_map output (dv, keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Seed the rand() function for d1()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ F77_XFCN (rand, RAND, (sqrt(seed)));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type m = mindim; m <= maxdim; m++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_scalar_map tmp (keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tmp.setfield ("dim", m);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Creat c1 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix c1_out ((octave_idx_type) ((0 - log (1./(lines_read
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ -(m-1) * delay)) +
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (log (2.) /resolution))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ / (log (2.) /resolution))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ , 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double pr = 0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type current_row = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (double pl = log (1./(lines_read - (m-1)*delay));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pl <= 0.0; pl += log (2.) / resolution)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double pln = pl;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double rln;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ F77_XFCN (d1, D1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (lines_read, columns_read, lines_read,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ input.fortran_vec (), delay, m, cmin,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pr, pln, rln, tmin, kmax, iverb));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (pln != pr)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pr = pln;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ c1_out(current_row,0) = exp (rln);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ c1_out(current_row,1) = exp (pln);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ current_row += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Resize output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ c1_out.resize (current_row, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tmp.setfield ("c1", c1_out);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output.assign (idx_vector(m-mindim), tmp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__d2__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__d2__.cc Mon Aug 26 12:51:20 2019 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__d2__.cc Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -365,251 +365,247 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ time_t lasttime;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ time(&lasttime);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ bool imin_too_large = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ bool pause_calc = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Calculate the outputs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type n = 1 + counter; n < nmax && !imin_too_large
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ && !pause_calc; n++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- bool imin_too_large = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- bool pause_calc = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Calculate the outputs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type n = 1 + counter; n < nmax && !imin_too_large
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- && !pause_calc; n++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ counter += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ bool smaller = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type sn = scr[n-1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double epsinv = 1.0 / EPSMAX;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type x,y;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (DIM > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- counter += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- bool smaller = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type sn = scr[n-1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double epsinv = 1.0 / EPSMAX;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type x,y;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (DIM > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- x=(octave_idx_type)(series[0][sn]*epsinv)&(NMAX-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- y=(octave_idx_type)(series[1][sn]*epsinv)&(NMAX-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- x=(octave_idx_type)(series[0][sn]*epsinv)&(NMAX-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- y=(octave_idx_type)(series[0][sn+DELAY]*epsinv)&(NMAX-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- list[sn]=box[x][y];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- box[x][y]=sn;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- listc1[sn]=boxc1[x];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- boxc1[x]=sn;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ x=(octave_idx_type)(series[0][sn]*epsinv)&(NMAX-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ y=(octave_idx_type)(series[1][sn]*epsinv)&(NMAX-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ x=(octave_idx_type)(series[0][sn]*epsinv)&(NMAX-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ y=(octave_idx_type)(series[0][sn+DELAY]*epsinv)&(NMAX-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ list[sn]=box[x][y];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ box[x][y]=sn;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ listc1[sn]=boxc1[x];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ boxc1[x]=sn;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type i=imin;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- while (found[maxembed][i] >= MAXFOUND)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- smaller=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (++i > (HOWOFTEN-1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (smaller)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- imin=i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (imin <= (HOWOFTEN-1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- EPSMAX = epsm[imin];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double epsinv = 1.0/EPSMAX;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i1=0;i1<NMAX;i1++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- boxc1[i1]= -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j1=0;j1<NMAX;j1++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- box[i1][j1]= -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i1=0;i1<n;i1++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sn=scr[i1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type x,y;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (DIM > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- x=(octave_idx_type)(series[0][sn]*epsinv)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- &(NMAX-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- y=(octave_idx_type)(series[1][sn]*epsinv)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- &(NMAX-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- x=(octave_idx_type)(series[0][sn]*epsinv)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- &(NMAX-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- y=(octave_idx_type)(series[0][sn+DELAY]*epsinv)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- &(NMAX-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- list[sn]=box[x][y];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- box[x][y]=sn;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- listc1[sn]=boxc1[x];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- boxc1[x]=sn;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type i=imin;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (found[maxembed][i] >= MAXFOUND)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ smaller=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (++i > (HOWOFTEN-1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (smaller)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ imin=i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (imin <= (HOWOFTEN-1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type lnorm=n;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (MINDIST > 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EPSMAX = epsm[imin];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double epsinv = 1.0/EPSMAX;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i1=0;i1<NMAX;i1++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type sn=scr[n];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type n1=(sn-MINDIST>=0)?sn-MINDIST:0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type n2=(sn+MINDIST<length-(EMBED-1)*DELAY)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ?sn+MINDIST:length-(EMBED-1)*DELAY-1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i1=n1;i1<=n2;i1++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((oscr[i1] < n))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- lnorm--;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ boxc1[i1]= -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j1=0;j1<NMAX;j1++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ box[i1][j1]= -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (EMBED*DIM > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_c2_dim(series, found, list, box, DIM, imin, EPSMAX1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- EPSMAX, EPSMIN, EMBED, DELAY, MINDIST,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- HOWOFTEN, scr[n]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_c2_1(series, found, listc1, boxc1, imin, EPSMAX1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- EPSMAX, EPSMIN, MINDIST, HOWOFTEN, scr[n]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=imin;i<HOWOFTEN;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- norm[i] += (double)(lnorm);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // If any of the below occurs: pause or end.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (((time(NULL)-lasttime) > WHEN) || (n == (nmax-1)) ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (imin > (HOWOFTEN-1)) || (counter % it_pause == 0))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- time(&lasttime);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (imin > (HOWOFTEN-1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i1=0;i1<n;i1++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old exit(0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- imin_too_large = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sn=scr[i1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type x,y;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (DIM > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ x=(octave_idx_type)(series[0][sn]*epsinv)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &(NMAX-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ y=(octave_idx_type)(series[1][sn]*epsinv)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &(NMAX-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ x=(octave_idx_type)(series[0][sn]*epsinv)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &(NMAX-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ y=(octave_idx_type)(series[0][sn+DELAY]*epsinv)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ &(NMAX-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ list[sn]=box[x][y];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ box[x][y]=sn;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ listc1[sn]=boxc1[x];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ boxc1[x]=sn;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pause_calc = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create vars output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_scalar_map vars;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create vars output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(fstat,"Center points treated so far= %ld\n",n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vars.setfield ("treated", counter);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(fstat,"Maximum epsilon in the moment= %e\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // epsm[imin]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vars.setfield ("eps", epsm[imin]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (counter < nmax - 1 && imin_too_large == false)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (imin <= (HOWOFTEN-1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vars.setfield ("counter", counter);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vars.setfield ("found", found_matrix);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vars.setfield ("norm", norm_matrix);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vars.setfield ("boxc1", boxc1_matrix);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vars.setfield ("box", box_matrix);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vars.setfield ("list", list_matrix);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vars.setfield ("listc1", listc1_matrix);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vars.setfield ("imin", imin);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vars.setfield ("EPSMAX1",EPSMAX1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vars.setfield ("EPSMAX", EPSMAX);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vars.setfield ("EPSMIN", EPSMIN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create values output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- dim_vector dv (DIM * EMBED, 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- string_vector keys;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- keys.append (std::string("dim"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- keys.append (std::string("c2"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- keys.append (std::string("d2"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- keys.append (std::string("h2"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_map values (dv, keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<DIM*EMBED;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_scalar_map tmp (keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(fout,"#dim= %ld\n",i+1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tmp.setfield ("dim", i+1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Allocate d2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix d2_out (HOWOFTEN - 1, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type d2_row = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Allocate h2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix h2_out (HOWOFTEN, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type h2_row = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Allocate c2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix c2_out (HOWOFTEN, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type c2_row = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double eps = EPSMAX1 * epsfactor;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<HOWOFTEN;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type lnorm=n;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (MINDIST > 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- eps /= epsfactor;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type sn=scr[n];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type n1=(sn-MINDIST>=0)?sn-MINDIST:0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type n2=(sn+MINDIST<length-(EMBED-1)*DELAY)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ?sn+MINDIST:length-(EMBED-1)*DELAY-1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i1=n1;i1<=n2;i1++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((oscr[i1] < n))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ lnorm--;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Calculate d2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((j > 0) && (found[i][j] > 0.0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- && (found[i][j-1] > 0.0))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(fout,"%e %e\n",eps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // log(found[i][j-1]/found[i][j]/norm[j-1]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // *norm[j])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // /log(epsfactor));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- d2_out(d2_row,0) = eps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- d2_out(d2_row,1) = log(found[i][j-1]/found[i][j]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /norm[j-1]*norm[j])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /log(epsfactor);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- d2_row += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Calculate h2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (i < 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (found[0][j] > 0.0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(fout,"%e %e\n",eps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // -log(found[0][j]/norm[j]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- h2_out(h2_row,0) = eps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- h2_out(h2_row,1) = -log(found[0][j]/norm[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- h2_row += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((found[i-1][j] > 0.0) && (found[i][j] > 0.0))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(fout,"%e %e\n",eps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // log(found[i-1][j]/found[i][j]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- h2_out(h2_row,0) = eps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- h2_out(h2_row,1) = log(found[i-1][j]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /found[i][j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- h2_row += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Calculate c2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (norm[j] > 0.0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(fout,"%e %e\n",eps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // found[i][j]/norm[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- c2_out(c2_row,0) = eps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- c2_out(c2_row,1) = found[i][j]/norm[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- c2_row += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Prepare d2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- d2_out.resize (d2_row, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tmp.setfield ("d2", d2_out);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Prepare h2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- h2_out.resize (h2_row, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tmp.setfield ("h2", h2_out);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Prepare c2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- c2_out.resize (c2_row, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tmp.setfield ("c2", c2_out);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- values.assign (idx_vector(i), tmp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (EMBED*DIM > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_c2_dim(series, found, list, box, DIM, imin, EPSMAX1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EPSMAX, EPSMIN, EMBED, DELAY, MINDIST,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ HOWOFTEN, scr[n]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_c2_1(series, found, listc1, boxc1, imin, EPSMAX1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EPSMAX, EPSMIN, MINDIST, HOWOFTEN, scr[n]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=imin;i<HOWOFTEN;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ norm[i] += (double)(lnorm);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Assign outputs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = values;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(1) = vars;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // If any of the below occurs: pause or end.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (((time(NULL)-lasttime) > WHEN) || (n == (nmax-1)) ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (imin > (HOWOFTEN-1)) || (counter % it_pause == 0))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ time(&lasttime);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (imin > (HOWOFTEN-1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old exit(0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ imin_too_large = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pause_calc = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create vars output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_scalar_map vars;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create vars output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(fstat,"Center points treated so far= %ld\n",n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vars.setfield ("treated", counter);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(fstat,"Maximum epsilon in the moment= %e\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // epsm[imin]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vars.setfield ("eps", epsm[imin]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (counter < nmax - 1 && imin_too_large == false)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vars.setfield ("counter", counter);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vars.setfield ("found", found_matrix);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vars.setfield ("norm", norm_matrix);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vars.setfield ("boxc1", boxc1_matrix);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vars.setfield ("box", box_matrix);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vars.setfield ("list", list_matrix);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vars.setfield ("listc1", listc1_matrix);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vars.setfield ("imin", imin);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vars.setfield ("EPSMAX1",EPSMAX1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vars.setfield ("EPSMAX", EPSMAX);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vars.setfield ("EPSMIN", EPSMIN);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create values output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ dim_vector dv (DIM * EMBED, 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ string_vector keys;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ keys.append (std::string("dim"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ keys.append (std::string("c2"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ keys.append (std::string("d2"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ keys.append (std::string("h2"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_map values (dv, keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<DIM*EMBED;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_scalar_map tmp (keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(fout,"#dim= %ld\n",i+1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tmp.setfield ("dim", i+1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Allocate d2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix d2_out (HOWOFTEN - 1, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type d2_row = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Allocate h2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix h2_out (HOWOFTEN, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type h2_row = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Allocate c2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix c2_out (HOWOFTEN, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type c2_row = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double eps = EPSMAX1 * epsfactor;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<HOWOFTEN;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ eps /= epsfactor;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Calculate d2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((j > 0) && (found[i][j] > 0.0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ && (found[i][j-1] > 0.0))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(fout,"%e %e\n",eps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // log(found[i][j-1]/found[i][j]/norm[j-1]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // *norm[j])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // /log(epsfactor));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ d2_out(d2_row,0) = eps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ d2_out(d2_row,1) = log(found[i][j-1]/found[i][j]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /norm[j-1]*norm[j])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /log(epsfactor);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ d2_row += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Calculate h2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (i < 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (found[0][j] > 0.0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(fout,"%e %e\n",eps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // -log(found[0][j]/norm[j]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ h2_out(h2_row,0) = eps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ h2_out(h2_row,1) = -log(found[0][j]/norm[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ h2_row += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((found[i-1][j] > 0.0) && (found[i][j] > 0.0))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(fout,"%e %e\n",eps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // log(found[i-1][j]/found[i][j]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ h2_out(h2_row,0) = eps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ h2_out(h2_row,1) = log(found[i-1][j]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /found[i][j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ h2_row += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Calculate c2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (norm[j] > 0.0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(fout,"%e %e\n",eps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // found[i][j]/norm[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ c2_out(c2_row,0) = eps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ c2_out(c2_row,1) = found[i][j]/norm[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ c2_row += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Prepare d2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ d2_out.resize (d2_row, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tmp.setfield ("d2", d2_out);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Prepare h2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ h2_out.resize (h2_row, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tmp.setfield ("h2", h2_out);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Prepare c2 output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ c2_out.resize (c2_row, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tmp.setfield ("c2", c2_out);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ values.assign (idx_vector(i), tmp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Assign outputs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = values;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(1) = vars;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__delay__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__delay__.cc Mon Aug 26 12:51:20 2019 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__delay__.cc Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -60,56 +60,52 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ OCTAVE_LOCAL_BUFFER (octave_idx_type, inddelay, alldim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type rundel=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type runmdel=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- unsigned int delsum;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i = 0; i < indim; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- delsum = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- inddelay[rundel++] = delsum;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j = 1; j < formatdelay(i); j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- delsum += delaylist(runmdel++);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- inddelay[rundel++] = delsum;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type maxemb = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i = 0; i < alldim; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- maxemb = (maxemb < inddelay[i])? inddelay[i] : maxemb;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type rundel=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type runmdel=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type outdim = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i = 0; i < indim; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- outdim += formatdelay(i);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type out_rows = (length > maxemb) ? length - maxemb : 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix series (out_rows, outdim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- unsigned int embsum;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i = maxemb; i < length; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- rundel = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- embsum = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ unsigned int delsum;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i = 0; i < indim; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ delsum = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ inddelay[rundel++] = delsum;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j = 0; j < indim; j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type emb = formatdelay(j);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type k = 0; k < emb; k++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- series(i-maxemb, embsum+k) = data(i-inddelay[rundel++], j);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // previously fprintf(stdout,"%e ",series[j][i-inddelay[rundel++]]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- embsum += emb;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // previously fprintf(stdout,"\n");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j = 1; j < formatdelay(i); j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ delsum += delaylist(runmdel++);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ inddelay[rundel++] = delsum;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = series;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type maxemb = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i = 0; i < alldim; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ maxemb = (maxemb < inddelay[i])? inddelay[i] : maxemb;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type outdim = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i = 0; i < indim; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ outdim += formatdelay(i);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type out_rows = (length > maxemb) ? length - maxemb : 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix series (out_rows, outdim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ unsigned int embsum;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i = maxemb; i < length; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ rundel = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ embsum = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j = 0; j < indim; j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type emb = formatdelay(j);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type k = 0; k < emb; k++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ series(i-maxemb, embsum+k) = data(i-inddelay[rundel++], j);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // previously fprintf(stdout,"%e ",series[j][i-inddelay[rundel++]]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ embsum += emb;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // previously fprintf(stdout,"\n");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = series;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__false_nearest__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__false_nearest__.cc Mon Aug 26 12:51:20 2019 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__false_nearest__.cc Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -179,78 +179,75 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ check_alloc(vcomp=(unsigned int*)malloc(sizeof(int)*(maxdim)));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ check_alloc(vemb=(unsigned int*)malloc(sizeof(int)*(maxdim)));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ( ! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i=0;i<maxdim;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (comp == 1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vcomp[i]=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vemb[i]=i*delay;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vcomp[i]=i%comp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vemb[i]=(i/comp)*delay;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i=0;i<maxdim;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (comp == 1) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vcomp[i]=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vemb[i]=i*delay;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vcomp[i]=i%comp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vemb[i]=(i/comp)*delay;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create output matrix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix output (maxemb-minemb+1, 4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create output matrix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix output (maxemb-minemb+1, 4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Compute output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (emb=minemb;emb<=maxemb;emb++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- dim=emb*comp-1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon=eps0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- toolarge=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- alldone=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- donesofar=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aveps=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vareps=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i=0;i<length;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- nearest[i]=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (verbosity)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_stdout << "Start for dimension=" << dim+1 << "\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- while (!alldone && (epsilon < 2.*varianz/rt)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- alldone=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mmb(input, vcomp[dim],vemb[dim],epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i=0;i<length-maxemb*delay;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!nearest[i]) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- nearest[i]=find_nearest(input, i,dim,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- alldone &= nearest[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- donesofar += (unsigned long)nearest[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (verbosity)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_stdout << "Found " << donesofar << " up to epsilon=" << \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon*inter << "\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon*=sqrt(2.0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!donesofar)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- eps0=epsilon;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (donesofar == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- error_with_id ("Octave:tisean", "Not enough points found");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aveps *= (1./(double)donesofar);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- vareps *= (1./(double)donesofar);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Compute output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (emb=minemb;emb<=maxemb;emb++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ dim=emb*comp-1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon=eps0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ toolarge=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ alldone=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ donesofar=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aveps=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vareps=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i=0;i<length;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ nearest[i]=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (verbosity)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_stdout << "Start for dimension=" << dim+1 << "\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (!alldone && (epsilon < 2.*varianz/rt)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ alldone=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mmb(input, vcomp[dim],vemb[dim],epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i=0;i<length-maxemb*delay;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!nearest[i]) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ nearest[i]=find_nearest(input, i,dim,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ alldone &= nearest[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ donesofar += (unsigned long)nearest[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (verbosity)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_stdout << "Found " << donesofar << " up to epsilon=" << \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon*inter << "\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon*=sqrt(2.0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!donesofar)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ eps0=epsilon;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (donesofar == 0) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ error_with_id ("Octave:tisean", "Not enough points found");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aveps *= (1./(double)donesofar);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ vareps *= (1./(double)donesofar);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(file,"%u %e %e %e\n",dim+1,(double)toolarge/(double)donesofar,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // aveps*inter,sqrt(vareps)*inter);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int id = emb-minemb;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(id,0) = dim + 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(id,1) = (double)toolarge/(double)donesofar;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(id,2) = aveps*inter;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(id,3) = sqrt(vareps)*inter;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(file,"%u %e %e %e\n",dim+1,(double)toolarge/(double)donesofar,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // aveps*inter,sqrt(vareps)*inter);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int id = emb-minemb;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(id,0) = dim + 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(id,1) = (double)toolarge/(double)donesofar;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(id,2) = aveps*inter;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(id,3) = sqrt(vareps)*inter;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- delete[] series;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- delete[] list;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- delete[] nearest;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i=0;i<BOX;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- delete[] box[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- delete[] box;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ delete[] series;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ delete[] list;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ delete[] nearest;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i=0;i<BOX;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ delete[] box[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ delete[] box;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i = 0; i < 4; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(i) = output.column(i);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i = 0; i < 4; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(i) = output.column(i);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__ghkss__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__ghkss__.cc Mon Aug 26 12:51:20 2019 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__ghkss__.cc Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -203,42 +203,39 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ OCTAVE_LOCAL_BUFFER (double, hav, comp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ OCTAVE_LOCAL_BUFFER (double, hsigma, comp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ( ! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (j=0;j<comp;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hav[j]=hsigma[j]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (j=0;j<comp;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hav[j]=hsigma[j]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i=0;i<length;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (j=0;j<comp;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hav[j] += (help=delta[j][i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hsigma[j] += help*help;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i=0;i<length;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (j=0;j<comp;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hav[j] += (help=delta[j][i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hsigma[j] += help*help;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (j=0;j<comp;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hav[j] /= length;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hsigma[j]=sqrt(fabs(hsigma[j]/length-hav[j]*hav[j]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (verbosity) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i=0;i<comp;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_stdout << "Average shift of component " << i+1 << " = "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- << hav[i]*d_max[i] << "\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_stdout << "Average rms correction of comp. " << i+1 << " = "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- << hsigma[i]*d_max[i] << "\n\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i=0;i<length;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (j=0;j<comp;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- series(i,j) -= delta[j][i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (j=0;j<comp;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hav[j] /= length;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hsigma[j]=sqrt(fabs(hsigma[j]/length-hav[j]*hav[j]));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (verbosity) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i=0;i<comp;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_stdout << "Average shift of component " << i+1 << " = "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ << hav[i]*d_max[i] << "\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_stdout << "Average rms correction of comp. " << i+1 << " = "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ << hsigma[i]*d_max[i] << "\n\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i=0;i<length;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (j=0;j<comp;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ series(i,j) -= delta[j][i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (resize_eps) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mineps /= epsfac;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (verbosity)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_stdout << "Reset minimal neighbourhood size to "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- << mineps*d_max_max << "\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (resize_eps) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mineps /= epsfac;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (verbosity)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_stdout << "Reset minimal neighbourhood size to "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ << mineps*d_max_max << "\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- resize_eps=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ resize_eps=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DEFUN_DLD (__ghkss__, args, , HELPTEXT)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -338,92 +335,90 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ mat[i]=(double*)(matarray+dim*i);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ check_alloc(hser=(double**)malloc(sizeof(double*)*comp));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ( ! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create output matrix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix output (length, comp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create output matrix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix output (length, comp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i=0;i<dim;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- index_comp[i]=i%comp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- index_embed[i]=(i/comp)*delay;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i=0;i<dim;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ index_comp[i]=i%comp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ index_embed[i]=(i/comp)*delay;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Calculate the noise reduction
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- resize_eps=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (iter=1;iter<=iterations;iter++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i=0;i<length;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ok[i]=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- corr[i][j]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (j=0;j<comp;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- delta[j][i]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Calculate the noise reduction
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ resize_eps=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (iter=1;iter<=iterations;iter++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i=0;i<length;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ok[i]=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ corr[i][j]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (j=0;j<comp;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ delta[j][i]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon=mineps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ all_done=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epscount=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ allfound=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (verbosity)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_stdout << "Starting iteration " << iter << "\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while(!all_done) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mmb(input, epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ all_done=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (n=emb_offset;n<length;n++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!ok[n]) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ nfound=fmn(input,n,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (nfound >= minn) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_correction(input,n,nfound);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ok[n]=epscount;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (epscount == 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ resize_eps=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ allfound++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon=mineps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- all_done=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epscount=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- allfound=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (verbosity)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_stdout << "Starting iteration " << iter << "\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- while(!all_done) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mmb(input, epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- all_done=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (n=emb_offset;n<length;n++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!ok[n]) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- nfound=fmn(input,n,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (nfound >= minn) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_correction(input,n,nfound);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ok[n]=epscount;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (epscount == 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- resize_eps=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- allfound++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ all_done=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (verbosity)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_stdout << "Corrected " << allfound << " points with epsilon= "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ << epsilon*d_max_max << "\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (std::isinf(epsilon*d_max_max))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ error_with_id ("Octave:tisean", "cannot reduce noise on input data");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon *= epsfac;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epscount++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (verbosity)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_stdout << "Start evaluating the trend\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon=mineps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ allfound=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i=1;i<epscount;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mmb(input,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (n=emb_offset;n<length;n++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (ok[n] == i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ nfound=fmn(input,n,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ handle_trend(n,nfound);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ allfound++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (verbosity)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_stdout << "Trend subtracted for " << allfound << " points with epsilon= "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ << epsilon*d_max_max << "\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon *= epsfac;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_correction(input);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (iter == iterations)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i=0;i<length;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (j=0;j<comp;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(file,"%e ",series[j][i]*d_max[j]+d_min[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(i,j) = input(i,j)*d_max[j]+d_min[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- all_done=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (verbosity)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_stdout << "Corrected " << allfound << " points with epsilon= "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- << epsilon*d_max_max << "\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (std::isinf(epsilon*d_max_max))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- error_with_id ("Octave:tisean", "cannot reduce noise on input data");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon *= epsfac;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epscount++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (verbosity)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_stdout << "Start evaluating the trend\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon=mineps;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- allfound=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i=1;i<epscount;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mmb(input,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (n=emb_offset;n<length;n++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (ok[n] == i) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- nfound=fmn(input,n,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- handle_trend(n,nfound);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- allfound++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (verbosity)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_stdout << "Trend subtracted for " << allfound << " points with epsilon= "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- << epsilon*d_max_max << "\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon *= epsfac;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_correction(input);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (iter == iterations)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i=0;i<length;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (j=0;j<comp;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(file,"%e ",series[j][i]*d_max[j]+d_min[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(i,j) = input(i,j)*d_max[j]+d_min[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // Deallocate of all the memory
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ delete[] d_min;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ delete[] d_max;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__lfo_ar__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__lfo_ar__.cc.orig 2015-08-14 17:25:52.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__lfo_ar__.cc 2023-03-10 05:42:42.000000000 -0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -168,12 +168,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Matrix solved_vec = mat.solve(vec);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ double *solved_vec_arr = solved_vec.fortran_vec ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // If errors were raised, there is no sense in countinueing
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ double cast=foreav[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (octave_idx_type j=0;j<dim;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -262,110 +256,100 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ octave_idx_type clength=(CLENGTH <= LENGTH) ? CLENGTH-STEP : LENGTH-STEP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ( ! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Promote warnings connected with singular matrixes to errors
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_warning_state ("Octave:nearly-singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_warning_state ("Octave:singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Estimate maximum possible output size
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type output_rows = (octave_idx_type)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ((log(EPS1) - log(EPS0)) / log (EPSF));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output_rows += 2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix output (output_rows,dim+4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type count = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (verbose)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- printf("\nStarting new dataset\n\n");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (double epsilon=EPS0;epsilon<EPS1*EPSF;epsilon*=EPSF)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (verbose)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- printf ("For epsilon = %e, the count = %d\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon,count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- fflush (stdout);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- long pfound=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<dim;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- error_array[i]=hrms[i]=hav[i]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double avfound=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_multi_box(series,box,list,LENGTH-STEP,NMAX,dim,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- embed,delay,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=(embed-1)*delay;i<clength;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hser[j] = series[j] + i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type actfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- actfound=find_multi_neighbors(series,box,list,hser,NMAX,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- dim,embed,delay, epsilon,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hfound);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- actfound=exclude_interval(actfound,i-causal+1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- i+causal+(embed-1) *delay-1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hfound,found);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (actfound > 2*(dim*embed+1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_fit (series, found, error_array,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- i,dim, embed, delay, STEP, actfound);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Checking if the fit was correct
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // If any errors were raised: end function
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pfound++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- avfound += (double)(actfound-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hrms[j] += series[j][i+STEP] * series[j][i+STEP];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hav[j] += series[j][i+STEP];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (pfound > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double sumerror=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hav[j] /= pfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hrms[j]=sqrt(fabs(hrms[j]/(pfound-1)-hav[j]*hav[j]*pfound
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /(pfound-1)));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- error_array[j]=sqrt(error_array[j]/pfound)/hrms[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sumerror += error_array[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"%e %e ",epsilon*interval,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // sumerror/(double)dim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(count, 0) = epsilon*interval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(count, 1) = sumerror/(double)dim;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- //old fprintf(stdout,"%e ",error_array[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(count, 2 + j) = error_array[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"%e %e\n",(double)pfound
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // /(clength-(embed-1)*delay),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // avfound/pfound);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(count, 2 + dim) = (double)pfound
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /(clength-(embed-1)*delay);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(count, 2 + dim + 1) = avfound/pfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- count += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Resize output to fit actual results instead of
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // an educated guess
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // if count == 0 then the output will be an 0x4+dim matrix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output.resize (count, dim + 4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Promote warnings connected with singular matrixes to errors
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_warning_state ("Octave:nearly-singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_warning_state ("Octave:singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Estimate maximum possible output size
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type output_rows = (octave_idx_type)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ((log(EPS1) - log(EPS0)) / log (EPSF));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output_rows += 2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix output (output_rows,dim+4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type count = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (verbose)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ printf("\nStarting new dataset\n\n");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (double epsilon=EPS0;epsilon<EPS1*EPSF;epsilon*=EPSF)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (verbose)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ printf ("For epsilon = %e, the count = %d\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon,count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ fflush (stdout);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ long pfound=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<dim;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ error_array[i]=hrms[i]=hav[i]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double avfound=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_multi_box(series,box,list,LENGTH-STEP,NMAX,dim,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ embed,delay,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=(embed-1)*delay;i<clength;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hser[j] = series[j] + i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type actfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ actfound=find_multi_neighbors(series,box,list,hser,NMAX,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ dim,embed,delay, epsilon,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hfound);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ actfound=exclude_interval(actfound,i-causal+1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ i+causal+(embed-1) *delay-1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hfound,found);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (actfound > 2*(dim*embed+1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_fit (series, found, error_array,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ i,dim, embed, delay, STEP, actfound);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pfound++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ avfound += (double)(actfound-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hrms[j] += series[j][i+STEP] * series[j][i+STEP];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hav[j] += series[j][i+STEP];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (pfound > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double sumerror=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hav[j] /= pfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hrms[j]=sqrt(fabs(hrms[j]/(pfound-1)-hav[j]*hav[j]*pfound
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /(pfound-1)));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ error_array[j]=sqrt(error_array[j]/pfound)/hrms[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sumerror += error_array[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"%e %e ",epsilon*interval,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // sumerror/(double)dim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(count, 0) = epsilon*interval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(count, 1) = sumerror/(double)dim;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ //old fprintf(stdout,"%e ",error_array[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(count, 2 + j) = error_array[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"%e %e\n",(double)pfound
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // /(clength-(embed-1)*delay),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // avfound/pfound);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(count, 2 + dim) = (double)pfound
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /(clength-(embed-1)*delay);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(count, 2 + dim + 1) = avfound/pfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ count += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Resize output to fit actual results instead of
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // an educated guess
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // if count == 0 then the output will be an 0x4+dim matrix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output.resize (count, dim + 4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__lfo_run__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__lfo_run__.cc Mon Aug 26 12:51:20 2019 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__lfo_run__.cc Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -226,13 +226,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Matrix solved_vec = mat.solve (vec);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ double *solved_vec_arr = solved_vec.fortran_vec ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // If errors were raised (a singular matrix was encountered),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // there is no sense in countinuing
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ newcast[i]=foreav[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (octave_idx_type j=0;j<dim;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (octave_idx_type j1=0;j1<embed;j1++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -330,87 +323,76 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (octave_idx_type i=0;i<hdim;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ cast[i][j]=series[j][LENGTH-hdim+i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ( ! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Promote warnings connected with singular matrixes to errors
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_warning_state ("Octave:nearly-singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_warning_state ("Octave:singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Promote warnings connected with singular matrixes to errors
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_warning_state ("Octave:nearly-singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_warning_state ("Octave:singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Calculate the maximum epsilon that makes sense
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // On the basis of 'i' and 'j' from put_in_boxes ()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- NDArray input_max = input.max ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double maximum_epsilon = (input_max(0) > input_max(dim-1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ? input_max(0) : input_max(dim-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- maximum_epsilon *= EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Calculate the maximum epsilon that makes sense
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // On the basis of 'i' and 'j' from put_in_boxes ()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NDArray input_max = input.max ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double maximum_epsilon = (input_max(0) > input_max(dim-1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ? input_max(0) : input_max(dim-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ maximum_epsilon *= EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix output (FLENGTH, dim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<FLENGTH;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix output (FLENGTH, dim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<FLENGTH;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ bool done=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double epsilon=EPS0/EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (!done)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- bool done=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double epsilon=EPS0/EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- while (!done)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // If epsilon became too large
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // there is no sense in continuing
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (epsilon > maximum_epsilon)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // If epsilon became too large
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // there is no sense in continuing
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (epsilon > maximum_epsilon)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ error_with_id ("Octave:tisean", "The neighbourhood size"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ " became too large during search,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ " no sense continuing");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon*=EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ put_in_boxes(series, LENGTH, list, box, epsilon, dim, embed,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ DELAY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type actfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ actfound=hfind_neighbors (series, cast, found, list, box,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon, dim, embed, DELAY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (actfound >= MINN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!do_zeroth)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_fit(series, cast, found, dim, embed, DELAY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ actfound, newcast);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_zeroth(series, found, dim, actfound,newcast);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- error_with_id ("Octave:tisean", "The neighbourhood size"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- " became too large during search,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- " no sense continuing");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old printf("%e ",newcast[j]*interval[j]+min_array[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(i,j) = newcast[j]*interval[j]+min_array[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon*=EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- put_in_boxes(series, LENGTH, list, box, epsilon, dim, embed,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- DELAY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type actfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- actfound=hfind_neighbors (series, cast, found, list, box,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon, dim, embed, DELAY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (actfound >= MINN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ done=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!do_zeroth)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_fit(series, cast, found, dim, embed, DELAY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- actfound, newcast);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_zeroth(series, found, dim, actfound,newcast);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Checking if the fit was correct
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // If any errors were raised: end function
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // If this occurs there is no sense to continue
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((newcast[j] > 2.0) || (newcast[j] < -1.0))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ error_with_id("Octave:tisean","forecast failed, "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ "escaping data region");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old printf("%e ",newcast[j]*interval[j]+min_array[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(i,j) = newcast[j]*interval[j]+min_array[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- done=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // If this occurs there is no sense to continue
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((newcast[j] > 2.0) || (newcast[j] < -1.0))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- error_with_id("Octave:tisean","forecast failed, "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- "escaping data region");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double *swap=cast[0];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<hdim-1;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cast[j]=cast[j+1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cast[hdim-1]=swap;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cast[hdim-1][j]=newcast[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double *swap=cast[0];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<hdim-1;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cast[j]=cast[j+1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cast[hdim-1]=swap;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cast[hdim-1][j]=newcast[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__lyap_k__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__lyap_k__.cc Mon Aug 26 12:51:20 2019 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__lyap_k__.cc Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -211,70 +211,67 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ eps_fak=pow(epsmax/epsmin,1.0/(double)(epscount-1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Calculate exponents
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ dim_vector dv (epscount ,((int)maxdim-(int)mindim + 1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ string_vector keys;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ keys.append (std::string("eps"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ keys.append (std::string("dim"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ keys.append (std::string("exp"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_map output (dv,keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type l=0;l<epscount;l++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Calculate exponents
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- dim_vector dv (epscount ,((int)maxdim-(int)mindim + 1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- string_vector keys;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- keys.append (std::string("eps"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- keys.append (std::string("dim"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- keys.append (std::string("exp"));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_map output (dv,keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type l=0;l<epscount;l++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double epsilon=epsmin*pow(eps_fak,(double)l);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<maxdim-1;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<=maxiter;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ count[i][j]=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ lyap[i][j]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ put_in_boxes(series, liste, box, length, maxdim, delay, maxiter,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<reference;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double epsilon=epsmin*pow(eps_fak,(double)l);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<maxdim-1;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<=maxiter;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- count[i][j]=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- lyap[i][j]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- put_in_boxes(series, liste, box, length, maxdim, delay, maxiter,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<reference;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- lfind_neighbors(series, lfound, found, liste, box, window,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- maxdim, delay, i,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- iterate_points(series, lyap, count, lfound, found,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- maxdim, mindim, delay, maxiter, i);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ lfind_neighbors(series, lfound, found, liste, box, window,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ maxdim, delay, i,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ iterate_points(series, lyap, count, lfound, found,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ maxdim, mindim, delay, maxiter, i);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (verbose)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- printf("epsilon= %e\n",epsilon*max_val);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Assign output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=mindim-2;i<maxdim-1;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (verbose)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ printf("epsilon= %e\n",epsilon*max_val);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Assign output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=mindim-2;i<maxdim-1;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(fout,"#epsilon= %e dim= %d\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // epsilon*max_val,i+2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_scalar_map tmp (keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tmp.setfield ("eps", epsilon*max_val);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tmp.setfield ("dim", i+2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(fout,"#epsilon= %e dim= %d\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // epsilon*max_val,i+2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_scalar_map tmp (keys);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tmp.setfield ("eps", epsilon*max_val);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tmp.setfield ("dim", i+2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create matrix for the exponent data
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix lyap_exp (maxiter + 1,3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type counter = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<=maxiter;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (count[i][j])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(fout,"%d %e %ld\n",j,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // lyap[i][j]/count[i][j],count[i][j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create matrix for the exponent data
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix lyap_exp (maxiter + 1,3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type counter = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<=maxiter;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (count[i][j])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(fout,"%d %e %ld\n",j,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // lyap[i][j]/count[i][j],count[i][j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- lyap_exp(counter, 0) = j;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- lyap_exp(counter, 1) = lyap[i][j]/count[i][j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- lyap_exp(counter, 2) = count[i][j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- counter += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Resize output to fit actual number of found exponents
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- lyap_exp.resize(counter, 3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tmp.setfield ("exp", lyap_exp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output.assign(idx_vector(l),idx_vector(i-(int)(mindim-2)),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- tmp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ lyap_exp(counter, 0) = j;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ lyap_exp(counter, 1) = lyap[i][j]/count[i][j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ lyap_exp(counter, 2) = count[i][j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ counter += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Resize output to fit actual number of found exponents
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ lyap_exp.resize(counter, 3);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tmp.setfield ("exp", lyap_exp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output.assign(idx_vector(l),idx_vector(i-(int)(mindim-2)),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ tmp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Assign output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Assign output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__lyap_r__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__lyap_r__.cc Mon Aug 26 12:51:20 2019 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__lyap_r__.cc Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -167,64 +167,60 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ octave_idx_type maxlength=length-delay*(dim-1)-steps-1-mindist;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bool alldone=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Calculate the maximum epsilon that makes sense
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // On the basis of 'i' and 'j' from put_in_boxes ()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NDArray input_max = input.max ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double maximum_epsilon = (input_max(0) > input_max(dim-1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ? input_max(0) : input_max(dim-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ maximum_epsilon *= 1.1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Calculate lyapunov exponents
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (double eps=eps0;!alldone;eps*=1.1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Calculate the maximum epsilon that makes sense
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // On the basis of 'i' and 'j' from put_in_boxes ()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- NDArray input_max = input.max ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double maximum_epsilon = (input_max(0) > input_max(dim-1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ? input_max(0) : input_max(dim-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- maximum_epsilon *= 1.1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Calculate lyapunov exponents
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (double eps=eps0;!alldone;eps*=1.1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // If epsilon became too large
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // there is no sense in continuing
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (eps > maximum_epsilon)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // If epsilon became too large
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // there is no sense in continuing
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (eps > maximum_epsilon)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- error_with_id ("Octave:tisean", "The neighbourhood size"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- " became too large during search,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- " no sense continuing");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- put_in_boxes(series, box, list, eps, length, dim, delay, steps);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- alldone=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type n=0;n<=maxlength;n++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!done[n])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- done[n]=make_iterate(series, box, list, found, lyap, eps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- length, dim, delay, steps, mindist,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- alldone &= done[n];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (verbose)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- printf("epsilon: %e already found: %ld\n",eps*max_val,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- found[0]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ error_with_id ("Octave:tisean", "The neighbourhood size"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ " became too large during search,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ " no sense continuing");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix output (steps+1, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type count = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<=steps;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (found[i])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(file,"%d %e\n",i,lyap[i]/found[i]/2.0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(count,0) = i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(count,1) = lyap[i]/found[i]/2.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- count += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ put_in_boxes(series, box, list, eps, length, dim, delay, steps);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ alldone=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type n=0;n<=maxlength;n++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!done[n])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ done[n]=make_iterate(series, box, list, found, lyap, eps,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ length, dim, delay, steps, mindist,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ n);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ alldone &= done[n];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (verbose)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ printf("epsilon: %e already found: %ld\n",eps*max_val,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ found[0]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Resize output to match number of found points
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (count < output.numel ())
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output.resize (count, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix output (steps+1, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type count = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<=steps;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (found[i])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(file,"%d %e\n",i,lyap[i]/found[i]/2.0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(count,0) = i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(count,1) = lyap[i]/found[i]/2.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ count += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Assign output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Resize output to match number of found points
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (count < output.numel ())
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output.resize (count, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Assign output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__lyap_spec__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__lyap_spec__.cc Mon Aug 26 12:51:20 2019 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__lyap_spec__.cc Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -220,13 +220,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Matrix solved = mat.solve (vec);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ double *solved_arr = solved.fortran_vec ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // If errors were raised (a singular matrix was encountered),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // there is no sense in countinuing
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ double new_vec = solved_arr[0];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (octave_idx_type i=1;i<=alldim;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dynamics[d][i-1] = solved_arr[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -419,149 +412,138 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // end old indexes = make_multi_index();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Promote warnings connected with singular matrixes to errors
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_warning_state ("Octave:nearly-singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_warning_state ("Octave:singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Promote warnings connected with singular matrixes to errors
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_warning_state ("Octave:nearly-singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_warning_state ("Octave:singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Prepare data for running first time
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (count == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- averr_matrix.fill (0.0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Prepare data for running first time
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (count == 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ averr_matrix.fill (0.0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (epsset)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsmin /= maxinterval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (epsset)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsmin /= maxinterval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old rnd_init(0x098342L);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- TISEAN_rand generator (0x098342L);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<10000;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- generator.rnd_long();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<alldim;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- factor[i]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<alldim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- delta[i][j] = (double)generator.rnd_long()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- / (double)std::numeric_limits<octave_idx_type>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ::max ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- gram_schmidt(alldim, delta,lfactor);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old rnd_init(0x098342L);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ TISEAN_rand generator (0x098342L);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<10000;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ generator.rnd_long();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<alldim;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ factor[i]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<alldim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ delta[i][j] = (double)generator.rnd_long()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ / (double)std::numeric_limits<octave_idx_type>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ::max ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ gram_schmidt(alldim, delta,lfactor);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- avneig = 0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- aveps = 0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ avneig = 0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ aveps = 0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix lyap_exp (1, 1 + alldim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- time_t lasttime;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- time(&lasttime);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- bool pause_calc = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i = count + (EMBED-1) * DELAY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- i < ITERATIONS && !pause_calc; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix lyap_exp (1, 1 + alldim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ time_t lasttime;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ time(&lasttime);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ bool pause_calc = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i = count + (EMBED-1) * DELAY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ i < ITERATIONS && !pause_calc; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ count++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_dynamics(series, box, indexes, epsmin, epsset, EPSSTEP,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EMBED, MINNEIGHBORS, LENGTH, DIMENSION, count,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ avneig, aveps, dynamics, averr, i);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_iteration(DIMENSION, alldim, dynamics, delta);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ gram_schmidt(alldim, delta,lfactor);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<alldim;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ factor[j] += log(lfactor[j])/(double)DELAY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (((time(NULL)-lasttime) > OUT) || (i == (ITERATIONS-1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ || (count % it_pause == 0) )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- count++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_dynamics(series, box, indexes, epsmin, epsset, EPSSTEP,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- EMBED, MINNEIGHBORS, LENGTH, DIMENSION, count,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- avneig, aveps, dynamics, averr, i);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // If there was an error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // (matrix singularity or not enough neighbors)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // No sense continuing
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ time(&lasttime);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create spectrum output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"%ld ",count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ lyap_exp(0,0) = count;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<alldim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"%e ",factor[j]/count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ lyap_exp(0, 1+j) = factor[j]/count;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_iteration(DIMENSION, alldim, dynamics, delta);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- gram_schmidt(alldim, delta,lfactor);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<alldim;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- factor[j] += log(lfactor[j])/(double)DELAY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (((time(NULL)-lasttime) > OUT) || (i == (ITERATIONS-1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- || (count % it_pause == 0) )
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- time(&lasttime);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create spectrum output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"%ld ",count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- lyap_exp(0,0) = count;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<alldim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"%e ",factor[j]/count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- lyap_exp(0, 1+j) = factor[j]/count;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pause_calc = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pause_calc = true;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create pause output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (count < (ITERATIONS - (EMBED-1)*DELAY))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_scalar_map pause_vars;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pause_vars.setfield ("averr", averr_matrix);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pause_vars.setfield ("delta", delta_matrix);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pause_vars.setfield ("count", count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pause_vars.setfield ("avneig", avneig);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pause_vars.setfield ("aveps", aveps);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pause_vars.setfield ("epsmin", epsmin);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = lyap_exp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(1) = pause_vars;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create pause output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (count < (ITERATIONS - (EMBED-1)*DELAY))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_scalar_map pause_vars;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pause_vars.setfield ("averr", averr_matrix);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pause_vars.setfield ("delta", delta_matrix);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pause_vars.setfield ("count", count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pause_vars.setfield ("avneig", avneig);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pause_vars.setfield ("aveps", aveps);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pause_vars.setfield ("epsmin", epsmin);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = lyap_exp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(1) = pause_vars;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create final output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (count == (ITERATIONS - (EMBED-1)*DELAY))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double dim=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (i=0;i<alldim;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- dim += factor[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (dim < 0.0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (i < alldim)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- dim=i+(dim-factor[i])/fabs(factor[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- dim=alldim;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create final output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (count == (ITERATIONS - (EMBED-1)*DELAY))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double dim=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (i=0;i<alldim;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ dim += factor[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (dim < 0.0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ break;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (i < alldim)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ dim=i+(dim-factor[i])/fabs(factor[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ dim=alldim;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create output pars
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_scalar_map pars;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create output pars
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_scalar_map pars;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create rel_err
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix rel_err (1, DIMENSION);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"#Average relative forecast errors:= ");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<DIMENSION;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"%e ",sqrt(averr[i]/count)/var[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- rel_err(0,i) = sqrt(averr[i]/count)/var[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pars.setfield ("rel_err", rel_err);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create rel_err
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix rel_err (1, DIMENSION);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"#Average relative forecast errors:= ");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<DIMENSION;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"%e ",sqrt(averr[i]/count)/var[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ rel_err(0,i) = sqrt(averr[i]/count)/var[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pars.setfield ("rel_err", rel_err);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create abs_err
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix abs_err (1, DIMENSION);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"#Average absolute forecast errors:= ");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<DIMENSION;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"%e ",sqrt(averr[i]/count)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // *interval[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- abs_err(0,i) = sqrt(averr[i]/count)*interval[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pars.setfield ("abs_err", abs_err);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create abs_err
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix abs_err (1, DIMENSION);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"#Average absolute forecast errors:= ");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<DIMENSION;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"%e ",sqrt(averr[i]/count)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // *interval[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ abs_err(0,i) = sqrt(averr[i]/count)*interval[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pars.setfield ("abs_err", abs_err);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"#Average Neighborhood Size= %e\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // aveps*maxinterval/count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pars.setfield ("nsize", aveps*maxinterval/count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"#Average num. of neighbors= %e\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // avneig/count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pars.setfield ("nno", avneig/count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"#Average Neighborhood Size= %e\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // aveps*maxinterval/count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pars.setfield ("nsize", aveps*maxinterval/count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"#estimated KY-Dimension= %f\n",dim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pars.setfield ("ky_dim", dim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"#Average num. of neighbors= %e\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // avneig/count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pars.setfield ("nno", avneig/count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Assign output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = lyap_exp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(1) = pars;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"#estimated KY-Dimension= %f\n",dim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pars.setfield ("ky_dim", dim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Assign output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = lyap_exp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(1) = pars;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__lzo_gm__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__lzo_gm__.cc Mon Aug 26 12:51:20 2019 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__lzo_gm__.cc Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -110,92 +110,89 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MArray<octave_idx_type> box (dim_vector(NMAX,NMAX));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ( ! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Estimate maximum possible output size
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type output_rows = (octave_idx_type)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ((log(EPS1) - log(EPS0)) / log (EPSF));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output_rows += 2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Estimate maximum possible output size
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type output_rows = (octave_idx_type)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ((log(EPS1) - log(EPS0)) / log (EPSF));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output_rows += 2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix output (output_rows,dim+4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type count = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix output (output_rows,dim+4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type count = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (double epsilon=EPS0;epsilon<EPS1*EPSF;epsilon*=EPSF)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (double epsilon=EPS0;epsilon<EPS1*EPSF;epsilon*=EPSF)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ long pfound=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<dim;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ error_array[i]=hrms[i]=hav[i]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double avfound=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_multi_box(input,box,list,LENGTH-STEP,NMAX,dim,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ embed,delay,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=(embed-1)*delay;i<clength;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- long pfound=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<dim;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- error_array[i]=hrms[i]=hav[i]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double avfound=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_multi_box(input,box,list,LENGTH-STEP,NMAX,dim,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- embed,delay,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=(embed-1)*delay;i<clength;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old hser[j]=series[j]+i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hser[j] = input.fortran_vec() + j * LENGTH + i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type actfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- actfound = find_multi_neighbors(input,box,list,hser,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- NMAX,dim,embed,delay,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon,hfound);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- actfound = exclude_interval(actfound,i-causal+1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- i+causal+(embed-1)*delay-1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hfound,found);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (actfound > 2*(dim*embed+1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_fit (input, dim, i, actfound, STEP, found,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- error_array);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pfound++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- avfound += (double)(actfound-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<dim;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hrms[j] += input(i+STEP,j) * input(i+STEP,j);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hav[j] += input(i+STEP,j);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old hser[j]=series[j]+i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hser[j] = input.fortran_vec() + j * LENGTH + i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (pfound > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type actfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ actfound = find_multi_neighbors(input,box,list,hser,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NMAX,dim,embed,delay,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon,hfound);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ actfound = exclude_interval(actfound,i-causal+1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ i+causal+(embed-1)*delay-1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hfound,found);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (actfound > 2*(dim*embed+1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double sumerror=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hav[j] /= pfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hrms[j]=sqrt(fabs(hrms[j]/(pfound-1)-hav[j]*hav[j]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * pfound/(pfound-1)));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- error_array[j]=sqrt(error_array[j]/pfound)/hrms[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sumerror += error_array[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Write output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"%e %e ",epsilon*interval,sumerror/(double)dim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(count, 0) = epsilon * interval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(count, 1) = sumerror / (double) dim;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"%e ",error_array[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(count, 2 + j) = error_array[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_fit (input, dim, i, actfound, STEP, found,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ error_array);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pfound++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ avfound += (double)(actfound-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<dim;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hrms[j] += input(i+STEP,j) * input(i+STEP,j);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hav[j] += input(i+STEP,j);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"%e %e\n",(double)pfound/(clength-(embed-1)*delay),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // avfound/pfound);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(count,2 + dim) = (double)pfound /
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (clength-(embed-1)*delay);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(count,2 + dim + 1) = avfound/pfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- count += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (pfound > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double sumerror=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hav[j] /= pfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hrms[j]=sqrt(fabs(hrms[j]/(pfound-1)-hav[j]*hav[j]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * pfound/(pfound-1)));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ error_array[j]=sqrt(error_array[j]/pfound)/hrms[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sumerror += error_array[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Resize output to fit actual results instead of
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // an educated guess
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // if count == 0 then the output will be an 0x4+dim matrix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output.resize (count, dim + 4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Write output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"%e %e ",epsilon*interval,sumerror/(double)dim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(count, 0) = epsilon * interval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(count, 1) = sumerror / (double) dim;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"%e ",error_array[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(count, 2 + j) = error_array[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// old fprintf(stdout,"%e %e\n",(double)pfound/(clength-(embed-1)*delay),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// avfound/pfound);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(count,2 + dim) = (double)pfound /
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (clength-(embed-1)*delay);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(count,2 + dim + 1) = avfound/pfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ count += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Resize output to fit actual results instead of
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // an educated guess
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // if count == 0 then the output will be an 0x4+dim matrix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output.resize (count, dim + 4);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__lzo_run__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__lzo_run__.cc.orig 2015-08-14 17:25:52.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__lzo_run__.cc 2023-03-09 19:11:14.000000000 -0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -209,90 +209,87 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MArray<octave_idx_type> box (dim_vector(NMAX,NMAX));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ( ! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<hdim;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cast[i][j]=input(LENGTH-hdim+i,j);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old indexes=make_multi_index(dim,embed,DELAY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type alldim=dim * embed;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- MArray<octave_idx_type> indexes (dim_vector (alldim, 2));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<alldim;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- indexes(i,0)=i%dim;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- indexes(i,1)=(i/dim)*DELAY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // end old index = make_multi_index();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old rnd_init(seed);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- TISEAN_rand generator (seed);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double epsilon0=EPS0/EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (setnoise)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Q /= 100.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix output (FLENGTH, dim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type row_count = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type count = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<FLENGTH;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- bool done=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double epsilon;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (setsort)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon= epsilon0/((double)count*EPSF);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon=epsilon0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- while (!done) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon*=EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- put_in_boxes(input, box, list, epsilon,(embed-1)*DELAY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type actfound=hfind_neighbors(input, indexes, box,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- list, cast, found,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (embed-1) * DELAY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (actfound >= MINN) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (setsort) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon0 += epsilon;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- count++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sort(input, found, abstand, cast, actfound, (embed-1)*DELAY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- actfound=MINN;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_zeroth(input, generator, setnoise, var, Q, found,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- actfound, newcast);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<dim-1;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old printf("%e ",newcast[j]*interval[j]+min[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(row_count, j) = newcast[j]*interval[j]+min[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old printf("%e\n",newcast[dim-1]*interval[dim-1]+min[dim-1]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(row_count, dim-1) = newcast[dim-1]*interval[dim-1]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- + min[dim-1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- row_count += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- done=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double *swap=cast[0];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<hdim-1;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cast[j]=cast[j+1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cast[hdim-1]=swap;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cast[hdim-1][j]=newcast[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (row_count != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output.resize (row_count, dim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = Matrix (0,0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<hdim;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cast[i][j]=input(LENGTH-hdim+i,j);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old indexes=make_multi_index(dim,embed,DELAY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type alldim=dim * embed;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ MArray<octave_idx_type> indexes (dim_vector (alldim, 2));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<alldim;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ indexes(i,0)=i%dim;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ indexes(i,1)=(i/dim)*DELAY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // end old index = make_multi_index();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old rnd_init(seed);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ TISEAN_rand generator (seed);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double epsilon0=EPS0/EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (setnoise)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Q /= 100.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix output (FLENGTH, dim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type row_count = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type count = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<FLENGTH;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ bool done=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double epsilon;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (setsort)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon= epsilon0/((double)count*EPSF);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon=epsilon0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (!done) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon*=EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ put_in_boxes(input, box, list, epsilon,(embed-1)*DELAY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type actfound=hfind_neighbors(input, indexes, box,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ list, cast, found,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (embed-1) * DELAY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (actfound >= MINN) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (setsort) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon0 += epsilon;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ count++;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sort(input, found, abstand, cast, actfound, (embed-1)*DELAY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ actfound=MINN;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_zeroth(input, generator, setnoise, var, Q, found,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ actfound, newcast);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<dim-1;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old printf("%e ",newcast[j]*interval[j]+min[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(row_count, j) = newcast[j]*interval[j]+min[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old printf("%e\n",newcast[dim-1]*interval[dim-1]+min[dim-1]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(row_count, dim-1) = newcast[dim-1]*interval[dim-1]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ + min[dim-1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ row_count += 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ done=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double *swap=cast[0];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<hdim-1;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cast[j]=cast[j+1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cast[hdim-1]=swap;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cast[hdim-1][j]=newcast[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (row_count != 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output.resize (row_count, dim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = Matrix (0,0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__lzo_test__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__lzo_test__.cc Mon Aug 26 12:51:20 2019 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__lzo_test__.cc Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -150,93 +150,90 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ MArray<octave_idx_type> box (dim_vector(NMAX, NMAX));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ // Compute forecast error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ( ! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<LENGTH;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- done[i]=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<LENGTH;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ done[i]=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ bool alldone = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (epsset)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ EPS0 /= interval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- bool alldone = false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (epsset)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- EPS0 /= interval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double epsilon = EPS0 / EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double epsilon = EPS0 / EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!clengthset)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CLENGTH=LENGTH;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type clength = ((CLENGTH*refstep+STEP) <= LENGTH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ? CLENGTH : (LENGTH-STEP)/refstep;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!clengthset)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CLENGTH=LENGTH;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type clength = ((CLENGTH*refstep+STEP) <= LENGTH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ? CLENGTH : (LENGTH-STEP)/refstep;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Compute estimates
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type actfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type hi;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (!alldone) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ alldone=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon*=EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_multi_box(input,box,list,LENGTH-(long)STEP,NMAX,dim,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ embed,DELAY,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=(embed-1)*DELAY;i<clength;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!done[i]) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hi=i*refstep;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++// old hser[j]=series[j]+hi;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hser[j] = input.fortran_vec() + j * LENGTH + hi;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ actfound=find_multi_neighbors(input,box,list,hser,NMAX,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ dim,embed,DELAY,epsilon,hfound);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ actfound=exclude_interval(actfound,hi-(long)causal+1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hi+causal+(embed-1)*DELAY-1,hfound,found);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (actfound >= MINN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (setsort)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sort(input, found, abstand, embed, DELAY, MINN,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ actfound, hser);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ actfound=MINN;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=1;j<=STEP;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_fit(input,dim,hi,actfound,j,found,error_array,diffs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ done[i]=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ alldone &= done[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Compute estimates
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type actfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type hi;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- while (!alldone) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- alldone=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon*=EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_multi_box(input,box,list,LENGTH-(long)STEP,NMAX,dim,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- embed,DELAY,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=(embed-1)*DELAY;i<clength;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!done[i]) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create relative forecast error output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix rel_forecast_err (STEP, dim + 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<STEP;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ rel_forecast_err(i,0) = i + 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"%e ",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // sqrt(error[j][i]/(clength-(embed-1)*DELAY))/rms[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ rel_forecast_err(i,j+1) = sqrt(error_array(i,j)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ /(clength-(embed-1)*DELAY))/rms[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create individual forecast error output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix ind_forecast_err (1,1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (nargout > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ind_forecast_err.resize(clength - (embed-1)*DELAY, dim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=(embed-1)*DELAY;i<clength;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ hi=i*refstep;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-// old hser[j]=series[j]+hi;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hser[j] = input.fortran_vec() + j * LENGTH + hi;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- actfound=find_multi_neighbors(input,box,list,hser,NMAX,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- dim,embed,DELAY,epsilon,hfound);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- actfound=exclude_interval(actfound,hi-(long)causal+1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hi+causal+(embed-1)*DELAY-1,hfound,found);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (actfound >= MINN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (setsort)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sort(input, found, abstand, embed, DELAY, MINN,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- actfound, hser);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- actfound=MINN;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=1;j<=STEP;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_fit(input,dim,hi,actfound,j,found,error_array,diffs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- done[i]=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- alldone &= done[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create relative forecast error output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix rel_forecast_err (STEP, dim + 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<STEP;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- rel_forecast_err(i,0) = i + 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-// old fprintf(stdout,"%e ",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-// sqrt(error[j][i]/(clength-(embed-1)*DELAY))/rms[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- rel_forecast_err(i,j+1) = sqrt(error_array(i,j)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- /(clength-(embed-1)*DELAY))/rms[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"%e ",diffs[j][hi]*hinter[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ind_forecast_err(i-(embed-1)*DELAY,j) = \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ diffs(hi,j)*hinter[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create individual forecast error output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix ind_forecast_err (1,1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (nargout > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ind_forecast_err.resize(clength - (embed-1)*DELAY, dim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=(embed-1)*DELAY;i<clength;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hi=i*refstep;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<dim;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-// old fprintf(stdout,"%e ",diffs[j][hi]*hinter[j]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ind_forecast_err(i-(embed-1)*DELAY,j) = \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- diffs(hi,j)*hinter[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = rel_forecast_err;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(1) = ind_forecast_err;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = rel_forecast_err;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(1) = ind_forecast_err;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__poincare__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__poincare__.cc Mon Aug 26 12:51:20 2019 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__poincare__.cc Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -129,19 +129,16 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ( ! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix output (out_size, embdim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix output (out_size, embdim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type count = poincare (input.fortran_vec(),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- input.numel(), embdim,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- delay, comp, where, direction,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Resize output to fit sections found
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output.resize (count, embdim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type count = poincare (input.fortran_vec(),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ input.numel(), embdim,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ delay, comp, where, direction,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Resize output to fit sections found
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output.resize (count, embdim);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__polynom__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__polynom__.cc Mon Aug 26 12:51:20 2019 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__polynom__.cc Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -222,88 +222,79 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ make_coding(coding_vec,N,N,DIM-1,1,0);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ octave_idx_type *coding = coding_vec.data();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Promote warnings connected with singular matrixes to errors
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_warning_state ("Octave:nearly-singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_warning_state ("Octave:singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Make the fit
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_fit (series, coding, results, INSAMPLE, N, DIM, DELAY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- maxencode, pars);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Promote warnings connected with singular matrixes to errors
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_warning_state ("Octave:nearly-singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_warning_state ("Octave:singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Make the fit
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_fit (series, coding, results, INSAMPLE, N, DIM, DELAY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ maxencode, pars);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create outputs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // If error encountered during the fit there is no sense to continue
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create output that contains the number of free parameters
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(file,"#number of free parameters= %d\n\n",pars);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type free_par = pars;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create outputs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create output that contains the norm used for the fit
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(file,"#used norm for the fit= %e\n",std_dev);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double fit_norm = std_dev;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create output that contains the number of free parameters
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(file,"#number of free parameters= %d\n\n",pars);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type free_par = pars;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create output that contains the norm used for the fit
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(file,"#used norm for the fit= %e\n",std_dev);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double fit_norm = std_dev;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create coefficients output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix coeffs (pars, DIM + 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<pars;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create coefficients output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix coeffs (pars, DIM + 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<pars;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ decode(N,opar,DIM-1,coding[j],maxencode);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type sumpar=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type k=0;k<DIM;k++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- decode(N,opar,DIM-1,coding[j],maxencode);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type sumpar=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type k=0;k<DIM;k++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sumpar += opar[k];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(file,"%d ",opar[k]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- coeffs(j, k) = opar[k];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(file,"%e\n",results[j]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // /pow(std_dev,(double)(sumpar-1)));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- coeffs(j,DIM) = results[j]/pow(std_dev,(double)(sumpar-1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sumpar += opar[k];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(file,"%d ",opar[k]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ coeffs(j, k) = opar[k];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(file,"%e\n",results[j]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // /pow(std_dev,(double)(sumpar-1)));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ coeffs(j,DIM) = results[j]/pow(std_dev,(double)(sumpar-1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create sample error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // 1st element of sample_error is the insample error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // 2nd element of sample_error is the out of sample error (if exists)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- NDArray sample_err (dim_vector (1,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create sample error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // 1st element of sample_error is the insample error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // 2nd element of sample_error is the out of sample error (if exists)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NDArray sample_err (dim_vector (1,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old in_error = make_error((unsigned long)0,INSAMPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // fprintf(file,"#average insample error= %e\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // sqrt(in_error)*std_dev);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sample_err(0) = sqrt(make_error(series, coding, results, N, DIM,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- DELAY, maxencode, pars,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- 0,INSAMPLE))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old in_error = make_error((unsigned long)0,INSAMPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // fprintf(file,"#average insample error= %e\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // sqrt(in_error)*std_dev);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sample_err(0) = sqrt(make_error(series, coding, results, N, DIM,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ DELAY, maxencode, pars,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ 0,INSAMPLE))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ * std_dev;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (INSAMPLE < LENGTH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old out_error=make_error(INSAMPLE,LENGTH);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // fprintf(file,"#average out of sample error= %e\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // sqrt(out_error)*std_dev);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sample_err.resize (dim_vector (2,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sample_err(1) = sqrt (make_error (series, coding, results, N,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ DIM, DELAY, maxencode, pars,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ INSAMPLE, LENGTH))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * std_dev;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (INSAMPLE < LENGTH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old out_error=make_error(INSAMPLE,LENGTH);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // fprintf(file,"#average out of sample error= %e\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // sqrt(out_error)*std_dev);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sample_err.resize (dim_vector (2,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sample_err(1) = sqrt (make_error (series, coding, results, N,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- DIM, DELAY, maxencode, pars,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- INSAMPLE, LENGTH))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- * std_dev;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create forecast
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- NDArray forecast (dim_vector (0,0));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (CLENGTH > 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_cast(forecast, series, coding, results, LENGTH, CLENGTH, N,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- DIM, DELAY, maxencode, pars, std_dev);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create forecast
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NDArray forecast (dim_vector (0,0));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (CLENGTH > 0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_cast(forecast, series, coding, results, LENGTH, CLENGTH, N,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ DIM, DELAY, maxencode, pars, std_dev);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Assign outputs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = free_par;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(1) = fit_norm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(2) = coeffs;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(3) = sample_err;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(4) = forecast;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Assign outputs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = free_par;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(1) = fit_norm;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(2) = coeffs;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(3) = sample_err;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(4) = forecast;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__rbf__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__rbf__.cc Mon Aug 26 12:51:20 2019 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__rbf__.cc Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -152,169 +152,161 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (octave_idx_type j=0;j<DIM;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ center[i][j]=series[(DIM-1)*DELAY-j*DELAY+(i*cstep)/(CENTER-1)];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Promote warnings connected with singular matrixes to errors
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_warning_state ("Octave:nearly-singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_warning_state ("Octave:singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Promote warnings connected with singular matrixes to errors
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_warning_state ("Octave:nearly-singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_warning_state ("Octave:singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Calculate coefficients
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (setdrift)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- drift(CENTER, DIM, center);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- varianz=avdistance(CENTER, DIM, center);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Calculate coefficients
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (setdrift)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ drift(CENTER, DIM, center);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ varianz=avdistance(CENTER, DIM, center);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old make_fit();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix mat (CENTER + 1, CENTER + 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- OCTAVE_LOCAL_BUFFER (double *, mat_arr, CENTER + 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i <CENTER + 1;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mat_arr[i]=mat.fortran_vec () + (CENTER + 1) * i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old make_fit();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix mat (CENTER + 1, CENTER + 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ OCTAVE_LOCAL_BUFFER (double *, mat_arr, CENTER + 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i <CENTER + 1;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mat_arr[i]=mat.fortran_vec () + (CENTER + 1) * i;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<=CENTER;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- coefs_arr[i]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<=CENTER;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mat_arr[i][j]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<=CENTER;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ coefs_arr[i]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<=CENTER;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mat_arr[i][j]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- OCTAVE_LOCAL_BUFFER (double, hcen, CENTER);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ OCTAVE_LOCAL_BUFFER (double, hcen, CENTER);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type n=(DIM-1)*DELAY;n<INSAMPLE-STEP;n++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type nst=n+STEP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<CENTER;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- hcen[i]=rbf(DELAY, DIM, varianz, &series[n],center[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- coefs_arr[0] += series[nst];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mat_arr[0][0] += 1.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=1;i<=CENTER;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mat_arr[i][0] += hcen[i-1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=1;i<=CENTER;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double h = hcen[i-1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- coefs_arr[i] += series[nst] * h;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=1;j<=i;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mat_arr[i][j] += h*hcen[j-1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double h=(double)(INSAMPLE-STEP-(DIM-1)*DELAY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<=CENTER;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- coefs_arr[i] /= h;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<=i;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mat_arr[i][j] /= h;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mat_arr[j][i]=mat_arr[i][j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type n=(DIM-1)*DELAY;n<INSAMPLE-STEP;n++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type nst=n+STEP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<CENTER;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ hcen[i]=rbf(DELAY, DIM, varianz, &series[n],center[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ coefs_arr[0] += series[nst];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mat_arr[0][0] += 1.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=1;i<=CENTER;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mat_arr[i][0] += hcen[i-1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=1;i<=CENTER;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double h = hcen[i-1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ coefs_arr[i] += series[nst] * h;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=1;j<=i;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mat_arr[i][j] += h*hcen[j-1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double h=(double)(INSAMPLE-STEP-(DIM-1)*DELAY);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<=CENTER;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ coefs_arr[i] /= h;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<=i;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mat_arr[i][j] /= h;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mat_arr[j][i]=mat_arr[i][j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old solvele(mat_arr,coefs_arr, CENTER+1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- coefs = mat.solve(coefs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- coefs_arr = coefs.fortran_vec ();// coefs takes up new memory space
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old solvele(mat_arr,coefs_arr, CENTER+1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ coefs = mat.solve(coefs);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ coefs_arr = coefs.fortran_vec ();// coefs takes up new memory space
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // If solving the matrix generated errors do not continue
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // end make_fit()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // end make_fit()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create outputs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create centers
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix centers (CENTER, DIM);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<CENTER;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<DIM;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout," %e",center[i][j]*interval+min_val);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- centers(i,j) = center[i][j]*interval+min_val;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create outputs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create variance
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"#variance= %e\n",varianz*interval);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double variance_val = varianz*interval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create coefficients
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- NDArray coeff (dim_vector(CENTER +1, 1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"#%e\n",coefs[0]*interval+min_val);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- coeff(0) = coefs_arr[0]*interval+min_val;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=1;i<=CENTER;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create centers
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix centers (CENTER, DIM);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<CENTER;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<DIM;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"#%e\n",coefs[i]*interval);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- coeff(i) = coefs_arr[i]*interval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout," %e",center[i][j]*interval+min_val);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ centers(i,j) = center[i][j]*interval+min_val;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Calculate insample error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double sigma = 0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av = 0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<INSAMPLE;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create variance
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"#variance= %e\n",varianz*interval);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double variance_val = varianz*interval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create coefficients
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NDArray coeff (dim_vector(CENTER +1, 1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"#%e\n",coefs[0]*interval+min_val);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ coeff(0) = coefs_arr[0]*interval+min_val;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=1;i<=CENTER;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"#%e\n",coefs[i]*interval);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ coeff(i) = coefs_arr[i]*interval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Calculate insample error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double sigma = 0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ av = 0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<INSAMPLE;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ av += series[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sigma += series[i]*series[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ av /= INSAMPLE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sigma=sqrt(fabs(sigma/INSAMPLE-av*av));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create sample error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // 1st element of sample_error is the insample error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // 2nd element of sample_error is the out of sample error (if exists)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NDArray sample_error (dim_vector(1,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old oldfprintf(stdout,"#insample error= %e\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // forecast_error(0LU,INSAMPLE)/sigma);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sample_error(0) = forecast_error(series, center, coefs_arr, CENTER,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ DELAY, DIM, STEP, varianz,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ 0,INSAMPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ / sigma;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (INSAMPLE < LENGTH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Calculate out of sample error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ av=sigma=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=INSAMPLE;i<LENGTH;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ av += series[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sigma += series[i]*series[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av /= INSAMPLE;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sigma=sqrt(fabs(sigma/INSAMPLE-av*av));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create sample error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // 1st element of sample_error is the insample error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // 2nd element of sample_error is the out of sample error (if exists)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- NDArray sample_error (dim_vector(1,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old oldfprintf(stdout,"#insample error= %e\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // forecast_error(0LU,INSAMPLE)/sigma);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sample_error(0) = forecast_error(series, center, coefs_arr, CENTER,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- DELAY, DIM, STEP, varianz,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- 0,INSAMPLE)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- / sigma;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ av /= (LENGTH-INSAMPLE);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sigma=sqrt(fabs(sigma/(LENGTH-INSAMPLE)-av*av));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (INSAMPLE < LENGTH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Calculate out of sample error
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av=sigma=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=INSAMPLE;i<LENGTH;i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av += series[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sigma += series[i]*series[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- av /= (LENGTH-INSAMPLE);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sigma=sqrt(fabs(sigma/(LENGTH-INSAMPLE)-av*av));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"#out of sample error= %e\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // forecast_error(INSAMPLE,LENGTH)/sigma);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sample_error.resize (dim_vector(2,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ sample_error(1) = forecast_error(series, center, coefs_arr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ CENTER, DELAY, DIM, STEP,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ varianz, INSAMPLE, LENGTH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ / sigma;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"#out of sample error= %e\n",
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // forecast_error(INSAMPLE,LENGTH)/sigma);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sample_error.resize (dim_vector(2,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- sample_error(1) = forecast_error(series, center, coefs_arr,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- CENTER, DELAY, DIM, STEP,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- varianz, INSAMPLE, LENGTH)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- / sigma;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create forecast if MAKECAST == true
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NDArray forecast (dim_vector (0,0));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (MAKECAST)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old make_cast ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ forecast.resize(dim_vector(CLENGTH,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type dim=(DIM-1)*DELAY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create forecast if MAKECAST == true
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- NDArray forecast (dim_vector (0,0));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (MAKECAST)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old make_cast ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- forecast.resize(dim_vector(CLENGTH,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type dim=(DIM-1)*DELAY;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- OCTAVE_LOCAL_BUFFER (double, cast, dim + 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<=dim;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cast[i]=series[LENGTH-1-dim+i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ OCTAVE_LOCAL_BUFFER (double, cast, dim + 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<=dim;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cast[i]=series[LENGTH-1-dim+i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type n=0;n<CLENGTH;n++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double new_el=coefs_arr[0];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=1;i<=CENTER;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- new_el += coefs_arr[i]*rbf(DELAY,DIM,varianz,&cast[dim],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- center[i-1]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(out,"%e\n",new_el*interval+min_val);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- forecast(n) = new_el*interval+min_val;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<dim;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cast[i]=cast[i+1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- cast[dim]=new_el;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type n=0;n<CLENGTH;n++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double new_el=coefs_arr[0];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=1;i<=CENTER;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ new_el += coefs_arr[i]*rbf(DELAY,DIM,varianz,&cast[dim],
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ center[i-1]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(out,"%e\n",new_el*interval+min_val);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ forecast(n) = new_el*interval+min_val;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<dim;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cast[i]=cast[i+1];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ cast[dim]=new_el;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = centers;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(1) = variance_val; // variance;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(2) = coeff;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(3) = sample_error; // sample error [in sample; out of sample];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(4) = forecast; // forecast values;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = centers;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(1) = variance_val; // variance;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(2) = coeff;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(3) = sample_error; // sample error [in sample; out of sample];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(4) = forecast; // forecast values;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__surrogates__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__surrogates__.cc.orig 2015-08-14 17:25:52.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__surrogates__.cc 2023-03-09 19:13:16.000000000 -0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -63,35 +63,30 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ octave_idx_type ispec = args(3).idx_type_value ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ double seed = args(4).double_value ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type nmaxp = input.rows ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type mcmax = input.columns ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type nmaxp = input.rows ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type mcmax = input.columns ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Cell surro_data (dim_vector (nsur,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix surro_tmp (input.dims ());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix pars (nsur, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i = 0; i < nsur; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type it_tmp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double rel_discrepency_tmp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- F77_XFCN (ts_surrogates, TS_SURROGATES,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (input.fortran_vec (), nmaxp, mcmax, imax, ispec,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- seed, surro_tmp.fortran_vec (), it_tmp,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- rel_discrepency_tmp));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- surro_data(i) = surro_tmp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pars(i,0) = it_tmp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- pars(i,1) = rel_discrepency_tmp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = surro_data;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(1) = pars;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Cell surro_data (dim_vector (nsur,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix surro_tmp (input.dims ());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix pars (nsur, 2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i = 0; i < nsur; i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type it_tmp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double rel_discrepency_tmp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ F77_XFCN (ts_surrogates, TS_SURROGATES,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (input.fortran_vec (), nmaxp, mcmax, imax, ispec,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ seed, surro_tmp.fortran_vec (), it_tmp,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ rel_discrepency_tmp));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ surro_data(i) = surro_tmp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pars(i,0) = it_tmp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ pars(i,1) = rel_discrepency_tmp;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = surro_data;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(1) = pars;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__upo__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__upo__.cc.orig 2015-08-14 17:25:52.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__upo__.cc 2023-03-09 19:15:03.000000000 -0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -74,31 +74,26 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int icen = args(9).int_value();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int lines_read = in_out1.numel();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Generating output vectors with estimated lengths
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // The extra length (+1) is to store the actual lengths
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- NDArray olens (dim_vector (icen+1,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- NDArray orbit_data (dim_vector ( (icen*20<lines_read?\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- icen*20:lines_read)+1, 1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- NDArray acc (dim_vector (icen+1,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- NDArray stability (dim_vector (icen+1,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- F77_XFCN (ts_upo, TS_UPO,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (m, eps, frac,teq, tdis, h, tacc, iper,icen, lines_read,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- in_out1.fortran_vec(), olens.fortran_vec(),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- orbit_data.fortran_vec(), orbit_data.numel(),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- acc.fortran_vec(), stability.fortran_vec()));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = olens;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(1) = orbit_data;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(2) = acc;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(3) = stability;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int lines_read = in_out1.numel();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Generating output vectors with estimated lengths
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // The extra length (+1) is to store the actual lengths
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NDArray olens (dim_vector (icen+1,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NDArray orbit_data (dim_vector ( (icen*20<lines_read?\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ icen*20:lines_read)+1, 1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NDArray acc (dim_vector (icen+1,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NDArray stability (dim_vector (icen+1,1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ F77_XFCN (ts_upo, TS_UPO,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (m, eps, frac,teq, tdis, h, tacc, iper,icen, lines_read,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ in_out1.fortran_vec(), olens.fortran_vec(),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ orbit_data.fortran_vec(), orbit_data.numel(),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ acc.fortran_vec(), stability.fortran_vec()));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = olens;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(1) = orbit_data;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(2) = acc;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(3) = stability;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/__xzero__.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__xzero__.cc Mon Aug 26 12:51:20 2019 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__xzero__.cc Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -111,38 +111,35 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ double epsilon=EPS0/EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ octave_idx_type clength=(CLENGTH <= LENGTH) ? CLENGTH-STEP : LENGTH-STEP;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Calculate fit
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (!alldone) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ alldone=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon*=EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_box(series1,box,list,LENGTH-STEP,NMAX,DIM,DELAY,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=(DIM-1)*DELAY;i<clength;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!done[i]) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type actfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ actfound=find_neighbors(series1,box,list,series2+i,LENGTH,NMAX,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ DIM,DELAY,epsilon,found);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (actfound >= MINN) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=1;j<=STEP;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ error_array[j-1] += make_fit (series1, series2, found,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ i,actfound,j);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ done[i]=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ alldone &= done[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix output (STEP,1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<STEP;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Calculate fit
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- while (!alldone) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- alldone=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon*=EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_box(series1,box,list,LENGTH-STEP,NMAX,DIM,DELAY,epsilon);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=(DIM-1)*DELAY;i<clength;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!done[i]) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type actfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- actfound=find_neighbors(series1,box,list,series2+i,LENGTH,NMAX,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- DIM,DELAY,epsilon,found);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (actfound >= MINN) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=1;j<=STEP;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- error_array[j-1] += make_fit (series1, series2, found,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- i,actfound,j);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- done[i]=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- alldone &= done[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix output (STEP,1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<STEP;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-// old fprintf(stdout,"%lu %e\n",i+1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-// sqrt(error_array[i]/(clength-(DIM-1)*DELAY))/rms2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- output(i,0) = sqrt(error_array[i]/(clength-(DIM-1)*DELAY))/rms2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"%lu %e\n",i+1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // sqrt(error_array[i]/(clength-(DIM-1)*DELAY))/rms2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ output(i,0) = sqrt(error_array[i]/(clength-(DIM-1)*DELAY))/rms2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = output;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/lazy.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/lazy.cc.orig 2015-08-14 17:25:52.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/lazy.cc 2023-03-09 19:16:23.000000000 -0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -133,36 +133,33 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "Number of iterations (IMAX) must be a positive "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "integer");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // If vector is in 1 row: transpose (we will transpose the output to fit)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- transposed = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ((rows == 1) && (cols > 1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- transposed = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- in_out1 = in_out1.transpose();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int lines_read = in_out1.numel();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- NDArray in_out2 (Matrix (lines_read, 1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- F77_XFCN (ts_lazy, TS_LAZY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- (m, rv, imax, lines_read,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- in_out1.fortran_vec(), in_out2.fortran_vec()));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Transpose the output to resemble the input
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (transposed)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- in_out1 = in_out1.transpose();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- in_out2 = in_out2.transpose();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = in_out1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(1) = in_out2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // If vector is in 1 row: transpose (we will transpose the output to fit)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ transposed = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if ((rows == 1) && (cols > 1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ transposed = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ in_out1 = in_out1.transpose();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int lines_read = in_out1.numel();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NDArray in_out2 (Matrix (lines_read, 1));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ F77_XFCN (ts_lazy, TS_LAZY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ (m, rv, imax, lines_read,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ in_out1.fortran_vec(), in_out2.fortran_vec()));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Transpose the output to resemble the input
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (transposed)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ in_out1 = in_out1.transpose();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ in_out2 = in_out2.transpose();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = in_out1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(1) = in_out2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff -r 71f2c8fde0c5 -r e40a599d68cf src/mutual.cc
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/mutual.cc Mon Aug 26 12:51:20 2019 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/mutual.cc Mon Nov 29 13:43:29 2021 +0100
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -193,60 +193,57 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int32NDArray h2 (dim_vector(partitions, partitions));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ OCTAVE_LOCAL_BUFFER (long, array, length);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Load array
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Load array
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Rescale data and load array
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // NOTE: currently supports only vectors so (dim == 1) always
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (dim == 1){
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double mint, interval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- rescale_data(input,0,length,&mint,&interval);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Rescale data and load array
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // NOTE: currently supports only vectors so (dim == 1) always
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (dim == 1){
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double mint, interval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ rescale_data(input,0,length,&mint,&interval);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<length;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (input(i,0) < 1.0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- array[i]=(long)(input(i,0)*(double)partitions);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- array[i]=partitions-1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<length;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (input(i,0) < 1.0)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ array[i]=(long)(input(i,0)*(double)partitions);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ array[i]=partitions-1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double shannon = make_cond_entropy (0, h1, h11, h2, array, length,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- partitions);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (corrlength >= (long)length)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- corrlength=length-1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double shannon = make_cond_entropy (0, h1, h11, h2, array, length,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ partitions);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (corrlength >= (long)length)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ corrlength=length-1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Construct the output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix delay (corrlength+1,1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // To save memory
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- int minf_len = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Construct the output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix delay (corrlength+1,1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // To save memory
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ int minf_len = 1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (nargout > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- minf_len = corrlength+1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix mutual_inf (minf_len,1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (nargout > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ minf_len = corrlength+1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix mutual_inf (minf_len,1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Assign output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- delay(0,0) = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mutual_inf(0,0) = shannon;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type tau=1;tau<=corrlength;tau++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Assign output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ delay(0,0) = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mutual_inf(0,0) = shannon;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type tau=1;tau<=corrlength;tau++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // fprintf(stdout,"%ld %e %e\n",tau,condent,condent/log((double)partitions));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- delay(tau,0) = tau;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (nargout > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mutual_inf(tau,0) = make_cond_entropy(tau, h1, h11, h2, array,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- length, partitions);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // fprintf(stdout,"%ld %e %e\n",tau,condent,condent/log((double)partitions));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ delay(tau,0) = tau;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (nargout > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mutual_inf(tau,0) = make_cond_entropy(tau, h1, h11, h2, array,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ length, partitions);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (transposed)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- delay = delay.transpose();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (nargout > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- mutual_inf = mutual_inf.transpose();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = delay;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(1) = mutual_inf;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (transposed)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ delay = delay.transpose();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (nargout > 1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ mutual_inf = mutual_inf.transpose();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = delay;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(1) = mutual_inf;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/__lfo_test__.cc.orig 2015-08-14 17:25:52.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/__lfo_test__.cc 2023-03-09 19:39:33.000000000 -0600
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -212,13 +212,6 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Matrix solved_vec = mat.solve (vec);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ double *solved_vec_arr = solved_vec.fortran_vec ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // If errors were raised (a singular matrix was encountered),
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // there is no sense in countinueing
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return ;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ newcast[i]=foreav[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (octave_idx_type j=0;j<DIM;j++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ octave_idx_type hcj=indexes[0][j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -332,90 +325,80 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (octave_idx_type i=0;i<COMP;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ error_array[i]=0.0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if ( ! error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Promote warnings connected with singular matrixes to errors
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_warning_state ("Octave:nearly-singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- set_warning_state ("Octave:singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Calculate the maximum epsilon that makes sense
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // On the basis of 'i' and 'j' from put_in_boxes ()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- NDArray input_max = input.max ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double maximum_epsilon = (input_max(0) > input_max(COMP-1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ? input_max(0) : input_max(COMP-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- maximum_epsilon *= EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Calculate output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- bool alldone=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- while (!alldone) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- alldone=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // If epsilon became too large there is no sense in continuing
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (epsilon > maximum_epsilon)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- error_with_id ("Octave:tisean", "The neighbourhood size became"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- " too large during search, no sense"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- " continuing");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon*=EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- put_in_boxes(series, LENGTH, STEP, COMP, hdim, epsilon, list, box);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=(EMBED-1)*DELAY;i<clength;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (!done[i])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- octave_idx_type actfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- actfound=hfind_neighbors(series, indexes, COMP, hdim, DIM,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- epsilon, hfound, list, box, i);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- actfound=exclude_interval(actfound,i-causal+1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- i+causal+(EMBED-1)*DELAY-1,hfound,found);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (actfound > MINN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- make_fit(series, indexes, found, STEP, DIM, COMP,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- actfound,i,newcast);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Checking if the fit was correct
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // If any errors were raised: end function
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- if (error_state)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<COMP;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- error_array[j] += sqr(newcast[j]-series[j][i+STEP]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<COMP;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- individual[j][i]=(newcast[j]-series[j][i+STEP])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- *interval[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- done[i]=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- alldone &= done[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- double norm=((double)clength-(double)((EMBED-1)*DELAY));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create relative forecast error output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix rel (COMP, 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=0;i<COMP;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"# %e\n",sqrt(error_array[i]/norm)/rms[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- rel(i,0) = sqrt(error_array[i]/norm)/rms[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // Create individual forecast error output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- Matrix ind (clength - (EMBED-1)*DELAY,COMP);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type i=(EMBED-1)*DELAY;i<clength;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- for (octave_idx_type j=0;j<COMP;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // old fprintf(stdout,"%e ",individual[j][i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- ind(i-(EMBED-1)*DELAY, j) = individual[j][i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(0) = rel;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- retval(1) = ind;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Promote warnings connected with singular matrixes to errors
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_warning_state ("Octave:nearly-singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ set_warning_state ("Octave:singular-matrix","error");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Calculate the maximum epsilon that makes sense
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // On the basis of 'i' and 'j' from put_in_boxes ()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ NDArray input_max = input.max ();
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double maximum_epsilon = (input_max(0) > input_max(COMP-1))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ? input_max(0) : input_max(COMP-1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ maximum_epsilon *= EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Calculate output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ bool alldone=0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ while (!alldone) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ alldone=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // If epsilon became too large there is no sense in continuing
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (epsilon > maximum_epsilon)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ error_with_id ("Octave:tisean", "The neighbourhood size became"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ " too large during search, no sense"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ " continuing");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon*=EPSF;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ put_in_boxes(series, LENGTH, STEP, COMP, hdim, epsilon, list, box);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=(EMBED-1)*DELAY;i<clength;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (!done[i])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ octave_idx_type actfound;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ actfound=hfind_neighbors(series, indexes, COMP, hdim, DIM,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ epsilon, hfound, list, box, i);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ actfound=exclude_interval(actfound,i-causal+1,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ i+causal+(EMBED-1)*DELAY-1,hfound,found);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (actfound > MINN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ make_fit(series, indexes, found, STEP, DIM, COMP,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ actfound,i,newcast);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<COMP;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ error_array[j] += sqr(newcast[j]-series[j][i+STEP]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<COMP;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ individual[j][i]=(newcast[j]-series[j][i+STEP])
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ *interval[j];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ done[i]=1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ alldone &= done[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ double norm=((double)clength-(double)((EMBED-1)*DELAY));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create relative forecast error output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix rel (COMP, 1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=0;i<COMP;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"# %e\n",sqrt(error_array[i]/norm)/rms[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ rel(i,0) = sqrt(error_array[i]/norm)/rms[i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Create individual forecast error output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ Matrix ind (clength - (EMBED-1)*DELAY,COMP);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type i=(EMBED-1)*DELAY;i<clength;i++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ for (octave_idx_type j=0;j<COMP;j++)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // old fprintf(stdout,"%e ",individual[j][i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ind(i-(EMBED-1)*DELAY, j) = individual[j][i];
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(0) = rel;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ retval(1) = ind;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return retval;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span></pre><pre style='margin:0'>
</pre>