changeset 6530:8ea9085d1f80

of-control: Fix compatibility with Octave 9. * src/of-control-2-octave-9-compat.patch: Add patch that replaces functions and classes that have been deprecated in Octave 7 and removed from Octave 9. * dist-files.mk: Add new file to list.
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 17 Nov 2022 10:40:12 +0100
parents 91d5ee8ae175
children 297b371a6713
files dist-files.mk src/of-control-2-octave-9-compat.patch
diffstat 2 files changed, 43 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dist-files.mk	Thu Nov 17 09:51:29 2022 +0100
+++ b/dist-files.mk	Thu Nov 17 10:40:12 2022 +0100
@@ -475,6 +475,7 @@
   of-audio.mk \
   of-communications.mk \
   of-control-1-deprecated-warnings.patch \
+  of-control-2-octave-9-compat.patch \
   of-control.mk \
   of-data-smoothing.mk \
   of-database-1-verror.patch \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/of-control-2-octave-9-compat.patch	Thu Nov 17 10:40:12 2022 +0100
@@ -0,0 +1,42 @@
+Replace functions and classes deprecated in Octave 7 and removed from Octave 9.
+
+--- control-3.4.0/src/sl_ab08nd.cc.orig	2022-01-16 15:17:03.000000000 +0100
++++ control-3.4.0/src/sl_ab08nd.cc	2022-11-17 10:22:24.964707565 +0100
+@@ -136,10 +136,10 @@
+         F77_XFCN (ab08nd, AB08ND,
+                  (equil,
+                   n, m, p,
+-                  a.fortran_vec (), lda,
+-                  b.fortran_vec (), ldb,
+-                  c.fortran_vec (), ldc,
+-                  d.fortran_vec (), ldd,
++                  a.data (), lda,
++                  b.data (), ldb,
++                  c.data (), ldc,
++                  d.data (), ldd,
+                   nu, rank, dinfz,
+                   nkror, nkrol, infz,
+                   kronr, kronl,
+@@ -198,7 +198,7 @@
+         if (m == 1 && p == 1)
+         {
+             if (nu < n)
+-                gain = c * xpow (a, double (n-1-nu)).matrix_value() * b;
++                gain = c * octave::xpow (a, double (n-1-nu)).matrix_value () * b;
+             else
+                 gain = d;
+         }
+
+--- control-3.4.0/src/lti_input_idx.cc.orig	2022-01-16 15:17:03.000000000 +0100
++++ control-3.4.0/src/lti_input_idx.cc	2022-11-17 10:28:13.630086637 +0100
+@@ -93,8 +93,8 @@
+       offset = 1;
+     }
+ 
+-    Range mat_idx (1, idx-offset);
+-    Range opt_idx (idx+1-offset, len);
++    octave::range<double> mat_idx (1, idx-offset);
++    octave::range<double> opt_idx (idx+1-offset, len);
+ 
+     retval(2) = offset;     // abused as logical in the LTI constructors
+     retval(1) = opt_idx;