# HG changeset patch
# User John W. Eaton
# Date 1483400481 18000
# Mon Jan 02 18:41:21 2017 -0500
# Node ID 3c7e4fc88405e72572b70d8db7401dc6c471e1b6
# Parent fddd53f19e24c50dd299a329ea3d630ae5fea50f
F77_INT fixes for Octave 4.4.
diff --git a/src/common.cc b/src/common.cc
--- a/src/common.cc
+++ b/src/common.cc
@@ -28,7 +28,7 @@ Version: 0.4
#include
-octave_idx_type max (octave_idx_type a, octave_idx_type b)
+F77_INT max (F77_INT a, F77_INT b)
{
if (a > b)
return a;
@@ -36,22 +36,22 @@ octave_idx_type max (octave_idx_type a,
return b;
}
-octave_idx_type max (octave_idx_type a, octave_idx_type b, octave_idx_type c)
+F77_INT max (F77_INT a, F77_INT b, F77_INT c)
{
return max (max (a, b), c);
}
-octave_idx_type max (octave_idx_type a, octave_idx_type b, octave_idx_type c, octave_idx_type d)
+F77_INT max (F77_INT a, F77_INT b, F77_INT c, F77_INT d)
{
return max (max (a, b), max (c, d));
}
-octave_idx_type max (octave_idx_type a, octave_idx_type b, octave_idx_type c, octave_idx_type d, octave_idx_type e)
+F77_INT max (F77_INT a, F77_INT b, F77_INT c, F77_INT d, F77_INT e)
{
return max (max (a, b, c, d), e);
}
-octave_idx_type min (octave_idx_type a, octave_idx_type b)
+F77_INT min (F77_INT a, F77_INT b)
{
if (a < b)
return a;
diff --git a/src/common.h b/src/common.h
--- a/src/common.h
+++ b/src/common.h
@@ -28,11 +28,21 @@ Version: 0.2
#ifndef COMMON_H
#define COMMON_H
-octave_idx_type max (octave_idx_type a, octave_idx_type b);
-octave_idx_type max (octave_idx_type a, octave_idx_type b, octave_idx_type c);
-octave_idx_type max (octave_idx_type a, octave_idx_type b, octave_idx_type c, octave_idx_type d);
-octave_idx_type max (octave_idx_type a, octave_idx_type b, octave_idx_type c, octave_idx_type d, octave_idx_type e);
-octave_idx_type min (octave_idx_type a, octave_idx_type b);
+#include
+
+#if defined (OCTAVE_HAVE_F77_INT_TYPE)
+# define TO_F77_INT(x) octave::to_f77_int (x)
+#else
+typedef octave_idx_type F77_INT;
+# define TO_F77_INT(x) (x)
+#endif
+
+F77_INT max (F77_INT a, F77_INT b);
+F77_INT max (F77_INT a, F77_INT b, F77_INT c);
+F77_INT max (F77_INT a, F77_INT b, F77_INT c, F77_INT d);
+F77_INT max (F77_INT a, F77_INT b, F77_INT c, F77_INT d, F77_INT e);
+F77_INT min (F77_INT a, F77_INT b);
+
void error_msg (const char name[], octave_idx_type index, octave_idx_type max, const char* msg[]);
void warning_msg (const char name[], octave_idx_type index, octave_idx_type max, const char* msg[]);
void warning_msg (const char name[], octave_idx_type index, octave_idx_type max, const char* msg[], octave_idx_type offset);
diff --git a/src/sl_ab01od.cc b/src/sl_ab01od.cc
--- a/src/sl_ab01od.cc
+++ b/src/sl_ab01od.cc
@@ -28,7 +28,6 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
@@ -36,17 +35,17 @@ extern "C"
int F77_FUNC (ab01od, AB01OD)
(char& STAGES,
char& JOBU, char& JOBV,
- octave_idx_type& N, octave_idx_type& M,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* U, octave_idx_type& LDU,
- double* V, octave_idx_type& LDV,
- octave_idx_type& NCONT, octave_idx_type& INDCON,
- octave_idx_type* KSTAIR,
+ F77_INT& N, F77_INT& M,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* U, F77_INT& LDU,
+ double* V, F77_INT& LDV,
+ F77_INT& NCONT, F77_INT& INDCON,
+ F77_INT* KSTAIR,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_ab01od__", "__control_slicot_functions__.oct");
@@ -74,31 +73,31 @@ For internal use only.")
Matrix b = args(1).matrix_value ();
double tol = args(2).double_value ();
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldu = max (1, n);
- octave_idx_type ldv = 1;
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldu = max (1, n);
+ F77_INT ldv = 1;
// arguments out
Matrix u (ldu, n);
double* v = 0; // not referenced because stages = 'F'
- octave_idx_type ncont;
- octave_idx_type indcon;
+ F77_INT ncont;
+ F77_INT indcon;
- OCTAVE_LOCAL_BUFFER (octave_idx_type, kstair, n);
+ OCTAVE_LOCAL_BUFFER (F77_INT, kstair, n);
// workspace
- octave_idx_type ldwork = max (1, n + max (n, 3*m));
+ F77_INT ldwork = max (1, n + max (n, 3*m));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, m);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, m);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicators
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine AB01OD
diff --git a/src/sl_ab04md.cc b/src/sl_ab04md.cc
--- a/src/sl_ab04md.cc
+++ b/src/sl_ab04md.cc
@@ -29,22 +29,21 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (ab04md, AB04MD)
(char& TYPE,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
+ F77_INT& N, F77_INT& M, F77_INT& P,
double& ALPHA, double& BETA,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_ab04md__", "__control_slicot_functions__.oct");
@@ -73,30 +72,30 @@ For internal use only.")
double alpha = args(4).double_value ();
double beta = args(5).double_value ();
- octave_idx_type discrete = args(6).int_value ();
+ F77_INT discrete = args(6).int_value ();
if (discrete == 0)
type = 'C';
else
type = 'D';
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, p);
- octave_idx_type ldd = max (1, p);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, p);
+ F77_INT ldd = max (1, p);
// workspace
- octave_idx_type ldwork = max (1, n);
+ F77_INT ldwork = max (1, n);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, n);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, n);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine AB04MD
diff --git a/src/sl_ab08nd.cc b/src/sl_ab08nd.cc
--- a/src/sl_ab08nd.cc
+++ b/src/sl_ab08nd.cc
@@ -28,7 +28,6 @@ Version: 0.8
*/
#include
-#include
#include "common.h"
#include
#include
@@ -37,31 +36,31 @@ extern "C"
{
int F77_FUNC (ab08nd, AB08ND)
(char& EQUIL,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
- const double* A, octave_idx_type& LDA,
- const double* B, octave_idx_type& LDB,
- const double* C, octave_idx_type& LDC,
- const double* D, octave_idx_type& LDD,
- octave_idx_type& NU, octave_idx_type& RANK, octave_idx_type& DINFZ,
- octave_idx_type& NKROR, octave_idx_type& NKROL, octave_idx_type* INFZ,
- octave_idx_type* KRONR, octave_idx_type* KRONL,
- double* AF, octave_idx_type& LDAF,
- double* BF, octave_idx_type& LDBF,
+ F77_INT& N, F77_INT& M, F77_INT& P,
+ const double* A, F77_INT& LDA,
+ const double* B, F77_INT& LDB,
+ const double* C, F77_INT& LDC,
+ const double* D, F77_INT& LDD,
+ F77_INT& NU, F77_INT& RANK, F77_INT& DINFZ,
+ F77_INT& NKROR, F77_INT& NKROL, F77_INT* INFZ,
+ F77_INT* KRONR, F77_INT* KRONL,
+ double* AF, F77_INT& LDAF,
+ double* BF, F77_INT& LDBF,
double& TOL,
- octave_idx_type* IWORK, double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK, double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
int F77_FUNC (dggev, DGGEV)
(char& JOBVL, char& JOBVR,
- octave_idx_type& N,
- double* AF, octave_idx_type& LDAF,
- double* BF, octave_idx_type& LDBF,
+ F77_INT& N,
+ double* AF, F77_INT& LDAF,
+ double* BF, F77_INT& LDBF,
double* ALPHAR, double* ALPHAI,
double* BETA,
- double* VL, octave_idx_type& LDVL,
- double* VR, octave_idx_type& LDVR,
- double* WORK, octave_idx_type& LWORK,
- octave_idx_type& INFO);
+ double* VL, F77_INT& LDVL,
+ double* VR, F77_INT& LDVR,
+ double* WORK, F77_INT& LWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_ab08nd__", "__control_slicot_functions__.oct");
@@ -87,48 +86,48 @@ For internal use only.")
const Matrix b = args(1).matrix_value ();
const Matrix c = args(2).matrix_value ();
const Matrix d = args(3).matrix_value ();
- const octave_idx_type scaled = args(4).int_value ();
+ const F77_INT scaled = args(4).int_value ();
if (scaled == 0)
equil = 'S';
else
equil = 'N';
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, a.rows ());
- octave_idx_type ldb = max (1, b.rows ());
- octave_idx_type ldc = max (1, c.rows ());
- octave_idx_type ldd = max (1, d.rows ());
+ F77_INT lda = max (1, TO_F77_INT (a.rows ()));
+ F77_INT ldb = max (1, TO_F77_INT (b.rows ()));
+ F77_INT ldc = max (1, TO_F77_INT (c.rows ()));
+ F77_INT ldd = max (1, TO_F77_INT (d.rows ()));
// arguments out
- octave_idx_type nu;
- octave_idx_type rank;
- octave_idx_type dinfz;
- octave_idx_type nkror;
- octave_idx_type nkrol;
+ F77_INT nu;
+ F77_INT rank;
+ F77_INT dinfz;
+ F77_INT nkror;
+ F77_INT nkrol;
- octave_idx_type ldaf = max (1, n + m);
- octave_idx_type ldbf = max (1, n + p);
+ F77_INT ldaf = max (1, n + m);
+ F77_INT ldbf = max (1, n + p);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, infz, n);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, kronr, 1 + max (n, m));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, kronl, 1 + max (n, p));
+ OCTAVE_LOCAL_BUFFER (F77_INT, infz, n);
+ OCTAVE_LOCAL_BUFFER (F77_INT, kronr, 1 + max (n, m));
+ OCTAVE_LOCAL_BUFFER (F77_INT, kronl, 1 + max (n, p));
OCTAVE_LOCAL_BUFFER (double, af, ldaf * (n + min (p, m)));
OCTAVE_LOCAL_BUFFER (double, bf, ldbf * (n + m));
// workspace
- octave_idx_type s = max (m, p);
- octave_idx_type ldwork = max (1, max (s, n) + max (3*s-1, n+s));
+ F77_INT s = max (m, p);
+ F77_INT ldwork = max (1, max (s, n) + max (3*s-1, n+s));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, s);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, s);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// tolerance
double tol = 0; // AB08ND uses DLAMCH for default tolerance
@@ -162,18 +161,18 @@ For internal use only.")
char jobvr = 'N';
double* vl = 0; // not referenced because jobvl = 'N'
- octave_idx_type ldvl = 1;
+ F77_INT ldvl = 1;
double* vr = 0; // not referenced because jobvr = 'N'
- octave_idx_type ldvr = 1;
+ F77_INT ldvr = 1;
- octave_idx_type lwork = max (1, 8*nu);
+ F77_INT lwork = max (1, 8*nu);
OCTAVE_LOCAL_BUFFER (double, work, lwork);
ColumnVector alphar (nu);
ColumnVector alphai (nu);
ColumnVector beta (nu);
- octave_idx_type info2;
+ F77_INT info2;
F77_XFCN (dggev, DGGEV,
(jobvl, jobvr,
@@ -213,7 +212,7 @@ For internal use only.")
ComplexColumnVector zero (nu, Complex ());
- for (octave_idx_type i = 0; i < nu; i++)
+ for (F77_INT i = 0; i < nu; i++)
zero.xelem (i) = Complex (zeror(i), zeroi(i));
// prepare additional outputs for info struct
@@ -221,13 +220,13 @@ For internal use only.")
RowVector kronrr (nkror);
RowVector kronlr (nkrol);
- for (octave_idx_type i = 0; i < dinfz; i++)
+ for (F77_INT i = 0; i < dinfz; i++)
infzr.xelem (i) = infz[i];
- for (octave_idx_type i = 0; i < nkror; i++)
+ for (F77_INT i = 0; i < nkror; i++)
kronrr.xelem (i) = kronr[i];
- for (octave_idx_type i = 0; i < nkrol; i++)
+ for (F77_INT i = 0; i < nkrol; i++)
kronlr.xelem (i) = kronl[i];
// return values
diff --git a/src/sl_ab09hd.cc b/src/sl_ab09hd.cc
--- a/src/sl_ab09hd.cc
+++ b/src/sl_ab09hd.cc
@@ -28,27 +28,26 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (ab09hd, AB09HD)
(char& DICO, char& JOB, char& EQUIL, char& ORDSEL,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
- octave_idx_type& NR,
+ F77_INT& N, F77_INT& M, F77_INT& P,
+ F77_INT& NR,
double& ALPHA, double& BETA,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- octave_idx_type& NS,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ F77_INT& NS,
double* HSV,
double& TOL1, double& TOL2,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
bool* BWORK,
- octave_idx_type& IWARN, octave_idx_type& INFO);
+ F77_INT& IWARN, F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_ab09hd__", "__control_slicot_functions__.oct");
@@ -78,12 +77,12 @@ For internal use only.")
Matrix c = args(2).matrix_value ();
Matrix d = args(3).matrix_value ();
- const octave_idx_type idico = args(4).int_value ();
- const octave_idx_type iequil = args(5).int_value ();
- const octave_idx_type ijob = args(6).int_value ();
+ const F77_INT idico = args(4).int_value ();
+ const F77_INT iequil = args(5).int_value ();
+ const F77_INT ijob = args(6).int_value ();
- octave_idx_type nr = args(7).int_value ();
- const octave_idx_type iordsel = args(8).int_value ();
+ F77_INT nr = args(7).int_value ();
+ const F77_INT iordsel = args(8).int_value ();
double alpha = args(9).double_value ();
double beta = args(10).double_value ();
@@ -123,38 +122,38 @@ For internal use only.")
else
ordsel = 'A';
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, p);
- octave_idx_type ldd = max (1, p);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, p);
+ F77_INT ldd = max (1, p);
// arguments out
- octave_idx_type ns;
+ F77_INT ns;
ColumnVector hsv (n);
// workspace
- octave_idx_type liwork = max (1, 2*n);
- octave_idx_type mb;
+ F77_INT liwork = max (1, 2*n);
+ F77_INT mb;
if (beta == 0)
mb = m;
else
mb = m + p;
- octave_idx_type ldwork = 2*n*n + mb*(n+p)
+ F77_INT ldwork = 2*n*n + mb*(n+p)
+ max (2, n*(max (n,mb,p)+5), 2*n*p + max (p*(mb+2), 10*n*(n+1)));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
OCTAVE_LOCAL_BUFFER (bool, bwork, 2*n);
// error indicators
- octave_idx_type iwarn = 0;
- octave_idx_type info = 0;
+ F77_INT iwarn = 0;
+ F77_INT info = 0;
// SLICOT routine AB09HD
diff --git a/src/sl_ab09id.cc b/src/sl_ab09id.cc
--- a/src/sl_ab09id.cc
+++ b/src/sl_ab09id.cc
@@ -29,7 +29,6 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
@@ -37,28 +36,28 @@ extern "C"
int F77_FUNC (ab09id, AB09ID)
(char& DICO, char& JOBC, char& JOBO, char& JOB,
char& WEIGHT, char& EQUIL, char& ORDSEL,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
- octave_idx_type& NV, octave_idx_type& PV, octave_idx_type& NW, octave_idx_type& MW,
- octave_idx_type& NR,
+ F77_INT& N, F77_INT& M, F77_INT& P,
+ F77_INT& NV, F77_INT& PV, F77_INT& NW, F77_INT& MW,
+ F77_INT& NR,
double& ALPHA, double& ALPHAC, double& ALPHAO,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- double* AV, octave_idx_type& LDAV,
- double* BV, octave_idx_type& LDBV,
- double* CV, octave_idx_type& LDCV,
- double* DV, octave_idx_type& LDDV,
- double* AW, octave_idx_type& LDAW,
- double* BW, octave_idx_type& LDBW,
- double* CW, octave_idx_type& LDCW,
- double* DW, octave_idx_type& LDDW,
- octave_idx_type& NS,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ double* AV, F77_INT& LDAV,
+ double* BV, F77_INT& LDBV,
+ double* CV, F77_INT& LDCV,
+ double* DV, F77_INT& LDDV,
+ double* AW, F77_INT& LDAW,
+ double* BW, F77_INT& LDBW,
+ double* CW, F77_INT& LDCW,
+ double* DW, F77_INT& LDDW,
+ F77_INT& NS,
double* HSV,
double& TOL1, double& TOL2,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& IWARN, octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& IWARN, F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_ab09id__", "__control_slicot_functions__.oct");
@@ -91,12 +90,12 @@ For internal use only.")
Matrix c = args(2).matrix_value ();
Matrix d = args(3).matrix_value ();
- const octave_idx_type idico = args(4).int_value ();
- const octave_idx_type iequil = args(5).int_value ();
- octave_idx_type nr = args(6).int_value ();
- const octave_idx_type iordsel = args(7).int_value ();
+ const F77_INT idico = args(4).int_value ();
+ const F77_INT iequil = args(5).int_value ();
+ F77_INT nr = args(6).int_value ();
+ const F77_INT iordsel = args(7).int_value ();
double alpha = args(8).double_value ();
- const octave_idx_type ijob = args(9).int_value ();
+ const F77_INT ijob = args(9).int_value ();
Matrix av = args(10).matrix_value ();
Matrix bv = args(11).matrix_value ();
@@ -108,10 +107,10 @@ For internal use only.")
Matrix cw = args(16).matrix_value ();
Matrix dw = args(17).matrix_value ();
- const octave_idx_type iweight = args(18).int_value ();
- const octave_idx_type ijobc = args(19).int_value ();
+ const F77_INT iweight = args(18).int_value ();
+ const F77_INT ijobc = args(19).int_value ();
double alphac = args(20).double_value ();
- const octave_idx_type ijobo = args(21).int_value ();
+ const F77_INT ijobo = args(21).int_value ();
double alphao = args(22).double_value ();
double tol1 = args(23).double_value ();
@@ -178,39 +177,39 @@ For internal use only.")
error ("__sl_ab09id__: argument weight invalid");
}
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type nv = av.rows ();
- octave_idx_type pv = cv.rows ();
- octave_idx_type nw = aw.rows ();
- octave_idx_type mw = bw.columns ();
+ F77_INT nv = TO_F77_INT (av.rows ());
+ F77_INT pv = TO_F77_INT (cv.rows ());
+ F77_INT nw = TO_F77_INT (aw.rows ());
+ F77_INT mw = TO_F77_INT (bw.columns ());
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, p);
- octave_idx_type ldd = max (1, p);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, p);
+ F77_INT ldd = max (1, p);
- octave_idx_type ldav = max (1, nv);
- octave_idx_type ldbv = max (1, nv);
- octave_idx_type ldcv = max (1, pv);
- octave_idx_type lddv = max (1, pv);
+ F77_INT ldav = max (1, nv);
+ F77_INT ldbv = max (1, nv);
+ F77_INT ldcv = max (1, pv);
+ F77_INT lddv = max (1, pv);
- octave_idx_type ldaw = max (1, nw);
- octave_idx_type ldbw = max (1, nw);
- octave_idx_type ldcw = max (1, m);
- octave_idx_type lddw = max (1, m);
+ F77_INT ldaw = max (1, nw);
+ F77_INT ldbw = max (1, nw);
+ F77_INT ldcw = max (1, m);
+ F77_INT lddw = max (1, m);
// arguments out
- octave_idx_type ns;
+ F77_INT ns;
ColumnVector hsv (n);
// workspace
- octave_idx_type liwork;
- octave_idx_type liwrk1;
- octave_idx_type liwrk2;
- octave_idx_type liwrk3;
+ F77_INT liwork;
+ F77_INT liwrk1;
+ F77_INT liwrk2;
+ F77_INT liwrk3;
switch (job)
{
@@ -236,13 +235,13 @@ For internal use only.")
liwork = max (3, liwrk1, liwrk2, liwrk3);
- octave_idx_type ldwork;
- octave_idx_type lminl;
- octave_idx_type lrcf;
- octave_idx_type lminr;
- octave_idx_type llcf;
- octave_idx_type lleft;
- octave_idx_type lright;
+ F77_INT ldwork;
+ F77_INT lminl;
+ F77_INT lrcf;
+ F77_INT lminr;
+ F77_INT llcf;
+ F77_INT lleft;
+ F77_INT lright;
if (nw == 0 || weight == 'L' || weight == 'N')
{
@@ -281,12 +280,12 @@ For internal use only.")
ldwork = max (lminl, lminr, lrcf,
2*n*n + max (1, lleft, lright, 2*n*n+5*n, n*max (m, p)));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicators
- octave_idx_type iwarn = 0;
- octave_idx_type info = 0;
+ F77_INT iwarn = 0;
+ F77_INT info = 0;
// SLICOT routine AB09ID
diff --git a/src/sl_ab09jd.cc b/src/sl_ab09jd.cc
--- a/src/sl_ab09jd.cc
+++ b/src/sl_ab09jd.cc
@@ -28,7 +28,6 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
@@ -36,27 +35,27 @@ extern "C"
int F77_FUNC (ab09jd, AB09JD)
(char& JOBV, char& JOBW, char& JOBINV,
char& DICO, char& EQUIL, char& ORDSEL,
- octave_idx_type& N, octave_idx_type& NV, octave_idx_type& NW, octave_idx_type& M, octave_idx_type& P,
- octave_idx_type& NR,
+ F77_INT& N, F77_INT& NV, F77_INT& NW, F77_INT& M, F77_INT& P,
+ F77_INT& NR,
double& ALPHA,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- double* AV, octave_idx_type& LDAV,
- double* BV, octave_idx_type& LDBV,
- double* CV, octave_idx_type& LDCV,
- double* DV, octave_idx_type& LDDV,
- double* AW, octave_idx_type& LDAW,
- double* BW, octave_idx_type& LDBW,
- double* CW, octave_idx_type& LDCW,
- double* DW, octave_idx_type& LDDW,
- octave_idx_type& NS,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ double* AV, F77_INT& LDAV,
+ double* BV, F77_INT& LDBV,
+ double* CV, F77_INT& LDCV,
+ double* DV, F77_INT& LDDV,
+ double* AW, F77_INT& LDAW,
+ double* BW, F77_INT& LDBW,
+ double* CW, F77_INT& LDCW,
+ double* DW, F77_INT& LDDW,
+ F77_INT& NS,
double* HSV,
double& TOL1, double& TOL2,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& IWARN, octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& IWARN, F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_ab09jd__", "__control_slicot_functions__.oct");
@@ -88,25 +87,25 @@ For internal use only.")
Matrix c = args(2).matrix_value ();
Matrix d = args(3).matrix_value ();
- const octave_idx_type idico = args(4).int_value ();
- const octave_idx_type iequil = args(5).int_value ();
- octave_idx_type nr = args(6).int_value ();
- const octave_idx_type iordsel = args(7).int_value ();
+ const F77_INT idico = args(4).int_value ();
+ const F77_INT iequil = args(5).int_value ();
+ F77_INT nr = args(6).int_value ();
+ const F77_INT iordsel = args(7).int_value ();
double alpha = args(8).double_value ();
- const octave_idx_type ijobv = args(9).int_value ();
+ const F77_INT ijobv = args(9).int_value ();
Matrix av = args(10).matrix_value ();
Matrix bv = args(11).matrix_value ();
Matrix cv = args(12).matrix_value ();
Matrix dv = args(13).matrix_value ();
- const octave_idx_type ijobw = args(14).int_value ();
+ const F77_INT ijobw = args(14).int_value ();
Matrix aw = args(15).matrix_value ();
Matrix bw = args(16).matrix_value ();
Matrix cw = args(17).matrix_value ();
Matrix dw = args(18).matrix_value ();
- const octave_idx_type ijobinv = args(19).int_value ();
+ const F77_INT ijobinv = args(19).int_value ();
double tol1 = args(20).double_value ();
double tol2 = args(21).double_value ();
@@ -182,35 +181,35 @@ For internal use only.")
else
ordsel = 'A';
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type nv = av.rows ();
- octave_idx_type nw = aw.rows ();
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT nv = TO_F77_INT (av.rows ());
+ F77_INT nw = TO_F77_INT (aw.rows ());
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, p);
- octave_idx_type ldd = max (1, p);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, p);
+ F77_INT ldd = max (1, p);
- octave_idx_type ldav = max (1, nv);
- octave_idx_type ldbv = max (1, nv);
- octave_idx_type ldcv = max (1, p);
- octave_idx_type lddv = max (1, p);
+ F77_INT ldav = max (1, nv);
+ F77_INT ldbv = max (1, nv);
+ F77_INT ldcv = max (1, p);
+ F77_INT lddv = max (1, p);
- octave_idx_type ldaw = max (1, nw);
- octave_idx_type ldbw = max (1, nw);
- octave_idx_type ldcw = max (1, m);
- octave_idx_type lddw = max (1, m);
+ F77_INT ldaw = max (1, nw);
+ F77_INT ldbw = max (1, nw);
+ F77_INT ldcw = max (1, m);
+ F77_INT lddw = max (1, m);
// arguments out
- octave_idx_type ns;
+ F77_INT ns;
ColumnVector hsv (n);
// workspace
- octave_idx_type liwork;
- octave_idx_type tmpc;
- octave_idx_type tmpd;
+ F77_INT liwork;
+ F77_INT tmpc;
+ F77_INT tmpd;
if (jobv == 'N')
tmpc = 0;
@@ -227,13 +226,13 @@ For internal use only.")
else
liwork = max (1, n, m, tmpc, tmpd);
- octave_idx_type ldwork;
- octave_idx_type nvp = nv + p;
- octave_idx_type nwm = nw + m;
- octave_idx_type ldw1;
- octave_idx_type ldw2;
- octave_idx_type ldw3 = n*(2*n + max (n, m, p) + 5) + n*(n+1)/2;
- octave_idx_type ldw4 = n*(m+p+2) + 2*m*p + min (n, m) + max (3*m+1, min (n, m) + p);
+ F77_INT ldwork;
+ F77_INT nvp = nv + p;
+ F77_INT nwm = nw + m;
+ F77_INT ldw1;
+ F77_INT ldw2;
+ F77_INT ldw3 = n*(2*n + max (n, m, p) + 5) + n*(n+1)/2;
+ F77_INT ldw4 = n*(m+p+2) + 2*m*p + min (n, m) + max (3*m+1, min (n, m) + p);
if (jobv == 'N')
{
@@ -257,12 +256,12 @@ For internal use only.")
ldwork = max (ldw1, ldw2, ldw3, ldw4);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicators
- octave_idx_type iwarn = 0;
- octave_idx_type info = 0;
+ F77_INT iwarn = 0;
+ F77_INT info = 0;
// SLICOT routine AB09JD
diff --git a/src/sl_ab13ad.cc b/src/sl_ab13ad.cc
--- a/src/sl_ab13ad.cc
+++ b/src/sl_ab13ad.cc
@@ -28,22 +28,21 @@ Version: 0.4
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (ab13ad, AB13AD)
(char& DICO, char& EQUIL,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
+ F77_INT& N, F77_INT& M, F77_INT& P,
double& ALPHA,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- octave_idx_type& NS,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ F77_INT& NS,
double* HSV,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_ab13ad__", "__control_slicot_functions__.oct");
@@ -69,9 +68,9 @@ For internal use only.")
Matrix a = args(0).matrix_value ();
Matrix b = args(1).matrix_value ();
Matrix c = args(2).matrix_value ();
- octave_idx_type discrete = args(3).int_value ();
+ F77_INT discrete = args(3).int_value ();
double alpha = args(4).double_value ();
- const octave_idx_type scaled = args(5).int_value ();
+ const F77_INT scaled = args(5).int_value ();
if (discrete == 0)
dico = 'C';
@@ -84,26 +83,26 @@ For internal use only.")
equil = 'N';
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, a.rows ());
- octave_idx_type ldb = max (1, b.rows ());
- octave_idx_type ldc = max (1, c.rows ());
+ F77_INT lda = max (1, TO_F77_INT (a.rows ()));
+ F77_INT ldb = max (1, TO_F77_INT (b.rows ()));
+ F77_INT ldc = max (1, TO_F77_INT (c.rows ()));
// arguments out
- octave_idx_type ns = 0;
+ F77_INT ns = 0;
ColumnVector hsv (n);
// workspace
- octave_idx_type ldwork = max (1, n*(max (n, m, p) + 5) + n*(n+1)/2);
+ F77_INT ldwork = max (1, n*(max (n, m, p) + 5) + n*(n+1)/2);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicators
- octave_idx_type info = 0;
+ F77_INT info = 0;
// SLICOT routine AB13AD
diff --git a/src/sl_ab13bd.cc b/src/sl_ab13bd.cc
--- a/src/sl_ab13bd.cc
+++ b/src/sl_ab13bd.cc
@@ -28,23 +28,22 @@ Version: 0.5
*/
#include
-#include
#include "common.h"
extern "C"
{
double F77_FUNC (ab13bd, AB13BD)
(char& DICO, char& JOBN,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- octave_idx_type& NQ,
+ F77_INT& N, F77_INT& M, F77_INT& P,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ F77_INT& NQ,
double& TOL,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& IWARN,
- octave_idx_type& INFO);
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& IWARN,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_ab13bd__", "__control_slicot_functions__.oct");
@@ -71,38 +70,38 @@ For internal use only.")
Matrix b = args(1).matrix_value ();
Matrix c = args(2).matrix_value ();
Matrix d = args(3).matrix_value ();
- octave_idx_type discrete = args(4).int_value ();
+ F77_INT discrete = args(4).int_value ();
if (discrete == 0)
dico = 'C';
else
dico = 'D';
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, a.rows ());
- octave_idx_type ldb = max (1, b.rows ());
- octave_idx_type ldc = max (1, c.rows ());
- octave_idx_type ldd = max (1, d.rows ());
+ F77_INT lda = max (1, TO_F77_INT (a.rows ()));
+ F77_INT ldb = max (1, TO_F77_INT (b.rows ()));
+ F77_INT ldc = max (1, TO_F77_INT (c.rows ()));
+ F77_INT ldd = max (1, TO_F77_INT (d.rows ()));
// arguments out
double norm;
- octave_idx_type nq;
+ F77_INT nq;
// tolerance
double tol = 0;
// workspace
- octave_idx_type ldwork = max (1, m*(n+m) + max (n*(n+5), m*(m+2), 4*p ),
+ F77_INT ldwork = max (1, m*(n+m) + max (n*(n+5), m*(m+2), 4*p ),
n*(max (n, p) + 4 ) + min (n, p));
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicator
- octave_idx_type iwarn;
- octave_idx_type info;
+ F77_INT iwarn;
+ F77_INT info;
// SLICOT routine AB13BD
diff --git a/src/sl_ab13dd.cc b/src/sl_ab13dd.cc
--- a/src/sl_ab13dd.cc
+++ b/src/sl_ab13dd.cc
@@ -28,7 +28,6 @@ Version: 0.5
*/
#include
-#include
#include
#include "common.h"
@@ -37,18 +36,18 @@ extern "C"
int F77_FUNC (ab13dd, AB13DD)
(char& DICO, char& JOBE,
char& EQUIL, char& JOBD,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
+ F77_INT& N, F77_INT& M, F77_INT& P,
double* FPEAK,
- double* A, octave_idx_type& LDA,
- double* E, octave_idx_type& LDE,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
+ double* A, F77_INT& LDA,
+ double* E, F77_INT& LDE,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
double* GPEAK,
double& TOL,
- octave_idx_type* IWORK, double* DWORK, octave_idx_type& LDWORK,
- Complex* CWORK, octave_idx_type& LCWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK, double* DWORK, F77_INT& LDWORK,
+ Complex* CWORK, F77_INT& LCWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_ab13dd__", "__control_slicot_functions__.oct");
@@ -78,10 +77,10 @@ For internal use only.")
Matrix b = args(2).matrix_value ();
Matrix c = args(3).matrix_value ();
Matrix d = args(4).matrix_value ();
- octave_idx_type discrete = args(5).int_value ();
- octave_idx_type descriptor = args(6).int_value ();
+ F77_INT discrete = args(5).int_value ();
+ F77_INT descriptor = args(6).int_value ();
double tol = args(7).double_value ();
- const octave_idx_type scaled = args(8).int_value ();
+ const F77_INT scaled = args(8).int_value ();
if (discrete == 0)
dico = 'C';
@@ -98,15 +97,15 @@ For internal use only.")
else
equil = 'N';
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type lde = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, p);
- octave_idx_type ldd = max (1, p);
+ F77_INT lda = max (1, n);
+ F77_INT lde = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, p);
+ F77_INT ldd = max (1, p);
ColumnVector fpeak (2);
ColumnVector gpeak (2);
@@ -115,16 +114,16 @@ For internal use only.")
fpeak(1) = 1;
// workspace
- octave_idx_type ldwork = max (1, 15*n*n + p*p + m*m + (6*n+3)*(p+m) + 4*p*m +
+ F77_INT ldwork = max (1, 15*n*n + p*p + m*m + (6*n+3)*(p+m) + 4*p*m +
n*m + 22*n + 7*min(p,m));
- octave_idx_type lcwork = max (1, (n+m)*(n+p) + 2*min(p,m) + max(p,m));
+ F77_INT lcwork = max (1, (n+m)*(n+p) + 2*min(p,m) + max(p,m));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, n);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, n);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
OCTAVE_LOCAL_BUFFER (Complex, cwork, lcwork);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine AB13DD
diff --git a/src/sl_ag08bd.cc b/src/sl_ag08bd.cc
--- a/src/sl_ag08bd.cc
+++ b/src/sl_ag08bd.cc
@@ -28,7 +28,6 @@ Version: 0.5
*/
#include
-#include
#include "common.h"
#include
#include
@@ -37,31 +36,31 @@ extern "C"
{
int F77_FUNC (ag08bd, AG08BD)
(char& EQUIL,
- octave_idx_type& L, octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
- double* A, octave_idx_type& LDA,
- double* E, octave_idx_type& LDE,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- octave_idx_type& NFZ, octave_idx_type& NRANK, octave_idx_type& NIZ, octave_idx_type& DINFZ,
- octave_idx_type& NKROR, octave_idx_type& NINFE, octave_idx_type& NKROL,
- octave_idx_type* INFZ,
- octave_idx_type* KRONR, octave_idx_type* INFE, octave_idx_type* KRONL,
+ F77_INT& L, F77_INT& N, F77_INT& M, F77_INT& P,
+ double* A, F77_INT& LDA,
+ double* E, F77_INT& LDE,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ F77_INT& NFZ, F77_INT& NRANK, F77_INT& NIZ, F77_INT& DINFZ,
+ F77_INT& NKROR, F77_INT& NINFE, F77_INT& NKROL,
+ F77_INT* INFZ,
+ F77_INT* KRONR, F77_INT* INFE, F77_INT* KRONL,
double& TOL,
- octave_idx_type* IWORK, double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK, double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
int F77_FUNC (dggev, DGGEV)
(char& JOBVL, char& JOBVR,
- octave_idx_type& N,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
+ F77_INT& N,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
double* ALPHAR, double* ALPHAI,
double* BETA,
- double* VL, octave_idx_type& LDVL,
- double* VR, octave_idx_type& LDVR,
- double* WORK, octave_idx_type& LWORK,
- octave_idx_type& INFO);
+ double* VL, F77_INT& LDVL,
+ double* VR, F77_INT& LDVR,
+ double* WORK, F77_INT& LWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_ag08bd__", "__control_slicot_functions__.oct");
@@ -88,50 +87,50 @@ For internal use only.")
Matrix b = args(2).matrix_value ();
Matrix c = args(3).matrix_value ();
Matrix d = args(4).matrix_value ();
- const octave_idx_type scaled = args(5).int_value ();
+ const F77_INT scaled = args(5).int_value ();
if (scaled == 0)
equil = 'S';
else
equil = 'N';
- octave_idx_type l = a.rows (); // l: number of states
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT l = TO_F77_INT (a.rows ()); // l: number of states
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, l);
- octave_idx_type lde = max (1, l);
- octave_idx_type ldb = max (1, l);
+ F77_INT lda = max (1, l);
+ F77_INT lde = max (1, l);
+ F77_INT ldb = max (1, l);
if (m == 0)
ldb = 1;
- octave_idx_type ldc = max (1, p);
- octave_idx_type ldd = max (1, p);
+ F77_INT ldc = max (1, p);
+ F77_INT ldd = max (1, p);
// arguments out
- octave_idx_type nfz;
- octave_idx_type nrank;
- octave_idx_type niz;
- octave_idx_type dinfz;
- octave_idx_type nkror;
- octave_idx_type ninfe;
- octave_idx_type nkrol;
+ F77_INT nfz;
+ F77_INT nrank;
+ F77_INT niz;
+ F77_INT dinfz;
+ F77_INT nkror;
+ F77_INT ninfe;
+ F77_INT nkrol;
- OCTAVE_LOCAL_BUFFER (octave_idx_type, infz, n+1);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, kronr, n+m+1);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, infe, 1 + min (l+p, n+m));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, kronl, l+p+1);
+ OCTAVE_LOCAL_BUFFER (F77_INT, infz, n+1);
+ OCTAVE_LOCAL_BUFFER (F77_INT, kronr, n+m+1);
+ OCTAVE_LOCAL_BUFFER (F77_INT, infe, 1 + min (l+p, n+m));
+ OCTAVE_LOCAL_BUFFER (F77_INT, kronl, l+p+1);
// workspace
- octave_idx_type ldwork = max (l+p, m+n) * (m+n) + max (1, 5 * max (l+p, m+n));
+ F77_INT ldwork = max (l+p, m+n) * (m+n) + max (1, 5 * max (l+p, m+n));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, n + max (1, m));
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, n + max (1, m));
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// tolerance
double tol = 0; // AG08BD uses DLAMCH for default tolerance
@@ -175,14 +174,14 @@ For internal use only.")
ColumnVector beta (nfz);
double* vl = 0; // not referenced because jobvl = 'N'
- octave_idx_type ldvl = 1;
+ F77_INT ldvl = 1;
double* vr = 0; // not referenced because jobvr = 'N'
- octave_idx_type ldvr = 1;
+ F77_INT ldvr = 1;
- octave_idx_type lwork = max (1, 8*nfz);
+ F77_INT lwork = max (1, 8*nfz);
OCTAVE_LOCAL_BUFFER (double, work, lwork);
- octave_idx_type info2;
+ F77_INT info2;
F77_XFCN (dggev, DGGEV,
(jobvl, jobvr,
@@ -222,7 +221,7 @@ For internal use only.")
ComplexColumnVector zero (nfz, Complex ());
- for (octave_idx_type i = 0; i < nfz; i++)
+ for (F77_INT i = 0; i < nfz; i++)
zero.xelem (i) = Complex (zeror(i), zeroi(i));
// prepare additional outputs for info struct
@@ -230,13 +229,13 @@ For internal use only.")
RowVector kronrr (nkror);
RowVector kronlr (nkrol);
- for (octave_idx_type i = 0; i < dinfz; i++)
+ for (F77_INT i = 0; i < dinfz; i++)
infzr.xelem (i) = infz[i];
- for (octave_idx_type i = 0; i < nkror; i++)
+ for (F77_INT i = 0; i < nkror; i++)
kronrr.xelem (i) = kronr[i];
- for (octave_idx_type i = 0; i < nkrol; i++)
+ for (F77_INT i = 0; i < nkrol; i++)
kronlr.xelem (i) = kronl[i];
// return values
diff --git a/src/sl_are.cc b/src/sl_are.cc
--- a/src/sl_are.cc
+++ b/src/sl_are.cc
@@ -28,7 +28,6 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
#include
@@ -37,17 +36,17 @@ extern "C"
int F77_FUNC (sb02mt, SB02MT)
(char& JOBG, char& JOBL,
char& FACT, char& UPLO,
- octave_idx_type& N, octave_idx_type& M,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* Q, octave_idx_type& LDQ,
- double* R, octave_idx_type& LDR,
- double* L, octave_idx_type& LDL,
- octave_idx_type* IPIV, octave_idx_type& OUFACT,
- double* G, octave_idx_type& LDG,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ F77_INT& N, F77_INT& M,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* Q, F77_INT& LDQ,
+ double* R, F77_INT& LDR,
+ double* L, F77_INT& LDL,
+ F77_INT* IPIV, F77_INT& OUFACT,
+ double* G, F77_INT& LDG,
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
int F77_FUNC (sb02rd, SB02RD)
@@ -56,21 +55,21 @@ extern "C"
char& UPLO, char& SCAL,
char& SORT, char& FACT,
char& LYAPUN,
- octave_idx_type& N,
- double* A, octave_idx_type& LDA,
- double* T, octave_idx_type& LDT,
- double* V, octave_idx_type& LDV,
- double* G, octave_idx_type& LDG,
- double* Q, octave_idx_type& LDQ,
- double* X, octave_idx_type& LDX,
+ F77_INT& N,
+ double* A, F77_INT& LDA,
+ double* T, F77_INT& LDT,
+ double* V, F77_INT& LDV,
+ double* G, F77_INT& LDG,
+ double* Q, F77_INT& LDQ,
+ double* X, F77_INT& LDX,
double& SEP,
double& RCOND, double& FERR,
double* WR, double* WI,
- double* S, octave_idx_type& LDS,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
+ double* S, F77_INT& LDS,
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
bool* BWORK,
- octave_idx_type& INFO);
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_are__", "__control_slicot_functions__.oct");
@@ -103,8 +102,8 @@ For internal use only.")
Matrix q = args(2).matrix_value ();
Matrix r = args(3).matrix_value ();
Matrix l = args(4).matrix_value ();
- octave_idx_type discrete = args(5).int_value ();
- octave_idx_type ijobl = args(6).int_value ();
+ F77_INT discrete = args(5).int_value ();
+ F77_INT ijobl = args(6).int_value ();
if (discrete == 0)
dico = 'C';
@@ -116,32 +115,32 @@ For internal use only.")
else
jobl = 'N';
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldq = max (1, n);
- octave_idx_type ldr = max (1, m);
- octave_idx_type ldl = max (1, n);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldq = max (1, n);
+ F77_INT ldr = max (1, m);
+ F77_INT ldl = max (1, n);
// arguments out
- octave_idx_type ldg = max (1, n);
+ F77_INT ldg = max (1, n);
Matrix g (ldg, n);
// unused output arguments
- OCTAVE_LOCAL_BUFFER (octave_idx_type, ipiv, m);
- octave_idx_type oufact;
+ OCTAVE_LOCAL_BUFFER (F77_INT, ipiv, m);
+ F77_INT oufact;
// workspace
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork_a, m);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork_a, m);
- octave_idx_type ldwork_a = max (2, 3*m, n*m);
+ F77_INT ldwork_a = max (2, 3*m, n*m);
OCTAVE_LOCAL_BUFFER (double, dwork_a, ldwork_a);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SB02MT
@@ -188,10 +187,10 @@ For internal use only.")
char sort = 'S';
char lyapun = 'O';
- octave_idx_type ldt = max (1, n);
- octave_idx_type ldv = max (1, n);
- octave_idx_type ldx = max (1, n);
- octave_idx_type lds = max (1, 2*n);
+ F77_INT ldt = max (1, n);
+ F77_INT ldv = max (1, n);
+ F77_INT ldx = max (1, n);
+ F77_INT lds = max (1, 2*n);
// arguments out
Matrix x (ldx, n);
@@ -209,10 +208,10 @@ For internal use only.")
Matrix s (lds, 2*n);
// workspace
- octave_idx_type liwork_b = max (2*n, n*n);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork_b, liwork_b);
+ F77_INT liwork_b = max (2*n, n*n);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork_b, liwork_b);
- octave_idx_type ldwork_b = 5 + max (1, 4*n*n + 8*n);
+ F77_INT ldwork_b = 5 + max (1, 4*n*n + 8*n);
OCTAVE_LOCAL_BUFFER (double, dwork_b, ldwork_b);
OCTAVE_LOCAL_BUFFER (bool, bwork_b, 2*n);
@@ -274,7 +273,7 @@ For internal use only.")
// assemble complex vector - adapted from DEFUN complex in data.cc
ComplexColumnVector pole (n, Complex ());
- for (octave_idx_type i = 0; i < n; i++)
+ for (F77_INT i = 0; i < n; i++)
pole.xelem (i) = Complex (wr(i), wi(i));
// return value
diff --git a/src/sl_ib01ad.cc b/src/sl_ib01ad.cc
--- a/src/sl_ib01ad.cc
+++ b/src/sl_ib01ad.cc
@@ -28,7 +28,6 @@ Version: 0.2
*/
#include
-#include
#include
#include "common.h"
@@ -37,17 +36,17 @@ extern "C"
int F77_FUNC (ib01ad, IB01AD)
(char& METH, char& ALG, char& JOBD,
char& BATCH, char& CONCT, char& CTRL,
- octave_idx_type& NOBR, octave_idx_type& M, octave_idx_type& L,
- octave_idx_type& NSMP,
- double* U, octave_idx_type& LDU,
- double* Y, octave_idx_type& LDY,
- octave_idx_type& N,
- double* R, octave_idx_type& LDR,
+ F77_INT& NOBR, F77_INT& M, F77_INT& L,
+ F77_INT& NSMP,
+ double* U, F77_INT& LDU,
+ double* Y, F77_INT& LDY,
+ F77_INT& N,
+ double* R, F77_INT& LDR,
double* SV,
double& RCOND, double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& IWARN, octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& IWARN, F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_ib01ad__", "__control_slicot_functions__.oct");
@@ -81,13 +80,13 @@ For internal use only.")
const Cell y_cell = args(0).cell_value ();
const Cell u_cell = args(1).cell_value ();
- octave_idx_type nobr = args(2).int_value ();
- octave_idx_type nuser = args(3).int_value ();
+ F77_INT nobr = args(2).int_value ();
+ F77_INT nuser = args(3).int_value ();
- const octave_idx_type imeth = args(4).int_value ();
- const octave_idx_type ialg = args(5).int_value ();
- const octave_idx_type iconct = args(6).int_value ();
- const octave_idx_type ictrl = args(7).int_value (); // ignored
+ const F77_INT imeth = args(4).int_value ();
+ const F77_INT ialg = args(5).int_value ();
+ const F77_INT iconct = args(6).int_value ();
+ const F77_INT ictrl = args(7).int_value (); // ignored
double rcond = args(8).double_value ();
double tol_a = args(9).double_value ();
@@ -145,14 +144,14 @@ For internal use only.")
ctrl = 'N';
*/
// m and l are equal for all experiments, checked by iddata class
- octave_idx_type n_exp = y_cell.nelem (); // number of experiments
- octave_idx_type m = u_cell.elem(0).columns (); // m: number of inputs
- octave_idx_type l = y_cell.elem(0).columns (); // l: number of outputs
- octave_idx_type nsmpl = 0; // total number of samples
+ F77_INT n_exp = TO_F77_INT (y_cell.nelem ()); // number of experiments
+ F77_INT m = TO_F77_INT (u_cell.elem(0).columns ()); // m: number of inputs
+ F77_INT l = TO_F77_INT (y_cell.elem(0).columns ()); // l: number of outputs
+ F77_INT nsmpl = 0; // total number of samples
// arguments out
- octave_idx_type n;
- octave_idx_type ldr;
+ F77_INT n;
+ F77_INT ldr;
if (meth_a == 'M' && jobd == 'M')
ldr = max (2*(m+l)*nobr, 3*m*nobr);
@@ -166,7 +165,7 @@ For internal use only.")
// repeat for every experiment in the dataset
- for (octave_idx_type i = 0; i < n_exp; i++)
+ for (F77_INT i = 0; i < n_exp; i++)
{
if (n_exp == 1)
batch = 'O'; // one block only
@@ -181,9 +180,9 @@ For internal use only.")
Matrix u = u_cell.elem(i).matrix_value ();
// y.rows == u.rows is checked by iddata class
- // octave_idx_type m = u.columns (); // m: number of inputs
- // octave_idx_type l = y.columns (); // l: number of outputs
- octave_idx_type nsmp = y.rows (); // nsmp: number of samples in the current experiment
+ // F77_INT m = TO_F77_INT (u.columns ()); // m: number of inputs
+ // F77_INT l = TO_F77_INT (y.columns ()); // l: number of outputs
+ F77_INT nsmp = TO_F77_INT (y.rows ()); // nsmp: number of samples in the current experiment
nsmpl += nsmp; // nsmpl: total number of samples of all experiments
// minimal nsmp size checked by __slicot_identification__.m
@@ -198,17 +197,17 @@ For internal use only.")
error ("__sl_ident__: require NSMP >= 2*NOBR");
}
- octave_idx_type ldu;
+ F77_INT ldu;
if (m == 0)
ldu = 1;
else // m > 0
ldu = nsmp;
- octave_idx_type ldy = nsmp;
+ F77_INT ldy = nsmp;
// workspace
- octave_idx_type liwork_a;
+ F77_INT liwork_a;
if (meth_a == 'N') // if METH = 'N'
liwork_a = (m+l)*nobr;
@@ -219,8 +218,8 @@ For internal use only.")
// TODO: Handle 'k' for DWORK
- octave_idx_type ldwork_a;
- octave_idx_type ns = nsmp - 2*nobr + 1;
+ F77_INT ldwork_a;
+ F77_INT ns = nsmp - 2*nobr + 1;
if (alg == 'C')
{
@@ -256,7 +255,7 @@ For internal use only.")
}
else // (alg == 'Q')
{
- // octave_idx_type ns = nsmp - 2*nobr + 1;
+ // F77_INT ns = nsmp - 2*nobr + 1;
if (ldr >= ns && batch == 'F')
{
@@ -306,12 +305,12 @@ For internal use only.")
*/
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork_a, liwork_a);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork_a, liwork_a);
OCTAVE_LOCAL_BUFFER (double, dwork_a, ldwork_a);
// error indicators
- octave_idx_type iwarn_a = 0;
- octave_idx_type info_a = 0;
+ F77_INT iwarn_a = 0;
+ F77_INT info_a = 0;
// SLICOT routine IB01AD
@@ -370,7 +369,7 @@ For internal use only.")
// resize
- octave_idx_type rs = 2*(m+l)*nobr;
+ F77_INT rs = 2*(m+l)*nobr;
r.resize (rs, rs);
diff --git a/src/sl_ib01cd.cc b/src/sl_ib01cd.cc
--- a/src/sl_ib01cd.cc
+++ b/src/sl_ib01cd.cc
@@ -28,7 +28,6 @@ Version: 0.2
*/
#include
-#include
#include
#include "common.h"
@@ -36,20 +35,20 @@ extern "C"
{
int F77_FUNC (ib01cd, IB01CD)
(char& JOBX0, char& COMUSE, char& JOB,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& L,
- octave_idx_type& NSMP,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- double* U, octave_idx_type& LDU,
- double* Y, octave_idx_type& LDY,
+ F77_INT& N, F77_INT& M, F77_INT& L,
+ F77_INT& NSMP,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ double* U, F77_INT& LDU,
+ double* Y, F77_INT& LDY,
double* X0,
- double* V, octave_idx_type& LDV,
+ double* V, F77_INT& LDV,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& IWARN, octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& IWARN, F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_ib01cd__", "__control_slicot_functions__.oct");
@@ -84,17 +83,17 @@ For internal use only.")
double rcond = args(6).double_value ();
double tol_c = rcond;
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type l = c.rows (); // l: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT l = TO_F77_INT (c.rows ()); // l: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, l);
- octave_idx_type ldd = max (1, l);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, l);
+ F77_INT ldd = max (1, l);
// m and l are equal for all experiments, checked by iddata class
- octave_idx_type n_exp = y_cell.nelem (); // number of experiments
+ F77_INT n_exp = TO_F77_INT (y_cell.nelem ()); // number of experiments
// arguments out
@@ -102,44 +101,44 @@ For internal use only.")
// repeat for every experiment in the dataset
// compute individual initial state vector x0 for every experiment
- for (octave_idx_type i = 0; i < n_exp; i++)
+ for (F77_INT i = 0; i < n_exp; i++)
{
Matrix y = y_cell.elem(i).matrix_value ();
Matrix u = u_cell.elem(i).matrix_value ();
- octave_idx_type nsmp = y.rows (); // nsmp: number of samples
- octave_idx_type ldv = max (1, n);
+ F77_INT nsmp = TO_F77_INT (y.rows ()); // nsmp: number of samples
+ F77_INT ldv = max (1, n);
- octave_idx_type ldu;
+ F77_INT ldu;
if (m == 0)
ldu = 1;
else // m > 0
ldu = nsmp;
- octave_idx_type ldy = nsmp;
+ F77_INT ldy = nsmp;
// arguments out
ColumnVector x0 (n);
Matrix v (ldv, n);
// workspace
- octave_idx_type liwork_c = n; // if JOBX0 = 'X' and COMUSE <> 'C'
- octave_idx_type ldwork_c;
- octave_idx_type t = nsmp;
+ F77_INT liwork_c = n; // if JOBX0 = 'X' and COMUSE <> 'C'
+ F77_INT ldwork_c;
+ F77_INT t = nsmp;
- octave_idx_type ldw1_c = 2;
- octave_idx_type ldw2_c = t*l*(n + 1) + 2*n + max (2*n*n, 4*n);
- octave_idx_type ldw3_c = n*(n + 1) + 2*n + max (n*l*(n + 1) + 2*n*n + l*n, 4*n);
+ F77_INT ldw1_c = 2;
+ F77_INT ldw2_c = t*l*(n + 1) + 2*n + max (2*n*n, 4*n);
+ F77_INT ldw3_c = n*(n + 1) + 2*n + max (n*l*(n + 1) + 2*n*n + l*n, 4*n);
ldwork_c = ldw1_c + n*( n + m + l ) + max (5*n, ldw1_c, min (ldw2_c, ldw3_c));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork_c, liwork_c);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork_c, liwork_c);
OCTAVE_LOCAL_BUFFER (double, dwork_c, ldwork_c);
// error indicators
- octave_idx_type iwarn_c = 0;
- octave_idx_type info_c = 0;
+ F77_INT iwarn_c = 0;
+ F77_INT info_c = 0;
// SLICOT routine IB01CD
F77_XFCN (ib01cd, IB01CD,
diff --git a/src/sl_ident.cc b/src/sl_ident.cc
--- a/src/sl_ident.cc
+++ b/src/sl_ident.cc
@@ -28,7 +28,6 @@ Version: 0.2
*/
#include
-#include
#include
#include "common.h"
@@ -37,53 +36,53 @@ extern "C"
int F77_FUNC (ib01ad, IB01AD)
(char& METH, char& ALG, char& JOBD,
char& BATCH, char& CONCT, char& CTRL,
- octave_idx_type& NOBR, octave_idx_type& M, octave_idx_type& L,
- octave_idx_type& NSMP,
- double* U, octave_idx_type& LDU,
- double* Y, octave_idx_type& LDY,
- octave_idx_type& N,
- double* R, octave_idx_type& LDR,
+ F77_INT& NOBR, F77_INT& M, F77_INT& L,
+ F77_INT& NSMP,
+ double* U, F77_INT& LDU,
+ double* Y, F77_INT& LDY,
+ F77_INT& N,
+ double* R, F77_INT& LDR,
double* SV,
double& RCOND, double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& IWARN, octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& IWARN, F77_INT& INFO);
int F77_FUNC (ib01bd, IB01BD)
(char& METH, char& JOB, char& JOBCK,
- octave_idx_type& NOBR, octave_idx_type& N, octave_idx_type& M, octave_idx_type& L,
- octave_idx_type& NSMPL,
- double* R, octave_idx_type& LDR,
- double* A, octave_idx_type& LDA,
- double* C, octave_idx_type& LDC,
- double* B, octave_idx_type& LDB,
- double* D, octave_idx_type& LDD,
- double* Q, octave_idx_type& LDQ,
- double* RY, octave_idx_type& LDRY,
- double* S, octave_idx_type& LDS,
- double* K, octave_idx_type& LDK,
+ F77_INT& NOBR, F77_INT& N, F77_INT& M, F77_INT& L,
+ F77_INT& NSMPL,
+ double* R, F77_INT& LDR,
+ double* A, F77_INT& LDA,
+ double* C, F77_INT& LDC,
+ double* B, F77_INT& LDB,
+ double* D, F77_INT& LDD,
+ double* Q, F77_INT& LDQ,
+ double* RY, F77_INT& LDRY,
+ double* S, F77_INT& LDS,
+ double* K, F77_INT& LDK,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
bool* BWORK,
- octave_idx_type& IWARN, octave_idx_type& INFO);
+ F77_INT& IWARN, F77_INT& INFO);
int F77_FUNC (ib01cd, IB01CD)
(char& JOBX0, char& COMUSE, char& JOB,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& L,
- octave_idx_type& NSMP,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- double* U, octave_idx_type& LDU,
- double* Y, octave_idx_type& LDY,
+ F77_INT& N, F77_INT& M, F77_INT& L,
+ F77_INT& NSMP,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ double* U, F77_INT& LDU,
+ double* Y, F77_INT& LDY,
double* X0,
- double* V, octave_idx_type& LDV,
+ double* V, F77_INT& LDV,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& IWARN, octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& IWARN, F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_ident__", "__control_slicot_functions__.oct");
@@ -117,13 +116,13 @@ For internal use only.")
const Cell y_cell = args(0).cell_value ();
const Cell u_cell = args(1).cell_value ();
- octave_idx_type nobr = args(2).int_value ();
- octave_idx_type nuser = args(3).int_value ();
+ F77_INT nobr = args(2).int_value ();
+ F77_INT nuser = args(3).int_value ();
- const octave_idx_type imeth = args(4).int_value ();
- const octave_idx_type ialg = args(5).int_value ();
- const octave_idx_type iconct = args(6).int_value ();
- const octave_idx_type ictrl = args(7).int_value ();
+ const F77_INT imeth = args(4).int_value ();
+ const F77_INT ialg = args(5).int_value ();
+ const F77_INT iconct = args(6).int_value ();
+ const F77_INT ictrl = args(7).int_value ();
double rcond = args(8).double_value ();
double tol_a = args(9).double_value ();
@@ -181,14 +180,14 @@ For internal use only.")
ctrl = 'N';
// m and l are equal for all experiments, checked by iddata class
- octave_idx_type n_exp = y_cell.nelem (); // number of experiments
- octave_idx_type m = u_cell.elem(0).columns (); // m: number of inputs
- octave_idx_type l = y_cell.elem(0).columns (); // l: number of outputs
- octave_idx_type nsmpl = 0; // total number of samples
+ F77_INT n_exp = TO_F77_INT (y_cell.nelem ()); // number of experiments
+ F77_INT m = TO_F77_INT (u_cell.elem(0).columns ()); // m: number of inputs
+ F77_INT l = TO_F77_INT (y_cell.elem(0).columns ()); // l: number of outputs
+ F77_INT nsmpl = 0; // total number of samples
// arguments out
- octave_idx_type n;
- octave_idx_type ldr;
+ F77_INT n;
+ F77_INT ldr;
if (meth_a == 'M' && jobd == 'M')
ldr = max (2*(m+l)*nobr, 3*m*nobr);
@@ -202,7 +201,7 @@ For internal use only.")
// repeat for every experiment in the dataset
- for (octave_idx_type i = 0; i < n_exp; i++)
+ for (F77_INT i = 0; i < n_exp; i++)
{
if (n_exp == 1)
batch = 'O'; // one block only
@@ -217,9 +216,9 @@ For internal use only.")
Matrix u = u_cell.elem(i).matrix_value ();
// y.rows == u.rows is checked by iddata class
- // octave_idx_type m = u.columns (); // m: number of inputs
- // octave_idx_type l = y.columns (); // l: number of outputs
- octave_idx_type nsmp = y.rows (); // nsmp: number of samples in the current experiment
+ // F77_INT m = TO_F77_INT (u.columns ()); // m: number of inputs
+ // F77_INT l = TO_F77_INT (y.columns ()); // l: number of outputs
+ F77_INT nsmp = TO_F77_INT (y.rows ()); // nsmp: number of samples in the current experiment
nsmpl += nsmp; // nsmpl: total number of samples of all experiments
// minimal nsmp size checked by __slicot_identification__.m
@@ -234,17 +233,17 @@ For internal use only.")
error ("__sl_ident__: require NSMP >= 2*NOBR");
}
- octave_idx_type ldu;
+ F77_INT ldu;
if (m == 0)
ldu = 1;
else // m > 0
ldu = nsmp;
- octave_idx_type ldy = nsmp;
+ F77_INT ldy = nsmp;
// workspace
- octave_idx_type liwork_a;
+ F77_INT liwork_a;
if (meth_a == 'N') // if METH = 'N'
liwork_a = (m+l)*nobr;
@@ -255,8 +254,8 @@ For internal use only.")
// TODO: Handle 'k' for DWORK
- octave_idx_type ldwork_a;
- octave_idx_type ns = nsmp - 2*nobr + 1;
+ F77_INT ldwork_a;
+ F77_INT ns = nsmp - 2*nobr + 1;
if (alg == 'C')
{
@@ -292,7 +291,7 @@ For internal use only.")
}
else // (alg == 'Q')
{
- // octave_idx_type ns = nsmp - 2*nobr + 1;
+ // F77_INT ns = nsmp - 2*nobr + 1;
if (ldr >= ns && batch == 'F')
{
@@ -342,12 +341,12 @@ For internal use only.")
*/
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork_a, liwork_a);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork_a, liwork_a);
OCTAVE_LOCAL_BUFFER (double, dwork_a, ldwork_a);
// error indicators
- octave_idx_type iwarn_a = 0;
- octave_idx_type info_a = 0;
+ F77_INT iwarn_a = 0;
+ F77_INT info_a = 0;
// SLICOT routine IB01AD
@@ -406,7 +405,7 @@ For internal use only.")
// resize
- octave_idx_type rs = 2*(m+l)*nobr;
+ F77_INT rs = 2*(m+l)*nobr;
r.resize (rs, rs);
if (nuser > 0)
@@ -428,20 +427,20 @@ For internal use only.")
char job = 'A';
char jobck = 'K';
- //octave_idx_type nsmpl = nsmp;
+ //F77_INT nsmpl = nsmp;
if (nsmpl < 2*(m+l)*nobr)
error ("__sl_ident__: nsmpl (%d) < 2*(m+l)*nobr (%d)", nsmpl, nobr);
// arguments out
- octave_idx_type lda = max (1, n);
- octave_idx_type ldc = max (1, l);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldd = max (1, l);
- octave_idx_type ldq = n; // if JOBCK = 'C' or 'K'
- octave_idx_type ldry = l; // if JOBCK = 'C' or 'K'
- octave_idx_type lds = n; // if JOBCK = 'C' or 'K'
- octave_idx_type ldk = n; // if JOBCK = 'K'
+ F77_INT lda = max (1, n);
+ F77_INT ldc = max (1, l);
+ F77_INT ldb = max (1, n);
+ F77_INT ldd = max (1, l);
+ F77_INT ldq = n; // if JOBCK = 'C' or 'K'
+ F77_INT ldry = l; // if JOBCK = 'C' or 'K'
+ F77_INT lds = n; // if JOBCK = 'C' or 'K'
+ F77_INT ldk = n; // if JOBCK = 'K'
Matrix a (lda, n);
Matrix c (ldc, n);
@@ -454,28 +453,28 @@ For internal use only.")
Matrix k (ldk, l);
// workspace
- octave_idx_type liwork_b;
- octave_idx_type liw1;
- octave_idx_type liw2;
+ F77_INT liwork_b;
+ F77_INT liw1;
+ F77_INT liw2;
liw1 = max (n, m*nobr+n, l*nobr, m*(n+l));
liw2 = n*n; // if JOBCK = 'K'
liwork_b = max (liw1, liw2);
- octave_idx_type ldwork_b;
- octave_idx_type ldw1;
- octave_idx_type ldw2;
- octave_idx_type ldw3;
+ F77_INT ldwork_b;
+ F77_INT ldw1;
+ F77_INT ldw2;
+ F77_INT ldw3;
if (meth_b == 'M')
{
- octave_idx_type ldw1a = max (2*(l*nobr-l)*n+2*n, (l*nobr-l)*n+n*n+7*n);
- octave_idx_type ldw1b = max (2*(l*nobr-l)*n+n*n+7*n,
+ F77_INT ldw1a = max (2*(l*nobr-l)*n+2*n, (l*nobr-l)*n+n*n+7*n);
+ F77_INT ldw1b = max (2*(l*nobr-l)*n+n*n+7*n,
(l*nobr-l)*n+n+6*m*nobr,
(l*nobr-l)*n+n+max (l+m*nobr, l*nobr + max (3*l*nobr+1, m)));
ldw1 = max (ldw1a, ldw1b);
- octave_idx_type aw;
+ F77_INT aw;
if (m == 0 || job == 'C')
aw = n + n*n;
@@ -499,8 +498,8 @@ For internal use only.")
}
else // (meth_b == 'C')
{
- octave_idx_type ldw1a = max (2*(l*nobr-l)*n+2*n, (l*nobr-l)*n+n*n+7*n);
- octave_idx_type ldw1b = l*nobr*n + max ((l*nobr-l)*n+2*n+(2*m+l)*nobr+l,
+ F77_INT ldw1a = max (2*(l*nobr-l)*n+2*n, (l*nobr-l)*n+n*n+7*n);
+ F77_INT ldw1b = l*nobr*n + max ((l*nobr-l)*n+2*n+(2*m+l)*nobr+l,
2*(l*nobr-l)*n+n*n+8*n,
n+4*(m*nobr+n)+1,
m*nobr+3*n+l);
@@ -515,14 +514,14 @@ For internal use only.")
ldwork_b = max (ldw1, ldw2, ldw3);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork_b, liwork_b);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork_b, liwork_b);
OCTAVE_LOCAL_BUFFER (double, dwork_b, ldwork_b);
OCTAVE_LOCAL_BUFFER (bool, bwork, 2*n);
// error indicators
- octave_idx_type iwarn_b = 0;
- octave_idx_type info_b = 0;
+ F77_INT iwarn_b = 0;
+ F77_INT info_b = 0;
// SLICOT routine IB01BD
@@ -610,44 +609,44 @@ For internal use only.")
// repeat for every experiment in the dataset
// compute individual initial state vector x0 for every experiment
- for (octave_idx_type i = 0; i < n_exp; i++)
+ for (F77_INT i = 0; i < n_exp; i++)
{
Matrix y = y_cell.elem(i).matrix_value ();
Matrix u = u_cell.elem(i).matrix_value ();
- octave_idx_type nsmp = y.rows (); // nsmp: number of samples
- octave_idx_type ldv = max (1, n);
+ F77_INT nsmp = TO_F77_INT (y.rows ()); // nsmp: number of samples
+ F77_INT ldv = max (1, n);
- octave_idx_type ldu;
+ F77_INT ldu;
if (m == 0)
ldu = 1;
else // m > 0
ldu = nsmp;
- octave_idx_type ldy = nsmp;
+ F77_INT ldy = nsmp;
// arguments out
ColumnVector x0 (n);
Matrix v (ldv, n);
// workspace
- octave_idx_type liwork_c = n; // if JOBX0 = 'X' and COMUSE <> 'C'
- octave_idx_type ldwork_c;
- octave_idx_type t = nsmp;
+ F77_INT liwork_c = n; // if JOBX0 = 'X' and COMUSE <> 'C'
+ F77_INT ldwork_c;
+ F77_INT t = nsmp;
- octave_idx_type ldw1_c = 2;
- octave_idx_type ldw2_c = t*l*(n + 1) + 2*n + max (2*n*n, 4*n);
- octave_idx_type ldw3_c = n*(n + 1) + 2*n + max (n*l*(n + 1) + 2*n*n + l*n, 4*n);
+ F77_INT ldw1_c = 2;
+ F77_INT ldw2_c = t*l*(n + 1) + 2*n + max (2*n*n, 4*n);
+ F77_INT ldw3_c = n*(n + 1) + 2*n + max (n*l*(n + 1) + 2*n*n + l*n, 4*n);
ldwork_c = ldw1_c + n*( n + m + l ) + max (5*n, ldw1_c, min (ldw2_c, ldw3_c));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork_c, liwork_c);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork_c, liwork_c);
OCTAVE_LOCAL_BUFFER (double, dwork_c, ldwork_c);
// error indicators
- octave_idx_type iwarn_c = 0;
- octave_idx_type info_c = 0;
+ F77_INT iwarn_c = 0;
+ F77_INT info_c = 0;
// SLICOT routine IB01CD
F77_XFCN (ib01cd, IB01CD,
diff --git a/src/sl_mb05nd.cc b/src/sl_mb05nd.cc
--- a/src/sl_mb05nd.cc
+++ b/src/sl_mb05nd.cc
@@ -28,20 +28,19 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (mb05nd, MB05ND)
- (octave_idx_type& N, double& DELTA,
- double* A, octave_idx_type& LDA,
- double* EX, octave_idx_type& LDEX,
- double* EXINT, octave_idx_type& LDEXINT,
+ (F77_INT& N, double& DELTA,
+ double* A, F77_INT& LDA,
+ double* EX, F77_INT& LDEX,
+ double* EXINT, F77_INT& LDEXINT,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_mb05nd__", "__control_slicot_functions__.oct");
@@ -65,22 +64,22 @@ For internal use only.")
double delta = args(1).double_value ();
double tol = args(2).double_value ();
- octave_idx_type n = a.rows ();
- octave_idx_type lda = max (1, n);
- octave_idx_type ldex = max (1, n);
- octave_idx_type ldexin = max (1, n);
+ F77_INT n = TO_F77_INT (a.rows ());
+ F77_INT lda = max (1, n);
+ F77_INT ldex = max (1, n);
+ F77_INT ldexin = max (1, n);
// arguments out
Matrix ex (ldex, n);
Matrix exint (ldexin, n);
// workspace
- octave_idx_type ldwork = max (1, 2*n*n); // optimum performance
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, n);
+ F77_INT ldwork = max (1, 2*n*n); // optimum performance
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, n);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicators
- octave_idx_type info = 0;
+ F77_INT info = 0;
// SLICOT routine MB05ND
diff --git a/src/sl_sb01bd.cc b/src/sl_sb01bd.cc
--- a/src/sl_sb01bd.cc
+++ b/src/sl_sb01bd.cc
@@ -28,24 +28,23 @@ Version: 0.6
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (sb01bd, SB01BD)
(char& DICO,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& NP,
+ F77_INT& N, F77_INT& M, F77_INT& NP,
double& ALPHA,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
double* WR, double* WI,
- octave_idx_type& NFP, octave_idx_type& NAP, octave_idx_type& NUP,
- double* F, octave_idx_type& LDF,
- double* Z, octave_idx_type& LDZ,
+ F77_INT& NFP, F77_INT& NAP, F77_INT& NUP,
+ double* F, F77_INT& LDF,
+ double* Z, F77_INT& LDZ,
double& TOL,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& IWARN, octave_idx_type& INFO);
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& IWARN, F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb01bd__", "__control_slicot_functions__.oct");
@@ -71,7 +70,7 @@ For internal use only.")
Matrix b = args(1).matrix_value ();
ColumnVector wr = args(2).column_vector_value ();
ColumnVector wi = args(3).column_vector_value ();
- octave_idx_type discrete = args(4).int_value ();
+ F77_INT discrete = args(4).int_value ();
double alpha = args(5).double_value ();
double tol = args(6).double_value ();
@@ -80,31 +79,31 @@ For internal use only.")
else
dico = 'C';
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type np = wr.rows ();
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT np = TO_F77_INT (wr.rows ());
- octave_idx_type lda = max (1, a.rows ());
- octave_idx_type ldb = max (1, b.rows ());
- octave_idx_type ldf = max (1, m);
- octave_idx_type ldz = max (1, n);
+ F77_INT lda = max (1, TO_F77_INT (a.rows ()));
+ F77_INT ldb = max (1, TO_F77_INT (b.rows ()));
+ F77_INT ldf = max (1, m);
+ F77_INT ldz = max (1, n);
// arguments out
- octave_idx_type nfp;
- octave_idx_type nap;
- octave_idx_type nup;
+ F77_INT nfp;
+ F77_INT nap;
+ F77_INT nup;
Matrix f (ldf, n);
Matrix z (ldz, n);
// workspace
- octave_idx_type ldwork = max (1, 5*m, 5*n, 2*n+4*m);
+ F77_INT ldwork = max (1, 5*m, 5*n, 2*n+4*m);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicators
- octave_idx_type iwarn;
- octave_idx_type info;
+ F77_INT iwarn;
+ F77_INT info;
// SLICOT routine SB01BD
diff --git a/src/sl_sb02od.cc b/src/sl_sb02od.cc
--- a/src/sl_sb02od.cc
+++ b/src/sl_sb02od.cc
@@ -28,7 +28,6 @@ Version: 0.5
*/
#include
-#include
#include "common.h"
#include
@@ -38,24 +37,24 @@ extern "C"
(char& DICO, char& JOBB,
char& FACT, char& UPLO,
char& JOBL, char& SORT,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* Q, octave_idx_type& LDQ,
- double* R, octave_idx_type& LDR,
- double* L, octave_idx_type& LDL,
+ F77_INT& N, F77_INT& M, F77_INT& P,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* Q, F77_INT& LDQ,
+ double* R, F77_INT& LDR,
+ double* L, F77_INT& LDL,
double& RCOND,
- double* X, octave_idx_type& LDX,
+ double* X, F77_INT& LDX,
double* ALFAR, double* ALFAI,
double* BETA,
- double* S, octave_idx_type& LDS,
- double* T, octave_idx_type& LDT,
- double* U, octave_idx_type& LDU,
+ double* S, F77_INT& LDS,
+ double* T, F77_INT& LDT,
+ double* U, F77_INT& LDU,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
bool* BWORK,
- octave_idx_type& INFO);
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb02od__", "__control_slicot_functions__.oct");
@@ -87,8 +86,8 @@ For internal use only.")
Matrix q = args(2).matrix_value ();
Matrix r = args(3).matrix_value ();
Matrix l = args(4).matrix_value ();
- octave_idx_type discrete = args(5).int_value ();
- octave_idx_type ijobl = args(6).int_value ();
+ F77_INT discrete = args(5).int_value ();
+ F77_INT ijobl = args(6).int_value ();
if (discrete == 0)
dico = 'C';
@@ -100,51 +99,51 @@ For internal use only.")
else
jobl = 'N';
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = 0; // p: number of outputs, not used because FACT = 'N'
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = 0; // p: number of outputs, not used because FACT = 'N'
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldq = max (1, n);
- octave_idx_type ldr = max (1, m);
- octave_idx_type ldl = max (1, n);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldq = max (1, n);
+ F77_INT ldr = max (1, m);
+ F77_INT ldl = max (1, n);
// arguments out
double rcond;
- octave_idx_type ldx = max (1, n);
+ F77_INT ldx = max (1, n);
Matrix x (ldx, n);
- octave_idx_type nu = 2*n;
+ F77_INT nu = 2*n;
ColumnVector alfar (nu);
ColumnVector alfai (nu);
ColumnVector beta (nu);
- octave_idx_type lds = max (1, 2*n + m);
+ F77_INT lds = max (1, 2*n + m);
Matrix s (lds, lds);
// unused output arguments
- octave_idx_type ldt = max (1, 2*n + m);
+ F77_INT ldt = max (1, 2*n + m);
OCTAVE_LOCAL_BUFFER (double, t, ldt * 2*n);
- octave_idx_type ldu = max (1, 2*n);
+ F77_INT ldu = max (1, 2*n);
OCTAVE_LOCAL_BUFFER (double, u, ldu * 2*n);
// tolerance
double tol = 0; // use default value
// workspace
- octave_idx_type liwork = max (1, m, 2*n);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ F77_INT liwork = max (1, m, 2*n);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
- octave_idx_type ldwork = max (7*(2*n + 1) + 16, 16*n, 2*n + m, 3*m);
+ F77_INT ldwork = max (7*(2*n + 1) + 16, 16*n, 2*n + m, 3*m);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
OCTAVE_LOCAL_BUFFER (bool, bwork, 2*n);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SB02OD
@@ -207,7 +206,7 @@ For internal use only.")
ComplexColumnVector pole (n, Complex ());
- for (octave_idx_type i = 0; i < n; i++)
+ for (F77_INT i = 0; i < n; i++)
pole.xelem (i) = Complex (poler(i), polei(i));
// return value
diff --git a/src/sl_sb03md.cc b/src/sl_sb03md.cc
--- a/src/sl_sb03md.cc
+++ b/src/sl_sb03md.cc
@@ -28,7 +28,6 @@ Version: 0.4
*/
#include
-#include
#include "common.h"
extern "C"
@@ -36,16 +35,16 @@ extern "C"
int F77_FUNC (sb03md, SB03MD)
(char& DICO, char& JOB,
char& FACT, char& TRANA,
- octave_idx_type& N,
- double* A, octave_idx_type& LDA,
- double* U, octave_idx_type& LDU,
- double* C, octave_idx_type& LDC,
+ F77_INT& N,
+ double* A, F77_INT& LDA,
+ double* U, F77_INT& LDU,
+ double* C, F77_INT& LDC,
double& SCALE,
double& SEP, double& FERR,
double* WR, double* WI,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb03md__", "__control_slicot_functions__.oct");
@@ -72,18 +71,18 @@ For internal use only.")
Matrix a = args(0).matrix_value ();
Matrix c = args(1).matrix_value ();
- octave_idx_type discrete = args(2).int_value ();
+ F77_INT discrete = args(2).int_value ();
if (discrete == 0)
dico = 'C';
else
dico = 'D';
- octave_idx_type n = a.rows (); // n: number of states
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
- octave_idx_type lda = max (1, n);
- octave_idx_type ldu = max (1, n);
- octave_idx_type ldc = max (1, n);
+ F77_INT lda = max (1, n);
+ F77_INT ldu = max (1, n);
+ F77_INT ldc = max (1, n);
// arguments out
double scale;
@@ -95,13 +94,13 @@ For internal use only.")
ColumnVector wi (n);
// workspace
- octave_idx_type* iwork = 0; // not referenced because job = X
+ F77_INT* iwork = 0; // not referenced because job = X
- octave_idx_type ldwork = max (n*n, 3*n);
+ F77_INT ldwork = max (n*n, 3*n);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SB03MD
diff --git a/src/sl_sb03od.cc b/src/sl_sb03od.cc
--- a/src/sl_sb03od.cc
+++ b/src/sl_sb03od.cc
@@ -28,21 +28,20 @@ Version: 0.3
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (sb03od, SB03OD)
(char& DICO, char& FACT, char& TRANS,
- octave_idx_type& N, octave_idx_type& M,
- double* A, octave_idx_type& LDA,
- double* Q, octave_idx_type& LDQ,
- double* B, octave_idx_type& LDB,
+ F77_INT& N, F77_INT& M,
+ double* A, F77_INT& LDA,
+ double* Q, F77_INT& LDQ,
+ double* B, F77_INT& LDB,
double& SCALE,
double* WR, double* WI,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb03od__", "__control_slicot_functions__.oct");
@@ -69,21 +68,21 @@ For internal use only.")
Matrix a = args(0).matrix_value ();
Matrix b = args(1).matrix_value ();
- octave_idx_type discrete = args(2).int_value ();
+ F77_INT discrete = args(2).int_value ();
if (discrete == 0)
dico = 'C';
else
dico = 'D';
- octave_idx_type n = a.rows ();
- octave_idx_type m = b.rows ();
- // octave_idx_type m = b.columns ();
+ F77_INT n = TO_F77_INT (a.rows ());
+ F77_INT m = TO_F77_INT (b.rows ());
+ // F77_INT m = TO_F77_INT (b.columns ());
- octave_idx_type lda = max (1, n);
- octave_idx_type ldq = max (1, n);
- octave_idx_type ldb = max (1, n, m);
- // octave_idx_type ldb = max (1, n);
+ F77_INT lda = max (1, n);
+ F77_INT ldq = max (1, n);
+ F77_INT ldb = max (1, n, m);
+ // F77_INT ldb = max (1, n);
b.resize (ldb, n);
// b.resize (ldb, max (m, n));
@@ -96,12 +95,12 @@ For internal use only.")
ColumnVector wi (n);
// workspace
- octave_idx_type ldwork = max (1, 4*n + min (m, n));
+ F77_INT ldwork = max (1, 4*n + min (m, n));
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SB03OD
diff --git a/src/sl_sb04md.cc b/src/sl_sb04md.cc
--- a/src/sl_sb04md.cc
+++ b/src/sl_sb04md.cc
@@ -28,20 +28,19 @@ Version: 0.3
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (sb04md, SB04MD)
- (octave_idx_type& N, octave_idx_type& M,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* Z, octave_idx_type& LDZ,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ (F77_INT& N, F77_INT& M,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* Z, F77_INT& LDZ,
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb04md__", "__control_slicot_functions__.oct");
@@ -65,25 +64,25 @@ For internal use only.")
Matrix b = args(1).matrix_value ();
Matrix c = args(2).matrix_value ();
- octave_idx_type n = a.rows ();
- octave_idx_type m = b.rows ();
+ F77_INT n = TO_F77_INT (a.rows ());
+ F77_INT m = TO_F77_INT (b.rows ());
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, m);
- octave_idx_type ldc = max (1, n);
- octave_idx_type ldz = max (1, m);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, m);
+ F77_INT ldc = max (1, n);
+ F77_INT ldz = max (1, m);
// arguments out
Matrix z (ldz, m);
// workspace
- octave_idx_type ldwork = max (1, 2*n*n + 8*n, 5*m, n + m);
+ F77_INT ldwork = max (1, 2*n*n + 8*n, 5*m, n + m);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, 4*n);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, 4*n);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SB04MD
diff --git a/src/sl_sb04qd.cc b/src/sl_sb04qd.cc
--- a/src/sl_sb04qd.cc
+++ b/src/sl_sb04qd.cc
@@ -28,20 +28,19 @@ Version: 0.3
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (sb04qd, SB04QD)
- (octave_idx_type& N, octave_idx_type& M,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* Z, octave_idx_type& LDZ,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ (F77_INT& N, F77_INT& M,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* Z, F77_INT& LDZ,
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb04qd__", "__control_slicot_functions__.oct");
@@ -65,25 +64,25 @@ For internal use only.")
Matrix b = args(1).matrix_value ();
Matrix c = args(2).matrix_value ();
- octave_idx_type n = a.rows ();
- octave_idx_type m = b.rows ();
+ F77_INT n = TO_F77_INT (a.rows ());
+ F77_INT m = TO_F77_INT (b.rows ());
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, m);
- octave_idx_type ldc = max (1, n);
- octave_idx_type ldz = max (1, m);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, m);
+ F77_INT ldc = max (1, n);
+ F77_INT ldz = max (1, m);
// arguments out
Matrix z (ldz, m);
// workspace
- octave_idx_type ldwork = max (1, 2*n*n + 9*n, 5*m, n + m);
+ F77_INT ldwork = max (1, 2*n*n + 9*n, 5*m, n + m);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, 4*n);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, 4*n);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SB04QD
diff --git a/src/sl_sb10ad.cc b/src/sl_sb10ad.cc
--- a/src/sl_sb10ad.cc
+++ b/src/sl_sb10ad.cc
@@ -29,34 +29,33 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (sb10ad, SB10AD)
- (octave_idx_type& JOB,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& NP,
- octave_idx_type& NCON, octave_idx_type& NMEAS,
+ (F77_INT& JOB,
+ F77_INT& N, F77_INT& M, F77_INT& NP,
+ F77_INT& NCON, F77_INT& NMEAS,
double& GAMMA,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- double* AK, octave_idx_type& LDAK,
- double* BK, octave_idx_type& LDBK,
- double* CK, octave_idx_type& LDCK,
- double* DK, octave_idx_type& LDDK,
- double* AC, octave_idx_type& LDAC,
- double* BC, octave_idx_type& LDBC,
- double* CC, octave_idx_type& LDCC,
- double* DC, octave_idx_type& LDDC,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ double* AK, F77_INT& LDAK,
+ double* BK, F77_INT& LDBK,
+ double* CK, F77_INT& LDCK,
+ double* DK, F77_INT& LDDK,
+ double* AC, F77_INT& LDAC,
+ double* BC, F77_INT& LDBC,
+ double* CC, F77_INT& LDCC,
+ double* DC, F77_INT& LDDC,
double* RCOND,
double& GTOL, double& ACTOL,
- octave_idx_type* IWORK, octave_idx_type& LIWORK,
- double* DWORK, octave_idx_type& LDWORK,
- bool* BWORK, octave_idx_type& LBWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK, F77_INT& LIWORK,
+ double* DWORK, F77_INT& LDWORK,
+ bool* BWORK, F77_INT& LBWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb10ad__", "__control_slicot_functions__.oct");
@@ -81,32 +80,32 @@ For internal use only.")
Matrix c = args(2).matrix_value ();
Matrix d = args(3).matrix_value ();
- octave_idx_type ncon = args(4).int_value ();
- octave_idx_type nmeas = args(5).int_value ();
+ F77_INT ncon = args(4).int_value ();
+ F77_INT nmeas = args(5).int_value ();
double gamma = args(6).double_value ();
double gtol = args(7).double_value ();
double actol = args(8).double_value ();
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type np = c.rows (); // np: number of outputs
-
- octave_idx_type lda = max (1, a.rows ());
- octave_idx_type ldb = max (1, b.rows ());
- octave_idx_type ldc = max (1, c.rows ());
- octave_idx_type ldd = max (1, d.rows ());
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT np = TO_F77_INT (c.rows ()); // np: number of outputs
- octave_idx_type ldak = max (1, n);
- octave_idx_type ldbk = max (1, n);
- octave_idx_type ldck = max (1, ncon);
- octave_idx_type lddk = max (1, ncon);
+ F77_INT lda = max (1, TO_F77_INT (a.rows ()));
+ F77_INT ldb = max (1, TO_F77_INT (b.rows ()));
+ F77_INT ldc = max (1, TO_F77_INT (c.rows ()));
+ F77_INT ldd = max (1, TO_F77_INT (d.rows ()));
- octave_idx_type ldac = max (1, 2*n);
- octave_idx_type ldbc = max (1, 2*n);
- octave_idx_type ldcc = max (1, np-nmeas);
- octave_idx_type lddc = max (1, np-nmeas);
+ F77_INT ldak = max (1, n);
+ F77_INT ldbk = max (1, n);
+ F77_INT ldck = max (1, ncon);
+ F77_INT lddk = max (1, ncon);
- octave_idx_type job = 1;
+ F77_INT ldac = max (1, 2*n);
+ F77_INT ldbc = max (1, 2*n);
+ F77_INT ldcc = max (1, np-nmeas);
+ F77_INT lddc = max (1, np-nmeas);
+
+ F77_INT job = 1;
// arguments out
Matrix ak (ldak, n);
@@ -121,16 +120,16 @@ For internal use only.")
// workspace
- octave_idx_type m2 = ncon;
- octave_idx_type m1 = m - m2;
- octave_idx_type np2 = nmeas;
- octave_idx_type np1 = np - np2;
- octave_idx_type nd1 = np1 - m2;
- octave_idx_type nd2 = m1 - np2;
+ F77_INT m2 = ncon;
+ F77_INT m1 = m - m2;
+ F77_INT np2 = nmeas;
+ F77_INT np1 = np - np2;
+ F77_INT nd1 = np1 - m2;
+ F77_INT nd2 = m1 - np2;
- octave_idx_type liwork = max (2*max (n, m-ncon, np-nmeas, ncon, nmeas), n*n);
- octave_idx_type lw1 = n*m + np*n + np*m + m2*m2 + np2*np2;
- octave_idx_type lw2 = max ((n + np1 + 1)*(n + m2) +
+ F77_INT liwork = max (2*max (n, m-ncon, np-nmeas, ncon, nmeas), n*n);
+ F77_INT lw1 = n*m + np*n + np*m + m2*m2 + np2*np2;
+ F77_INT lw2 = max ((n + np1 + 1)*(n + m2) +
max (3*(n + m2) + n + np1, 5*(n + m2)),
(n + np2)*(n + m1 + 1) +
max (3*(n + np2) + n + m1, 5*(n + np2)),
@@ -138,31 +137,31 @@ For internal use only.")
max (np1*max (n, m1), 3*m2 + np1, 5*m2),
np2 + m1*m1 +
max (max (n, np1)*m1, 3*np2 + m1, 5*np2));
- octave_idx_type lw3 = max (nd1*m1 + max (4*min (nd1, m1) + max (nd1,m1),
+ F77_INT lw3 = max (nd1*m1 + max (4*min (nd1, m1) + max (nd1,m1),
6*min (nd1, m1)), np1*nd2 +
max (4*min (np1, nd2) + max (np1, nd2),
6*min (np1, nd2)));
- octave_idx_type lw4 = 2*m*m + np*np + 2*m*n + m*np + 2*n*np;
- octave_idx_type lw5 = 2*n*n + m*n + n*np;
- octave_idx_type lw6 = max (m*m + max (2*m1, 3*n*n +
+ F77_INT lw4 = 2*m*m + np*np + 2*m*n + m*np + 2*n*np;
+ F77_INT lw5 = 2*n*n + m*n + n*np;
+ F77_INT lw6 = max (m*m + max (2*m1, 3*n*n +
max (n*m, 10*n*n + 12*n + 5)),
np*np + max (2*np1, 3*n*n +
max (n*np, 10*n*n + 12*n + 5)));
- octave_idx_type lw7 = m2*np2 + np2*np2 + m2*m2 +
+ F77_INT lw7 = m2*np2 + np2*np2 + m2*m2 +
max (nd1*nd1 + max (2*nd1, (nd1 + nd2)*np2),
nd2*nd2 + max (2*nd2, nd2*m2), 3*n,
n*(2*np2 + m2) +
max (2*n*m2, m2*np2 +
max (m2*m2 + 3*m2, np2*(2*np2 + m2 + max (np2, n)))));
- octave_idx_type ldwork = lw1 + max (1, lw2, lw3, lw4, lw5 + max (lw6,lw7));
- octave_idx_type lbwork = 2*n;
+ F77_INT ldwork = lw1 + max (1, lw2, lw3, lw4, lw5 + max (lw6,lw7));
+ F77_INT lbwork = 2*n;
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
OCTAVE_LOCAL_BUFFER (bool, bwork, lbwork);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SB10AD
diff --git a/src/sl_sb10dd.cc b/src/sl_sb10dd.cc
--- a/src/sl_sb10dd.cc
+++ b/src/sl_sb10dd.cc
@@ -28,31 +28,30 @@ Version: 0.6
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (sb10dd, SB10DD)
- (octave_idx_type& N, octave_idx_type& M, octave_idx_type& NP,
- octave_idx_type& NCON, octave_idx_type& NMEAS,
+ (F77_INT& N, F77_INT& M, F77_INT& NP,
+ F77_INT& NCON, F77_INT& NMEAS,
double& GAMMA,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- double* AK, octave_idx_type& LDAK,
- double* BK, octave_idx_type& LDBK,
- double* CK, octave_idx_type& LDCK,
- double* DK, octave_idx_type& LDDK,
- double* X, octave_idx_type& LDX,
- double* Z, octave_idx_type& LDZ,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ double* AK, F77_INT& LDAK,
+ double* BK, F77_INT& LDBK,
+ double* CK, F77_INT& LDCK,
+ double* DK, F77_INT& LDDK,
+ double* X, F77_INT& LDX,
+ double* Z, F77_INT& LDZ,
double* RCOND,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
bool* BWORK,
- octave_idx_type& INFO);
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb10dd__", "__control_slicot_functions__.oct");
@@ -77,26 +76,26 @@ For internal use only.")
Matrix c = args(2).matrix_value ();
Matrix d = args(3).matrix_value ();
- octave_idx_type ncon = args(4).int_value ();
- octave_idx_type nmeas = args(5).int_value ();
+ F77_INT ncon = args(4).int_value ();
+ F77_INT nmeas = args(5).int_value ();
double gamma = args(6).double_value ();
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type np = c.rows (); // np: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT np = TO_F77_INT (c.rows ()); // np: number of outputs
- octave_idx_type lda = max (1, a.rows ());
- octave_idx_type ldb = max (1, b.rows ());
- octave_idx_type ldc = max (1, c.rows ());
- octave_idx_type ldd = max (1, d.rows ());
+ F77_INT lda = max (1, TO_F77_INT (a.rows ()));
+ F77_INT ldb = max (1, TO_F77_INT (b.rows ()));
+ F77_INT ldc = max (1, TO_F77_INT (c.rows ()));
+ F77_INT ldd = max (1, TO_F77_INT (d.rows ()));
- octave_idx_type ldak = max (1, n);
- octave_idx_type ldbk = max (1, n);
- octave_idx_type ldck = max (1, ncon);
- octave_idx_type lddk = max (1, ncon);
+ F77_INT ldak = max (1, n);
+ F77_INT ldbk = max (1, n);
+ F77_INT ldck = max (1, ncon);
+ F77_INT lddk = max (1, ncon);
- octave_idx_type ldx = max (1, n);
- octave_idx_type ldz = max (1, n);
+ F77_INT ldx = max (1, n);
+ F77_INT ldz = max (1, n);
double tol = 0;
@@ -110,23 +109,23 @@ For internal use only.")
ColumnVector rcond (8);
// workspace
- octave_idx_type m2 = ncon;
- octave_idx_type m1 = m - m2;
- octave_idx_type np1 = np - nmeas;
- octave_idx_type np2 = nmeas;
+ F77_INT m2 = ncon;
+ F77_INT m1 = m - m2;
+ F77_INT np1 = np - nmeas;
+ F77_INT np2 = nmeas;
- octave_idx_type liwork = max (2*max (m2, n), m, m2+np2, n*n);
- octave_idx_type q = max (m1, m2, np1, np2);
- octave_idx_type ldwork = max ((n+q)*(n+q+6), 13*n*n + m*m + 2*q*q + n*(m+q) +
+ F77_INT liwork = max (2*max (m2, n), m, m2+np2, n*n);
+ F77_INT q = max (m1, m2, np1, np2);
+ F77_INT ldwork = max ((n+q)*(n+q+6), 13*n*n + m*m + 2*q*q + n*(m+q) +
max (m*(m+7*n), 2*q*(8*n+m+2*q)) + 6*n +
max (14*n+23, 16*n, 2*n + max (m, 2*q), 3*max (m, 2*q)));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
OCTAVE_LOCAL_BUFFER (bool, bwork, 2*n);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SB10DD
diff --git a/src/sl_sb10ed.cc b/src/sl_sb10ed.cc
--- a/src/sl_sb10ed.cc
+++ b/src/sl_sb10ed.cc
@@ -28,28 +28,27 @@ Version: 0.6
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (sb10ed, SB10ED)
- (octave_idx_type& N, octave_idx_type& M, octave_idx_type& NP,
- octave_idx_type& NCON, octave_idx_type& NMEAS,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- double* AK, octave_idx_type& LDAK,
- double* BK, octave_idx_type& LDBK,
- double* CK, octave_idx_type& LDCK,
- double* DK, octave_idx_type& LDDK,
+ (F77_INT& N, F77_INT& M, F77_INT& NP,
+ F77_INT& NCON, F77_INT& NMEAS,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ double* AK, F77_INT& LDAK,
+ double* BK, F77_INT& LDBK,
+ double* CK, F77_INT& LDCK,
+ double* DK, F77_INT& LDDK,
double* RCOND,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
bool* BWORK,
- octave_idx_type& INFO);
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb10ed__", "__control_slicot_functions__.oct");
@@ -74,22 +73,22 @@ For internal use only.")
Matrix c = args(2).matrix_value ();
Matrix d = args(3).matrix_value ();
- octave_idx_type ncon = args(4).int_value ();
- octave_idx_type nmeas = args(5).int_value ();
-
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type np = c.rows (); // np: number of outputs
+ F77_INT ncon = args(4).int_value ();
+ F77_INT nmeas = args(5).int_value ();
- octave_idx_type lda = max (1, a.rows ());
- octave_idx_type ldb = max (1, b.rows ());
- octave_idx_type ldc = max (1, c.rows ());
- octave_idx_type ldd = max (1, d.rows ());
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT np = TO_F77_INT (c.rows ()); // np: number of outputs
- octave_idx_type ldak = max (1, n);
- octave_idx_type ldbk = max (1, n);
- octave_idx_type ldck = max (1, ncon);
- octave_idx_type lddk = max (1, ncon);
+ F77_INT lda = max (1, TO_F77_INT (a.rows ()));
+ F77_INT ldb = max (1, TO_F77_INT (b.rows ()));
+ F77_INT ldc = max (1, TO_F77_INT (c.rows ()));
+ F77_INT ldd = max (1, TO_F77_INT (d.rows ()));
+
+ F77_INT ldak = max (1, n);
+ F77_INT ldbk = max (1, n);
+ F77_INT ldck = max (1, ncon);
+ F77_INT lddk = max (1, ncon);
double tol = 0;
@@ -101,23 +100,23 @@ For internal use only.")
ColumnVector rcond (7);
// workspace
- octave_idx_type m2 = ncon;
- octave_idx_type m1 = m - m2;
- octave_idx_type np1 = np - nmeas;
- octave_idx_type np2 = nmeas;
+ F77_INT m2 = ncon;
+ F77_INT m1 = m - m2;
+ F77_INT np1 = np - nmeas;
+ F77_INT np2 = nmeas;
- octave_idx_type q = max (m1, m2, np1, np2);
- octave_idx_type ldwork = 2*q*(3*q+2*n)+max(1,(n+q)*(n+q+6),q*(q+max(n,q,5)+1),
+ F77_INT q = max (m1, m2, np1, np2);
+ F77_INT ldwork = 2*q*(3*q+2*n)+max(1,(n+q)*(n+q+6),q*(q+max(n,q,5)+1),
2*n*n+max(1,14*n*n+6*n+max(14*n+23,16*n),
q*(n+q+max(q,3))));
- octave_idx_type liwork = max (2*m2, 2*n, n*n, np2);
+ F77_INT liwork = max (2*m2, 2*n, n*n, np2);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
OCTAVE_LOCAL_BUFFER (bool, bwork, 2*n);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SB10ED
diff --git a/src/sl_sb10fd.cc b/src/sl_sb10fd.cc
--- a/src/sl_sb10fd.cc
+++ b/src/sl_sb10fd.cc
@@ -28,29 +28,28 @@ Version: 0.6
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (sb10fd, SB10FD)
- (octave_idx_type& N, octave_idx_type& M, octave_idx_type& NP,
- octave_idx_type& NCON, octave_idx_type& NMEAS,
+ (F77_INT& N, F77_INT& M, F77_INT& NP,
+ F77_INT& NCON, F77_INT& NMEAS,
double& GAMMA,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- double* AK, octave_idx_type& LDAK,
- double* BK, octave_idx_type& LDBK,
- double* CK, octave_idx_type& LDCK,
- double* DK, octave_idx_type& LDDK,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ double* AK, F77_INT& LDAK,
+ double* BK, F77_INT& LDBK,
+ double* CK, F77_INT& LDCK,
+ double* DK, F77_INT& LDDK,
double* RCOND,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
bool* BWORK,
- octave_idx_type& INFO);
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb10fd__", "__control_slicot_functions__.oct");
@@ -75,23 +74,23 @@ For internal use only.")
Matrix c = args(2).matrix_value ();
Matrix d = args(3).matrix_value ();
- octave_idx_type ncon = args(4).int_value ();
- octave_idx_type nmeas = args(5).int_value ();
+ F77_INT ncon = args(4).int_value ();
+ F77_INT nmeas = args(5).int_value ();
double gamma = args(6).double_value ();
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type np = c.rows (); // np: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT np = TO_F77_INT (c.rows ()); // np: number of outputs
- octave_idx_type lda = max (1, a.rows ());
- octave_idx_type ldb = max (1, b.rows ());
- octave_idx_type ldc = max (1, c.rows ());
- octave_idx_type ldd = max (1, d.rows ());
+ F77_INT lda = max (1, TO_F77_INT (a.rows ()));
+ F77_INT ldb = max (1, TO_F77_INT (b.rows ()));
+ F77_INT ldc = max (1, TO_F77_INT (c.rows ()));
+ F77_INT ldd = max (1, TO_F77_INT (d.rows ()));
- octave_idx_type ldak = max (1, n);
- octave_idx_type ldbk = max (1, n);
- octave_idx_type ldck = max (1, ncon);
- octave_idx_type lddk = max (1, ncon);
+ F77_INT ldak = max (1, n);
+ F77_INT ldbk = max (1, n);
+ F77_INT ldck = max (1, ncon);
+ F77_INT lddk = max (1, ncon);
double tol = 0;
@@ -104,24 +103,24 @@ For internal use only.")
// workspace
- octave_idx_type m2 = ncon;
- octave_idx_type m1 = m - m2;
- octave_idx_type np1 = np - nmeas;
- octave_idx_type np2 = nmeas;
+ F77_INT m2 = ncon;
+ F77_INT m1 = m - m2;
+ F77_INT np1 = np - nmeas;
+ F77_INT np2 = nmeas;
- octave_idx_type liwork = max (2*max (n, m-ncon, np-nmeas, ncon), n*n);
- octave_idx_type q = max (m1, m2, np1, np2);
- octave_idx_type ldwork = 2*q*(3*q+2*n) + max (1, (n+q)*(n+q+6), q*(q + max (n, q, 5) + 1),
+ F77_INT liwork = max (2*max (n, m-ncon, np-nmeas, ncon), n*n);
+ F77_INT q = max (m1, m2, np1, np2);
+ F77_INT ldwork = 2*q*(3*q+2*n) + max (1, (n+q)*(n+q+6), q*(q + max (n, q, 5) + 1),
2*n*(n+2*q) + max (1, 4*q*q +
max (2*q, 3*n*n + max (2*n*q, 10*n*n+12*n+5)),
q*(3*n + 3*q + max (2*n, 4*q + max (n, q)))));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
OCTAVE_LOCAL_BUFFER (bool, bwork, 2*n);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SB10FD
diff --git a/src/sl_sb10hd.cc b/src/sl_sb10hd.cc
--- a/src/sl_sb10hd.cc
+++ b/src/sl_sb10hd.cc
@@ -28,28 +28,27 @@ Version: 0.6
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (sb10hd, SB10HD)
- (octave_idx_type& N, octave_idx_type& M, octave_idx_type& NP,
- octave_idx_type& NCON, octave_idx_type& NMEAS,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- double* AK, octave_idx_type& LDAK,
- double* BK, octave_idx_type& LDBK,
- double* CK, octave_idx_type& LDCK,
- double* DK, octave_idx_type& LDDK,
+ (F77_INT& N, F77_INT& M, F77_INT& NP,
+ F77_INT& NCON, F77_INT& NMEAS,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ double* AK, F77_INT& LDAK,
+ double* BK, F77_INT& LDBK,
+ double* CK, F77_INT& LDCK,
+ double* DK, F77_INT& LDDK,
double* RCOND,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
bool* BWORK,
- octave_idx_type& INFO);
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb10hd__", "__control_slicot_functions__.oct");
@@ -74,22 +73,22 @@ For internal use only.")
Matrix c = args(2).matrix_value ();
Matrix d = args(3).matrix_value ();
- octave_idx_type ncon = args(4).int_value ();
- octave_idx_type nmeas = args(5).int_value ();
-
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type np = c.rows (); // np: number of outputs
+ F77_INT ncon = args(4).int_value ();
+ F77_INT nmeas = args(5).int_value ();
- octave_idx_type lda = max (1, a.rows ());
- octave_idx_type ldb = max (1, b.rows ());
- octave_idx_type ldc = max (1, c.rows ());
- octave_idx_type ldd = max (1, d.rows ());
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT np = TO_F77_INT (c.rows ()); // np: number of outputs
- octave_idx_type ldak = max (1, n);
- octave_idx_type ldbk = max (1, n);
- octave_idx_type ldck = max (1, ncon);
- octave_idx_type lddk = max (1, ncon);
+ F77_INT lda = max (1, TO_F77_INT (a.rows ()));
+ F77_INT ldb = max (1, TO_F77_INT (b.rows ()));
+ F77_INT ldc = max (1, TO_F77_INT (c.rows ()));
+ F77_INT ldd = max (1, TO_F77_INT (d.rows ()));
+
+ F77_INT ldak = max (1, n);
+ F77_INT ldbk = max (1, n);
+ F77_INT ldck = max (1, ncon);
+ F77_INT lddk = max (1, ncon);
double tol = 0;
@@ -101,20 +100,20 @@ For internal use only.")
ColumnVector rcond (4);
// workspace
- octave_idx_type m2 = ncon;
- octave_idx_type m1 = m - m2;
- octave_idx_type np1 = np - nmeas;
- octave_idx_type np2 = nmeas;
+ F77_INT m2 = ncon;
+ F77_INT m1 = m - m2;
+ F77_INT np1 = np - nmeas;
+ F77_INT np2 = nmeas;
- octave_idx_type q = max (m1, m2, np1, np2);
- octave_idx_type ldwork = 2*q*(3*q + 2*n) + max (1, q*(q + max (n, 5) + 1), n*(14*n + 12 + 2*q) + 5);
+ F77_INT q = max (m1, m2, np1, np2);
+ F77_INT ldwork = 2*q*(3*q + 2*n) + max (1, q*(q + max (n, 5) + 1), n*(14*n + 12 + 2*q) + 5);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, max (2*n, n*n));
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, max (2*n, n*n));
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
OCTAVE_LOCAL_BUFFER (bool, bwork, 2*n);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SB10HD
diff --git a/src/sl_sb10id.cc b/src/sl_sb10id.cc
--- a/src/sl_sb10id.cc
+++ b/src/sl_sb10id.cc
@@ -28,27 +28,26 @@ Version: 0.4
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (sb10id, SB10ID)
- (octave_idx_type& N, octave_idx_type& M, octave_idx_type& NP,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- double& FACTOR, octave_idx_type& NK,
- double* AK, octave_idx_type& LDAK,
- double* BK, octave_idx_type& LDBK,
- double* CK, octave_idx_type& LDCK,
- double* DK, octave_idx_type& LDDK,
+ (F77_INT& N, F77_INT& M, F77_INT& NP,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ double& FACTOR, F77_INT& NK,
+ double* AK, F77_INT& LDAK,
+ double* BK, F77_INT& LDBK,
+ double* CK, F77_INT& LDCK,
+ double* DK, F77_INT& LDDK,
double* RCOND,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
bool* BWORK,
- octave_idx_type& INFO);
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb10id__", "__control_slicot_functions__.oct");
@@ -75,22 +74,22 @@ For internal use only.")
double factor = args(4).double_value ();
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type np = c.rows (); // np: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT np = TO_F77_INT (c.rows ()); // np: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, np);
- octave_idx_type ldd = max (1, np);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, np);
+ F77_INT ldd = max (1, np);
- octave_idx_type ldak = max (1, n);
- octave_idx_type ldbk = max (1, n);
- octave_idx_type ldck = max (1, m);
- octave_idx_type lddk = max (1, m);
+ F77_INT ldak = max (1, n);
+ F77_INT ldbk = max (1, n);
+ F77_INT ldck = max (1, m);
+ F77_INT lddk = max (1, m);
// arguments out
- octave_idx_type nk;
+ F77_INT nk;
Matrix ak (ldak, n);
Matrix bk (ldbk, np);
Matrix ck (ldck, n);
@@ -98,16 +97,16 @@ For internal use only.")
ColumnVector rcond (2);
// workspace
- octave_idx_type liwork = max (2*n, n*n, m, np);
- octave_idx_type ldwork = 10*n*n + m*m + np*np + 2*m*n + 2*n*np + 4*n +
+ F77_INT liwork = max (2*n, n*n, m, np);
+ F77_INT ldwork = 10*n*n + m*m + np*np + 2*m*n + 2*n*np + 4*n +
5 + max (1, 4*n*n + 8*n);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
OCTAVE_LOCAL_BUFFER (bool, bwork, 2*n);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SB10ID
diff --git a/src/sl_sb10jd.cc b/src/sl_sb10jd.cc
--- a/src/sl_sb10jd.cc
+++ b/src/sl_sb10jd.cc
@@ -28,21 +28,20 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (sb10jd, SB10JD)
- (octave_idx_type& N, octave_idx_type& M, octave_idx_type& NP,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- double* E, octave_idx_type& LDE,
- octave_idx_type& NSYS,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ (F77_INT& N, F77_INT& M, F77_INT& NP,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ double* E, F77_INT& LDE,
+ F77_INT& NSYS,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb10jd__", "__control_slicot_functions__.oct");
@@ -68,25 +67,25 @@ For internal use only.")
Matrix d = args(3).matrix_value ();
Matrix e = args(4).matrix_value ();
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type np = c.rows (); // np: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT np = TO_F77_INT (c.rows ()); // np: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, np);
- octave_idx_type ldd = max (1, np);
- octave_idx_type lde = max (1, n);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, np);
+ F77_INT ldd = max (1, np);
+ F77_INT lde = max (1, n);
// arguments out
- octave_idx_type nsys;
+ F77_INT nsys;
// workspace
- octave_idx_type ldwork = max (1, 2*n*n + 2*n + n*max (5, n + m + np));
+ F77_INT ldwork = max (1, 2*n*n + 2*n + n*max (5, n + m + np));
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SB10JD
diff --git a/src/sl_sb10kd.cc b/src/sl_sb10kd.cc
--- a/src/sl_sb10kd.cc
+++ b/src/sl_sb10kd.cc
@@ -28,26 +28,25 @@ Version: 0.4
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (sb10kd, SB10KD)
- (octave_idx_type& N, octave_idx_type& M, octave_idx_type& NP,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
+ (F77_INT& N, F77_INT& M, F77_INT& NP,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
double& FACTOR,
- double* AK, octave_idx_type& LDAK,
- double* BK, octave_idx_type& LDBK,
- double* CK, octave_idx_type& LDCK,
- double* DK, octave_idx_type& LDDK,
+ double* AK, F77_INT& LDAK,
+ double* BK, F77_INT& LDBK,
+ double* CK, F77_INT& LDCK,
+ double* DK, F77_INT& LDDK,
double* RCOND,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
bool* BWORK,
- octave_idx_type& INFO);
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb10kd__", "__control_slicot_functions__.oct");
@@ -73,18 +72,18 @@ For internal use only.")
double factor = args(3).double_value ();
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type np = c.rows (); // np: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT np = TO_F77_INT (c.rows ()); // np: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, np);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, np);
- octave_idx_type ldak = max (1, n);
- octave_idx_type ldbk = max (1, n);
- octave_idx_type ldck = max (1, m);
- octave_idx_type lddk = max (1, m);
+ F77_INT ldak = max (1, n);
+ F77_INT ldbk = max (1, n);
+ F77_INT ldck = max (1, m);
+ F77_INT lddk = max (1, m);
// arguments out
Matrix ak (ldak, n);
@@ -94,17 +93,17 @@ For internal use only.")
ColumnVector rcond (4);
// workspace
- octave_idx_type liwork = 2 * max (n, np+m);
- octave_idx_type ldwork = 15*n*n + 6*n +
+ F77_INT liwork = 2 * max (n, np+m);
+ F77_INT ldwork = 15*n*n + 6*n +
max (14*n+23, 16*n, 2*n+np+m, 3*(np+m)) +
max (n*n, 11*n*np + 2*m*m + 8*np*np + 8*m*n + 4*m*np + np);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
OCTAVE_LOCAL_BUFFER (bool, bwork, 2*n);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SB10KD
diff --git a/src/sl_sb10yd.cc b/src/sl_sb10yd.cc
--- a/src/sl_sb10yd.cc
+++ b/src/sl_sb10yd.cc
@@ -28,26 +28,25 @@ Version: 0.2
*/
#include
-#include
#include
#include "common.h"
extern "C"
{
int F77_FUNC (sb10yd, SB10YD)
- (octave_idx_type& DISCFL, octave_idx_type& FLAG,
- octave_idx_type& LENDAT,
+ (F77_INT& DISCFL, F77_INT& FLAG,
+ F77_INT& LENDAT,
double* RFRDAT, double* IFRDAT,
double* OMEGA,
- octave_idx_type& N,
- double* A, octave_idx_type& LDA,
+ F77_INT& N,
+ double* A, F77_INT& LDA,
double* B,
double* C,
double* D,
double& TOL,
- octave_idx_type* IWORK, double* DWORK, octave_idx_type& LDWORK,
- Complex* ZWORK, octave_idx_type& LZWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK, double* DWORK, F77_INT& LDWORK,
+ Complex* ZWORK, F77_INT& LZWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb10yd__", "__control_slicot_functions__.oct");
@@ -70,13 +69,13 @@ For internal use only.")
Matrix rfrdat = args(0).matrix_value ();
Matrix ifrdat = args(1).matrix_value ();
Matrix omega = args(2).matrix_value ();
- octave_idx_type n = args(3).int_value ();
- octave_idx_type discfl = args(4).int_value ();
- octave_idx_type flag = args(5).int_value ();
+ F77_INT n = args(3).int_value ();
+ F77_INT discfl = args(4).int_value ();
+ F77_INT flag = args(5).int_value ();
- octave_idx_type lendat = omega.rows (); // number of frequencies
+ F77_INT lendat = TO_F77_INT (omega.rows ()); // number of frequencies
- octave_idx_type lda = max (1, n);
+ F77_INT lda = max (1, n);
// arguments out
Matrix a (lda, n);
@@ -85,16 +84,16 @@ For internal use only.")
Matrix d (1, 1);
// workspace
- octave_idx_type liwork = max (2, 2*n + 1);
- octave_idx_type ldwork;
- octave_idx_type lzwork;
- octave_idx_type hnpts = 2048;
+ F77_INT liwork = max (2, 2*n + 1);
+ F77_INT ldwork;
+ F77_INT lzwork;
+ F77_INT hnpts = 2048;
- octave_idx_type lw1 = 2*lendat + 4*hnpts;
- octave_idx_type lw2 = lendat + 6*hnpts;
- octave_idx_type mn = min (2*lendat, 2*n+1);
- octave_idx_type lw3;
- octave_idx_type lw4;
+ F77_INT lw1 = 2*lendat + 4*hnpts;
+ F77_INT lw2 = lendat + 6*hnpts;
+ F77_INT mn = min (2*lendat, 2*n+1);
+ F77_INT lw3;
+ F77_INT lw4;
if (n > 0)
{
@@ -115,7 +114,7 @@ For internal use only.")
ldwork = max (2, lw1, lw2, lw3, lw4);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
OCTAVE_LOCAL_BUFFER (Complex, zwork, lzwork);
@@ -123,7 +122,7 @@ For internal use only.")
double tol = 0;
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SB10YD
diff --git a/src/sl_sb10zd.cc b/src/sl_sb10zd.cc
--- a/src/sl_sb10zd.cc
+++ b/src/sl_sb10zd.cc
@@ -28,28 +28,27 @@ Version: 0.4
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (sb10zd, SB10ZD)
- (octave_idx_type& N, octave_idx_type& M, octave_idx_type& NP,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
+ (F77_INT& N, F77_INT& M, F77_INT& NP,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
double& FACTOR,
- double* AK, octave_idx_type& LDAK,
- double* BK, octave_idx_type& LDBK,
- double* CK, octave_idx_type& LDCK,
- double* DK, octave_idx_type& LDDK,
+ double* AK, F77_INT& LDAK,
+ double* BK, F77_INT& LDBK,
+ double* CK, F77_INT& LDCK,
+ double* DK, F77_INT& LDDK,
double* RCOND,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
bool* BWORK,
- octave_idx_type& INFO);
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb10zd__", "__control_slicot_functions__.oct");
@@ -77,19 +76,19 @@ For internal use only.")
double factor = args(4).double_value ();
double tol = args(5).double_value ();
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type np = c.rows (); // np: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT np = TO_F77_INT (c.rows ()); // np: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, np);
- octave_idx_type ldd = max (1, np);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, np);
+ F77_INT ldd = max (1, np);
- octave_idx_type ldak = max (1, n);
- octave_idx_type ldbk = max (1, n);
- octave_idx_type ldck = max (1, m);
- octave_idx_type lddk = max (1, m);
+ F77_INT ldak = max (1, n);
+ F77_INT ldbk = max (1, n);
+ F77_INT ldck = max (1, m);
+ F77_INT lddk = max (1, m);
// arguments out
Matrix ak (ldak, n);
@@ -99,17 +98,17 @@ For internal use only.")
ColumnVector rcond (6);
// workspace
- octave_idx_type liwork = 2 * max (n, m+np);
- octave_idx_type ldwork = 16*n*n + 5*m*m + 7*np*np + 6*m*n + 7*m*np +
+ F77_INT liwork = 2 * max (n, m+np);
+ F77_INT ldwork = 16*n*n + 5*m*m + 7*np*np + 6*m*n + 7*m*np +
7*n*np + 6*n + 2*(m + np) +
max (14*n+23, 16*n, 2*m-1, 2*np-1);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
OCTAVE_LOCAL_BUFFER (bool, bwork, 2*n);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SB10ZD
diff --git a/src/sl_sb16ad.cc b/src/sl_sb16ad.cc
--- a/src/sl_sb16ad.cc
+++ b/src/sl_sb16ad.cc
@@ -29,7 +29,6 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
@@ -37,23 +36,23 @@ extern "C"
int F77_FUNC (sb16ad, SB16AD)
(char& DICO, char& JOBC, char& JOBO, char& JOBMR,
char& WEIGHT, char& EQUIL, char& ORDSEL,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
- octave_idx_type& NC, octave_idx_type& NCR,
+ F77_INT& N, F77_INT& M, F77_INT& P,
+ F77_INT& NC, F77_INT& NCR,
double& ALPHA,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- double* AC, octave_idx_type& LDAC,
- double* BC, octave_idx_type& LDBC,
- double* CC, octave_idx_type& LDCC,
- double* DC, octave_idx_type& LDDC,
- octave_idx_type& NCS,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ double* AC, F77_INT& LDAC,
+ double* BC, F77_INT& LDBC,
+ double* CC, F77_INT& LDCC,
+ double* DC, F77_INT& LDDC,
+ F77_INT& NCS,
double* HSVC,
double& TOL1, double& TOL2,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& IWARN, octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& IWARN, F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb16ad__", "__control_slicot_functions__.oct");
@@ -86,21 +85,21 @@ For internal use only.")
Matrix c = args(2).matrix_value ();
Matrix d = args(3).matrix_value ();
- const octave_idx_type idico = args(4).int_value ();
- const octave_idx_type iequil = args(5).int_value ();
- octave_idx_type ncr = args(6).int_value ();
- const octave_idx_type iordsel = args(7).int_value ();
+ const F77_INT idico = args(4).int_value ();
+ const F77_INT iequil = args(5).int_value ();
+ F77_INT ncr = args(6).int_value ();
+ const F77_INT iordsel = args(7).int_value ();
double alpha = args(8).double_value ();
- const octave_idx_type ijobmr = args(9).int_value ();
+ const F77_INT ijobmr = args(9).int_value ();
Matrix ac = args(10).matrix_value ();
Matrix bc = args(11).matrix_value ();
Matrix cc = args(12).matrix_value ();
Matrix dc = args(13).matrix_value ();
- const octave_idx_type iweight = args(14).int_value ();
- const octave_idx_type ijobc = args(15).int_value ();
- const octave_idx_type ijobo = args(16).int_value ();
+ const F77_INT iweight = args(14).int_value ();
+ const F77_INT ijobc = args(15).int_value ();
+ const F77_INT ijobo = args(16).int_value ();
double tol1 = args(17).double_value ();
double tol2 = args(18).double_value ();
@@ -166,30 +165,30 @@ For internal use only.")
error ("__sl_sb16ad__: argument weight invalid");
}
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type nc = ac.rows ();
+ F77_INT nc = TO_F77_INT (ac.rows ());
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, p);
- octave_idx_type ldd = max (1, p);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, p);
+ F77_INT ldd = max (1, p);
- octave_idx_type ldac = max (1, nc);
- octave_idx_type ldbc = max (1, nc);
- octave_idx_type ldcc = max (1, m);
- octave_idx_type lddc = max (1, m);
+ F77_INT ldac = max (1, nc);
+ F77_INT ldbc = max (1, nc);
+ F77_INT ldcc = max (1, m);
+ F77_INT lddc = max (1, m);
// arguments out
- octave_idx_type ncs;
+ F77_INT ncs;
ColumnVector hsvc (n);
// workspace
- octave_idx_type liwork;
- octave_idx_type liwrk1;
- octave_idx_type liwrk2;
+ F77_INT liwork;
+ F77_INT liwrk1;
+ F77_INT liwrk2;
switch (jobmr)
{
@@ -210,9 +209,9 @@ For internal use only.")
liwork = max (1, liwrk1, liwrk2);
- octave_idx_type ldwork;
- octave_idx_type lfreq;
- octave_idx_type lsqred;
+ F77_INT ldwork;
+ F77_INT lfreq;
+ F77_INT lsqred;
if (weight == 'N')
{
@@ -231,12 +230,12 @@ For internal use only.")
lsqred = max (1, 2*nc*nc+5*nc);
ldwork = 2*nc*nc + max (1, lfreq, lsqred);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicators
- octave_idx_type iwarn = 0;
- octave_idx_type info = 0;
+ F77_INT iwarn = 0;
+ F77_INT info = 0;
// SLICOT routine SB16AD
diff --git a/src/sl_sb16bd.cc b/src/sl_sb16bd.cc
--- a/src/sl_sb16bd.cc
+++ b/src/sl_sb16bd.cc
@@ -28,7 +28,6 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
@@ -36,20 +35,20 @@ extern "C"
int F77_FUNC (sb16bd, SB16BD)
(char& DICO, char& JOBD, char& JOBMR, char& JOBCF,
char& EQUIL, char& ORDSEL,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
- octave_idx_type& NCR,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- double* F, octave_idx_type& LDF,
- double* G, octave_idx_type& LDG,
- double* DC, octave_idx_type& LDDC,
+ F77_INT& N, F77_INT& M, F77_INT& P,
+ F77_INT& NCR,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ double* F, F77_INT& LDF,
+ double* G, F77_INT& LDG,
+ double* DC, F77_INT& LDDC,
double* HSV,
double& TOL1, double& TOL2,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& IWARN, octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& IWARN, F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb16bd__", "__control_slicot_functions__.oct");
@@ -81,17 +80,17 @@ For internal use only.")
Matrix c = args(2).matrix_value ();
Matrix d = args(3).matrix_value ();
- const octave_idx_type idico = args(4).int_value ();
- const octave_idx_type iequil = args(5).int_value ();
- octave_idx_type ncr = args(6).int_value ();
- const octave_idx_type iordsel = args(7).int_value ();
- const octave_idx_type ijobd = args(8).int_value ();
- const octave_idx_type ijobmr = args(9).int_value ();
+ const F77_INT idico = args(4).int_value ();
+ const F77_INT iequil = args(5).int_value ();
+ F77_INT ncr = args(6).int_value ();
+ const F77_INT iordsel = args(7).int_value ();
+ const F77_INT ijobd = args(8).int_value ();
+ const F77_INT ijobmr = args(9).int_value ();
Matrix f = args(10).matrix_value ();
Matrix g = args(11).matrix_value ();
- const octave_idx_type ijobcf = args(12).int_value ();
+ const F77_INT ijobcf = args(12).int_value ();
double tol1 = args(13).double_value ();
double tol2 = args(14).double_value ();
@@ -140,34 +139,34 @@ For internal use only.")
}
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, p);
- octave_idx_type ldd;
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, p);
+ F77_INT ldd;
if (jobd == 'Z')
ldd = 1;
else
ldd = max (1, p);
- octave_idx_type ldf = max (1, m);
- octave_idx_type ldg = max (1, n);
- octave_idx_type lddc = max (1, m);
+ F77_INT ldf = max (1, m);
+ F77_INT ldg = max (1, n);
+ F77_INT lddc = max (1, m);
// arguments out
Matrix dc (lddc, p);
ColumnVector hsv (n);
// workspace
- octave_idx_type liwork;
- octave_idx_type pm;
+ F77_INT liwork;
+ F77_INT pm;
- octave_idx_type ldwork;
- octave_idx_type lwr = max (1, n*(2*n+max(n,m+p)+5)+n*(n+1)/2);
+ F77_INT ldwork;
+ F77_INT lwr = max (1, n*(2*n+max(n,m+p)+5)+n*(n+1)/2);
switch (jobmr)
{
@@ -198,12 +197,12 @@ For internal use only.")
}
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicators
- octave_idx_type iwarn = 0;
- octave_idx_type info = 0;
+ F77_INT iwarn = 0;
+ F77_INT info = 0;
// SLICOT routine SB16BD
diff --git a/src/sl_sb16cd.cc b/src/sl_sb16cd.cc
--- a/src/sl_sb16cd.cc
+++ b/src/sl_sb16cd.cc
@@ -28,7 +28,6 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
@@ -36,19 +35,19 @@ extern "C"
int F77_FUNC (sb16cd, SB16CD)
(char& DICO, char& JOBD, char& JOBMR, char& JOBCF,
char& ORDSEL,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
- octave_idx_type& NCR,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- double* F, octave_idx_type& LDF,
- double* G, octave_idx_type& LDG,
+ F77_INT& N, F77_INT& M, F77_INT& P,
+ F77_INT& NCR,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ double* F, F77_INT& LDF,
+ double* G, F77_INT& LDG,
double* HSV,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& IWARN, octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& IWARN, F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sb16cd__", "__control_slicot_functions__.oct");
@@ -79,16 +78,16 @@ For internal use only.")
Matrix c = args(2).matrix_value ();
Matrix d = args(3).matrix_value ();
- const octave_idx_type idico = args(4).int_value ();
- octave_idx_type ncr = args(5).int_value ();
- const octave_idx_type iordsel = args(6).int_value ();
- const octave_idx_type ijobd = args(7).int_value ();
- const octave_idx_type ijobmr = args(8).int_value ();
+ const F77_INT idico = args(4).int_value ();
+ F77_INT ncr = args(5).int_value ();
+ const F77_INT iordsel = args(6).int_value ();
+ const F77_INT ijobd = args(7).int_value ();
+ const F77_INT ijobmr = args(8).int_value ();
Matrix f = args(9).matrix_value ();
Matrix g = args(10).matrix_value ();
- const octave_idx_type ijobcf = args(11).int_value ();
+ const F77_INT ijobcf = args(11).int_value ();
double tol = args(12).double_value ();
if (idico == 0)
@@ -124,36 +123,36 @@ For internal use only.")
}
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, p);
- octave_idx_type ldd;
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, p);
+ F77_INT ldd;
if (jobd == 'Z')
ldd = 1;
else
ldd = max (1, p);
- octave_idx_type ldf = max (1, m);
- octave_idx_type ldg = max (1, n);
+ F77_INT ldf = max (1, m);
+ F77_INT ldg = max (1, n);
// arguments out
ColumnVector hsv (n);
// workspace
- octave_idx_type liwork;
+ F77_INT liwork;
if (jobmr == 'B')
liwork = 0;
else // if JOBMR = 'F'
liwork = n;
- octave_idx_type ldwork;
- octave_idx_type mp;
+ F77_INT ldwork;
+ F77_INT mp;
if (jobcf == 'L')
mp = m;
@@ -164,12 +163,12 @@ For internal use only.")
n*(n + max(n,mp) + min(n,mp) + 6));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicators
- octave_idx_type iwarn = 0;
- octave_idx_type info = 0;
+ F77_INT iwarn = 0;
+ F77_INT info = 0;
// SLICOT routine SB16CD
diff --git a/src/sl_sg02ad.cc b/src/sl_sg02ad.cc
--- a/src/sl_sg02ad.cc
+++ b/src/sl_sg02ad.cc
@@ -28,7 +28,6 @@ Version: 0.4
*/
#include
-#include
#include "common.h"
#include
@@ -39,25 +38,25 @@ extern "C"
char& FACT, char& UPLO,
char& JOBL, char& SCAL,
char& SORT, char& ACC,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
- double* A, octave_idx_type& LDA,
- double* E, octave_idx_type& LDE,
- double* B, octave_idx_type& LDB,
- double* Q, octave_idx_type& LDQ,
- double* R, octave_idx_type& LDR,
- double* L, octave_idx_type& LDL,
+ F77_INT& N, F77_INT& M, F77_INT& P,
+ double* A, F77_INT& LDA,
+ double* E, F77_INT& LDE,
+ double* B, F77_INT& LDB,
+ double* Q, F77_INT& LDQ,
+ double* R, F77_INT& LDR,
+ double* L, F77_INT& LDL,
double& RCONDU,
- double* X, octave_idx_type& LDX,
+ double* X, F77_INT& LDX,
double* ALFAR, double* ALFAI,
double* BETA,
- double* S, octave_idx_type& LDS,
- double* T, octave_idx_type& LDT,
- double* U, octave_idx_type& LDU,
+ double* S, F77_INT& LDS,
+ double* T, F77_INT& LDT,
+ double* U, F77_INT& LDU,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
bool* BWORK,
- octave_idx_type& IWARN, octave_idx_type& INFO);
+ F77_INT& IWARN, F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sg02ad__", "__control_slicot_functions__.oct");
@@ -92,8 +91,8 @@ For internal use only.")
Matrix q = args(3).matrix_value ();
Matrix r = args(4).matrix_value ();
Matrix l = args(5).matrix_value ();
- octave_idx_type discrete = args(6).int_value ();
- octave_idx_type ijobl = args(7).int_value ();
+ F77_INT discrete = args(6).int_value ();
+ F77_INT ijobl = args(7).int_value ();
if (discrete == 0)
dico = 'C';
@@ -105,53 +104,53 @@ For internal use only.")
else
jobl = 'N';
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = 0; // p: number of outputs, not used because FACT = 'N'
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = 0; // p: number of outputs, not used because FACT = 'N'
- octave_idx_type lda = max (1, n);
- octave_idx_type lde = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldq = max (1, n);
- octave_idx_type ldr = max (1, m);
- octave_idx_type ldl = max (1, n);
+ F77_INT lda = max (1, n);
+ F77_INT lde = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldq = max (1, n);
+ F77_INT ldr = max (1, m);
+ F77_INT ldl = max (1, n);
// arguments out
double rcondu;
- octave_idx_type ldx = max (1, n);
+ F77_INT ldx = max (1, n);
Matrix x (ldx, n);
- octave_idx_type nu = 2*n;
+ F77_INT nu = 2*n;
ColumnVector alfar (nu);
ColumnVector alfai (nu);
ColumnVector beta (nu);
// unused output arguments
- octave_idx_type lds = max (1, 2*n + m);
+ F77_INT lds = max (1, 2*n + m);
OCTAVE_LOCAL_BUFFER (double, s, lds * lds);
- octave_idx_type ldt = max (1, 2*n + m);
+ F77_INT ldt = max (1, 2*n + m);
OCTAVE_LOCAL_BUFFER (double, t, ldt * 2*n);
- octave_idx_type ldu = max (1, 2*n);
+ F77_INT ldu = max (1, 2*n);
OCTAVE_LOCAL_BUFFER (double, u, ldu * 2*n);
// tolerance
double tol = 0; // use default value
// workspace
- octave_idx_type liwork = max (1, m, 2*n);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ F77_INT liwork = max (1, m, 2*n);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
- octave_idx_type ldwork = max (7*(2*n + 1) + 16, 16*n, 2*n + m, 3*m);
+ F77_INT ldwork = max (7*(2*n + 1) + 16, 16*n, 2*n + m, 3*m);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
OCTAVE_LOCAL_BUFFER (bool, bwork, 2*n);
// error indicator
- octave_idx_type iwarn;
- octave_idx_type info;
+ F77_INT iwarn;
+ F77_INT info;
// SLICOT routine SG02AD
@@ -224,7 +223,7 @@ For internal use only.")
ComplexColumnVector pole (n, Complex ());
- for (octave_idx_type i = 0; i < n; i++)
+ for (F77_INT i = 0; i < n; i++)
pole.xelem (i) = Complex (poler(i), polei(i));
// return value
diff --git a/src/sl_sg03ad.cc b/src/sl_sg03ad.cc
--- a/src/sl_sg03ad.cc
+++ b/src/sl_sg03ad.cc
@@ -28,7 +28,6 @@ Version: 0.3
*/
#include
-#include
#include "common.h"
extern "C"
@@ -37,19 +36,19 @@ extern "C"
(char& DICO, char& JOB,
char& FACT, char& TRANS,
char& UPLO,
- octave_idx_type& N,
- double* A, octave_idx_type& LDA,
- double* E, octave_idx_type& LDE,
- double* Q, octave_idx_type& LDQ,
- double* Z, octave_idx_type& LDZ,
- double* X, octave_idx_type& LDX,
+ F77_INT& N,
+ double* A, F77_INT& LDA,
+ double* E, F77_INT& LDE,
+ double* Q, F77_INT& LDQ,
+ double* Z, F77_INT& LDZ,
+ double* X, F77_INT& LDX,
double& SCALE,
double& SEP, double& FERR,
double* ALPHAR, double* ALPHAI,
double* BETA,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sg03ad__", "__control_slicot_functions__.oct");
@@ -78,20 +77,20 @@ For internal use only.")
Matrix a = args(0).matrix_value ();
Matrix e = args(1).matrix_value ();
Matrix x = args(2).matrix_value ();
- octave_idx_type discrete = args(3).int_value ();
+ F77_INT discrete = args(3).int_value ();
if (discrete == 0)
dico = 'C';
else
dico = 'D';
- octave_idx_type n = a.rows (); // n: number of states
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
- octave_idx_type lda = max (1, n);
- octave_idx_type lde = max (1, n);
- octave_idx_type ldq = max (1, n);
- octave_idx_type ldz = max (1, n);
- octave_idx_type ldx = max (1, n);
+ F77_INT lda = max (1, n);
+ F77_INT lde = max (1, n);
+ F77_INT ldq = max (1, n);
+ F77_INT ldz = max (1, n);
+ F77_INT ldx = max (1, n);
// arguments out
double scale;
@@ -105,13 +104,13 @@ For internal use only.")
ColumnVector beta (n);
// workspace
- octave_idx_type* iwork = 0; // not referenced because job = X
+ F77_INT* iwork = 0; // not referenced because job = X
- octave_idx_type ldwork = max (1, 4*n);
+ F77_INT ldwork = max (1, 4*n);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SG03AD
diff --git a/src/sl_sg03bd.cc b/src/sl_sg03bd.cc
--- a/src/sl_sg03bd.cc
+++ b/src/sl_sg03bd.cc
@@ -28,24 +28,23 @@ Version: 0.3
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (sg03bd, SG03BD)
(char& DICO, char& FACT, char& TRANS,
- octave_idx_type& N, octave_idx_type& M,
- double* A, octave_idx_type& LDA,
- double* E, octave_idx_type& LDE,
- double* Q, octave_idx_type& LDQ,
- double* Z, octave_idx_type& LDZ,
- double* B, octave_idx_type& LDB,
+ F77_INT& N, F77_INT& M,
+ double* A, F77_INT& LDA,
+ double* E, F77_INT& LDE,
+ double* Q, F77_INT& LDQ,
+ double* Z, F77_INT& LDZ,
+ double* B, F77_INT& LDB,
double& SCALE,
double* ALPHAR, double* ALPHAI,
double* BETA,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_sg03bd__", "__control_slicot_functions__.oct");
@@ -72,23 +71,23 @@ For internal use only.")
Matrix a = args(0).matrix_value ();
Matrix e = args(1).matrix_value ();
Matrix b = args(2).matrix_value ();
- octave_idx_type discrete = args(3).int_value ();
+ F77_INT discrete = args(3).int_value ();
if (discrete == 0)
dico = 'C';
else
dico = 'D';
- octave_idx_type n = a.rows ();
- octave_idx_type m = b.rows ();
+ F77_INT n = TO_F77_INT (a.rows ());
+ F77_INT m = TO_F77_INT (b.rows ());
- octave_idx_type lda = max (1, n);
- octave_idx_type lde = max (1, n);
- octave_idx_type ldq = max (1, n);
- octave_idx_type ldz = max (1, n);
- octave_idx_type ldb = max (1, m, n);
+ F77_INT lda = max (1, n);
+ F77_INT lde = max (1, n);
+ F77_INT ldq = max (1, n);
+ F77_INT ldz = max (1, n);
+ F77_INT ldb = max (1, m, n);
- octave_idx_type n1 = max (m, n);
+ F77_INT n1 = max (m, n);
b.resize (ldb, n1);
// arguments out
@@ -101,12 +100,12 @@ For internal use only.")
ColumnVector beta (n);
// workspace
- octave_idx_type ldwork = max (1, 4*n, 6*n-6);
+ F77_INT ldwork = max (1, 4*n, 6*n-6);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine SG03BD
diff --git a/src/sl_tb01id.cc b/src/sl_tb01id.cc
--- a/src/sl_tb01id.cc
+++ b/src/sl_tb01id.cc
@@ -28,20 +28,19 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (tb01id, TB01ID)
(char& JOB,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
+ F77_INT& N, F77_INT& M, F77_INT& P,
double& MAXRED,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
double* SCALE,
- octave_idx_type& INFO);
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_tb01id__", "__control_slicot_functions__.oct");
@@ -68,13 +67,13 @@ For internal use only.")
Matrix c = args(2).matrix_value ();
double maxred = args(3).double_value ();
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, p);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, p);
// arguments out
@@ -82,7 +81,7 @@ For internal use only.")
// error indicators
- octave_idx_type info = 0;
+ F77_INT info = 0;
// SLICOT routine TB01ID
diff --git a/src/sl_tb01pd.cc b/src/sl_tb01pd.cc
--- a/src/sl_tb01pd.cc
+++ b/src/sl_tb01pd.cc
@@ -28,22 +28,21 @@ Version: 0.5
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (tb01pd, TB01PD)
(char& JOB, char& EQUIL,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- octave_idx_type& NR,
+ F77_INT& N, F77_INT& M, F77_INT& P,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ F77_INT& NR,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_tb01pd__", "__control_slicot_functions__.oct");
@@ -70,20 +69,20 @@ For internal use only.")
Matrix b = args(1).matrix_value ();
Matrix c = args(2).matrix_value ();
double tol = args(3).double_value ();
- const octave_idx_type scaled = args(4).int_value ();
+ const F77_INT scaled = args(4).int_value ();
if (scaled == 0)
equil = 'S';
else
equil = 'N';
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc;
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc;
if (n == 0)
ldc = 1;
@@ -94,17 +93,17 @@ For internal use only.")
c.resize (ldc, n);
// arguments out
- octave_idx_type nr = 0;
+ F77_INT nr = 0;
// workspace
- octave_idx_type liwork = n + max (m, p);
- octave_idx_type ldwork = max (1, n + max (n, 3*m, 3*p));
+ F77_INT liwork = n + max (m, p);
+ F77_INT ldwork = max (1, n + max (n, 3*m, 3*p));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicators
- octave_idx_type info = 0;
+ F77_INT info = 0;
// SLICOT routine TB01PD
diff --git a/src/sl_tb01ud.cc b/src/sl_tb01ud.cc
--- a/src/sl_tb01ud.cc
+++ b/src/sl_tb01ud.cc
@@ -28,25 +28,24 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (tb01ud, TB01UD)
(char& JOBZ,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- octave_idx_type& NCONT, octave_idx_type& INDCON,
- octave_idx_type* NBLK,
- double* Z, octave_idx_type& LDZ,
+ F77_INT& N, F77_INT& M, F77_INT& P,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ F77_INT& NCONT, F77_INT& INDCON,
+ F77_INT* NBLK,
+ double* Z, F77_INT& LDZ,
double* TAU,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_tb01ud__", "__control_slicot_functions__.oct");
@@ -73,32 +72,32 @@ For internal use only.")
Matrix c = args(2).matrix_value ();
double tol = args(3).double_value ();
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, p);
- octave_idx_type ldz = max (1, n);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, p);
+ F77_INT ldz = max (1, n);
// arguments out
Matrix z (ldz, n);
- octave_idx_type ncont;
- octave_idx_type indcon;
+ F77_INT ncont;
+ F77_INT indcon;
- OCTAVE_LOCAL_BUFFER (octave_idx_type, nblk, n);
+ OCTAVE_LOCAL_BUFFER (F77_INT, nblk, n);
OCTAVE_LOCAL_BUFFER (double, tau, n);
// workspace
- octave_idx_type ldwork = max (1, n, 3*m, p);
+ F77_INT ldwork = max (1, n, 3*m, p);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, m);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, m);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicators
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine TB01UD
diff --git a/src/sl_tb04bd.cc b/src/sl_tb04bd.cc
--- a/src/sl_tb04bd.cc
+++ b/src/sl_tb04bd.cc
@@ -29,25 +29,24 @@ Version: 0.3
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (tb04bd, TB04BD)
(char& JOBD, char& ORDER, char& EQUIL,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P, octave_idx_type& MD,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
- octave_idx_type* IGN, octave_idx_type& LDIGN,
- octave_idx_type* IGD, octave_idx_type& LDIGD,
+ F77_INT& N, F77_INT& M, F77_INT& P, F77_INT& MD,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
+ F77_INT* IGN, F77_INT& LDIGN,
+ F77_INT* IGD, F77_INT& LDIGD,
double* GN, double* GD,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_tb04bd__", "__control_slicot_functions__.oct");
@@ -75,30 +74,30 @@ For internal use only.")
Matrix b = args(1).matrix_value ();
Matrix c = args(2).matrix_value ();
Matrix d = args(3).matrix_value ();
- const octave_idx_type scaled = args(4).int_value ();
+ const F77_INT scaled = args(4).int_value ();
if (scaled == 0)
equil = 'S';
else
equil = 'N';
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
- octave_idx_type md = n + 1;
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
+ F77_INT md = n + 1;
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, p);
- octave_idx_type ldd = max (1, p);
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, p);
+ F77_INT ldd = max (1, p);
// arguments out
- octave_idx_type ldign = max (1, p);
- octave_idx_type ldigd = max (1, p);
- octave_idx_type lg = p * m * md;
+ F77_INT ldign = max (1, p);
+ F77_INT ldigd = max (1, p);
+ F77_INT lg = p * m * md;
- OCTAVE_LOCAL_BUFFER (octave_idx_type, ign, ldign*m);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, igd, ldigd*m);
+ OCTAVE_LOCAL_BUFFER (F77_INT, ign, ldign*m);
+ OCTAVE_LOCAL_BUFFER (F77_INT, igd, ldigd*m);
RowVector gn (lg);
RowVector gd (lg);
@@ -107,13 +106,13 @@ For internal use only.")
double tol = 0; // use default value
// workspace
- octave_idx_type ldwork = max (1, n*(n + p) + max (n + max (n, p), n*(2*n + 5)));
+ F77_INT ldwork = max (1, n*(n + p) + max (n + max (n, p), n*(2*n + 5)));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, n);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, n);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine TB04BD
@@ -142,7 +141,7 @@ For internal use only.")
// return values
Cell num(p, m);
Cell den(p, m);
- octave_idx_type ik, istr;
+ F77_INT ik, istr;
for (ik = 0; ik < p*m; ik++)
{
diff --git a/src/sl_td04ad.cc b/src/sl_td04ad.cc
--- a/src/sl_td04ad.cc
+++ b/src/sl_td04ad.cc
@@ -31,26 +31,25 @@ Version: 0.3
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (td04ad, TD04AD)
(char& ROWCOL,
- octave_idx_type& M, octave_idx_type& P,
- octave_idx_type* INDEX,
- double* DCOEFF, octave_idx_type& LDDCOE,
- double* UCOEFF, octave_idx_type& LDUCO1, octave_idx_type& LDUCO2,
- octave_idx_type& NR,
- double* A, octave_idx_type& LDA,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* D, octave_idx_type& LDD,
+ F77_INT& M, F77_INT& P,
+ F77_INT* INDEX,
+ double* DCOEFF, F77_INT& LDDCOE,
+ double* UCOEFF, F77_INT& LDUCO1, F77_INT& LDUCO2,
+ F77_INT& NR,
+ double* A, F77_INT& LDA,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* D, F77_INT& LDD,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_td04ad__", "__control_slicot_functions__.oct");
@@ -77,27 +76,27 @@ For internal use only.")
Matrix indexd = args(2).matrix_value ();
double tol = args(3).double_value ();
- octave_idx_type p = ucoeff.rows (); // p: number of outputs
- octave_idx_type m = ucoeff.columns (); // m: number of inputs
+ F77_INT p = TO_F77_INT (ucoeff.rows ()); // p: number of outputs
+ F77_INT m = TO_F77_INT (ucoeff.columns ()); // m: number of inputs
- octave_idx_type lddcoe = max (1, p); // TODO: handle case ucoeff.rows = 0
- octave_idx_type lduco1 = max (1, p);
- octave_idx_type lduco2 = max (1, m);
+ F77_INT lddcoe = max (1, p); // TODO: handle case ucoeff.rows = 0
+ F77_INT lduco1 = max (1, p);
+ F77_INT lduco2 = max (1, m);
- octave_idx_type n = 0;
- OCTAVE_LOCAL_BUFFER (octave_idx_type, index, p);
- for (octave_idx_type i = 0; i < p; i++)
+ F77_INT n = 0;
+ OCTAVE_LOCAL_BUFFER (F77_INT, index, p);
+ for (F77_INT i = 0; i < p; i++)
{
- index[i] = indexd.xelem (i);
+ index[i] = TO_F77_INT (indexd.xelem (i));
n += index[i];
}
// arguments out
- octave_idx_type nr = max (1, n); // initialize to prevent crash if info != 0
- octave_idx_type lda = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, m, p);
- octave_idx_type ldd = max (1, p);
+ F77_INT nr = max (1, n); // initialize to prevent crash if info != 0
+ F77_INT lda = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, m, p);
+ F77_INT ldd = max (1, p);
Matrix a (lda, n);
Matrix b (ldb, max (m, p));
@@ -105,13 +104,13 @@ For internal use only.")
Matrix d (ldd, m);
// workspace
- octave_idx_type ldwork = max (1, n + max (n, 3*m, 3*p));
+ F77_INT ldwork = max (1, n + max (n, 3*m, 3*p));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, n + max (m, p));
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, n + max (m, p));
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicator
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine TD04AD
diff --git a/src/sl_tg01ad.cc b/src/sl_tg01ad.cc
--- a/src/sl_tg01ad.cc
+++ b/src/sl_tg01ad.cc
@@ -28,22 +28,21 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (tg01ad, TG01AD)
(char& JOB,
- octave_idx_type& L, octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
+ F77_INT& L, F77_INT& N, F77_INT& M, F77_INT& P,
double& TRESH,
- double* A, octave_idx_type& LDA,
- double* E, octave_idx_type& LDE,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
+ double* A, F77_INT& LDA,
+ double* E, F77_INT& LDE,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
double* LSCALE, double *RSCALE,
double* DWORK,
- octave_idx_type& INFO);
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_tg01ad__", "__control_slicot_functions__.oct");
@@ -71,15 +70,15 @@ For internal use only.")
Matrix c = args(3).matrix_value ();
double tresh = args(4).double_value ();
- octave_idx_type l = a.rows ();
- octave_idx_type n = a.columns (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT l = TO_F77_INT (a.rows ());
+ F77_INT n = TO_F77_INT (a.columns ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, l);
- octave_idx_type lde = max (1, l);
- octave_idx_type ldb = max (1, l);
- octave_idx_type ldc = max (1, p);
+ F77_INT lda = max (1, l);
+ F77_INT lde = max (1, l);
+ F77_INT ldb = max (1, l);
+ F77_INT ldc = max (1, p);
// arguments out
@@ -90,7 +89,7 @@ For internal use only.")
OCTAVE_LOCAL_BUFFER (double, dwork, 3*(l+n));
// error indicators
- octave_idx_type info = 0;
+ F77_INT info = 0;
// SLICOT routine TG01AD
diff --git a/src/sl_tg01fd.cc b/src/sl_tg01fd.cc
--- a/src/sl_tg01fd.cc
+++ b/src/sl_tg01fd.cc
@@ -28,25 +28,24 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (tg01fd, TG01FD)
(char& COMPQ, char& COMPZ, char& JOBA,
- octave_idx_type& L, octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
- double* A, octave_idx_type& LDA,
- double* E, octave_idx_type& LDE,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* Q, octave_idx_type& LDQ,
- double* Z, octave_idx_type& LDZ,
- octave_idx_type& RANKE, octave_idx_type& RNKA22,
+ F77_INT& L, F77_INT& N, F77_INT& M, F77_INT& P,
+ double* A, F77_INT& LDA,
+ double* E, F77_INT& LDE,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* Q, F77_INT& LDQ,
+ double* Z, F77_INT& LDZ,
+ F77_INT& RANKE, F77_INT& RNKA22,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_tg01fd__", "__control_slicot_functions__.oct");
@@ -74,7 +73,7 @@ For internal use only.")
Matrix e = args(1).matrix_value ();
Matrix b = args(2).matrix_value ();
Matrix c = args(3).matrix_value ();
- const octave_idx_type qz_flag = args(4).int_value ();
+ const F77_INT qz_flag = args(4).int_value ();
double tol = args(5).double_value ();
if (qz_flag == 0)
@@ -88,31 +87,31 @@ For internal use only.")
compz = 'I';
}
- octave_idx_type l = a.rows ();
- octave_idx_type n = l;
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT l = TO_F77_INT (a.rows ());
+ F77_INT n = l;
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, l);
- octave_idx_type lde = max (1, l);
- octave_idx_type ldb = max (1, l);
- octave_idx_type ldc = max (1, p);
- octave_idx_type ldq = max (1, l);
- octave_idx_type ldz = max (1, n);
+ F77_INT lda = max (1, l);
+ F77_INT lde = max (1, l);
+ F77_INT ldb = max (1, l);
+ F77_INT ldc = max (1, p);
+ F77_INT ldq = max (1, l);
+ F77_INT ldz = max (1, n);
// arguments out
Matrix q(l, l, 0.);
Matrix z(n, n, 0.);
Matrix empty(0, 0);
- octave_idx_type ranke, rnka22;
+ F77_INT ranke, rnka22;
// workspace
- octave_idx_type ldwork = max (1, n+p, min (l,n) + max (3*n-1, m, l));
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, n);
+ F77_INT ldwork = max (1, n+p, min (l,n) + max (3*n-1, m, l));
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, n);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicators
- octave_idx_type info = 0;
+ F77_INT info = 0;
// SLICOT routine TG01FD
diff --git a/src/sl_tg01hd.cc b/src/sl_tg01hd.cc
--- a/src/sl_tg01hd.cc
+++ b/src/sl_tg01hd.cc
@@ -28,7 +28,6 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
@@ -36,19 +35,19 @@ extern "C"
int F77_FUNC (tg01hd, TG01HD)
(char& JOBCON,
char& COMPQ, char& COMPZ,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
- double* A, octave_idx_type& LDA,
- double* E, octave_idx_type& LDE,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* Q, octave_idx_type& LDQ,
- double* Z, octave_idx_type& LDZ,
- octave_idx_type& NCONT, octave_idx_type& NIUCON,
- octave_idx_type& NRBLCK,
- octave_idx_type* RTAU,
+ F77_INT& N, F77_INT& M, F77_INT& P,
+ double* A, F77_INT& LDA,
+ double* E, F77_INT& LDE,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* Q, F77_INT& LDQ,
+ double* Z, F77_INT& LDZ,
+ F77_INT& NCONT, F77_INT& NIUCON,
+ F77_INT& NRBLCK,
+ F77_INT* RTAU,
double& TOL,
- octave_idx_type* IWORK, double* DWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK, double* DWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_tg01hd__", "__control_slicot_functions__.oct");
@@ -74,35 +73,35 @@ DEFUN_DLD (__sl_tg01hd__, args, nargout,
Matrix c = args(3).matrix_value ();
double tol = args(4).double_value ();
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type lde = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, p);
- octave_idx_type ldq = max (1, n);
- octave_idx_type ldz = max (1, n);
+ F77_INT lda = max (1, n);
+ F77_INT lde = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, p);
+ F77_INT ldq = max (1, n);
+ F77_INT ldz = max (1, n);
// arguments out
Matrix q (ldq, n);
Matrix z (ldz, n);
- octave_idx_type ncont;
- octave_idx_type niucon;
- octave_idx_type nrblck;
+ F77_INT ncont;
+ F77_INT niucon;
+ F77_INT nrblck;
- OCTAVE_LOCAL_BUFFER (octave_idx_type, rtau, n);
+ OCTAVE_LOCAL_BUFFER (F77_INT, rtau, n);
// workspace
- octave_idx_type ldwork = max (n, 2*m);
+ F77_INT ldwork = max (n, 2*m);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, m);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, m);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicators
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine TG01HD
diff --git a/src/sl_tg01id.cc b/src/sl_tg01id.cc
--- a/src/sl_tg01id.cc
+++ b/src/sl_tg01id.cc
@@ -28,7 +28,6 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
extern "C"
@@ -36,19 +35,19 @@ extern "C"
int F77_FUNC (tg01id, TG01ID)
(char& JOBOBS,
char& COMPQ, char& COMPZ,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
- double* A, octave_idx_type& LDA,
- double* E, octave_idx_type& LDE,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- double* Q, octave_idx_type& LDQ,
- double* Z, octave_idx_type& LDZ,
- octave_idx_type& NOBSV, octave_idx_type& NIUOBS,
- octave_idx_type& NLBLCK,
- octave_idx_type* CTAU,
+ F77_INT& N, F77_INT& M, F77_INT& P,
+ double* A, F77_INT& LDA,
+ double* E, F77_INT& LDE,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ double* Q, F77_INT& LDQ,
+ double* Z, F77_INT& LDZ,
+ F77_INT& NOBSV, F77_INT& NIUOBS,
+ F77_INT& NLBLCK,
+ F77_INT* CTAU,
double& TOL,
- octave_idx_type* IWORK, double* DWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK, double* DWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_tg01id__", "__control_slicot_functions__.oct");
@@ -74,16 +73,16 @@ DEFUN_DLD (__sl_tg01id__, args, nargout,
Matrix c = args(3).matrix_value ();
double tol = args(4).double_value ();
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type lde = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc = max (1, m, p);
- octave_idx_type ldq = max (1, n);
- octave_idx_type ldz = max (1, n);
+ F77_INT lda = max (1, n);
+ F77_INT lde = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc = max (1, m, p);
+ F77_INT ldq = max (1, n);
+ F77_INT ldz = max (1, n);
b.resize (ldb, max (m, p));
@@ -91,20 +90,20 @@ DEFUN_DLD (__sl_tg01id__, args, nargout,
Matrix q (ldq, n);
Matrix z (ldz, n);
- octave_idx_type nobsv;
- octave_idx_type niuobs;
- octave_idx_type nlblck;
+ F77_INT nobsv;
+ F77_INT niuobs;
+ F77_INT nlblck;
- OCTAVE_LOCAL_BUFFER (octave_idx_type, ctau, n);
+ OCTAVE_LOCAL_BUFFER (F77_INT, ctau, n);
// workspace
- octave_idx_type ldwork = max (n, 2*p);
+ F77_INT ldwork = max (n, 2*p);
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, p);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, p);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicators
- octave_idx_type info;
+ F77_INT info;
// SLICOT routine TG01ID
diff --git a/src/sl_tg01jd.cc b/src/sl_tg01jd.cc
--- a/src/sl_tg01jd.cc
+++ b/src/sl_tg01jd.cc
@@ -28,24 +28,23 @@ Version: 0.5
*/
#include
-#include
#include "common.h"
extern "C"
{
int F77_FUNC (tg01jd, TG01JD)
(char& JOB, char& SYSTYP, char& EQUIL,
- octave_idx_type& N, octave_idx_type& M, octave_idx_type& P,
- double* A, octave_idx_type& LDA,
- double* E, octave_idx_type& LDE,
- double* B, octave_idx_type& LDB,
- double* C, octave_idx_type& LDC,
- octave_idx_type& NR,
- octave_idx_type* INFRED,
+ F77_INT& N, F77_INT& M, F77_INT& P,
+ double* A, F77_INT& LDA,
+ double* E, F77_INT& LDE,
+ double* B, F77_INT& LDB,
+ double* C, F77_INT& LDC,
+ F77_INT& NR,
+ F77_INT* INFRED,
double& TOL,
- octave_idx_type* IWORK,
- double* DWORK, octave_idx_type& LDWORK,
- octave_idx_type& INFO);
+ F77_INT* IWORK,
+ double* DWORK, F77_INT& LDWORK,
+ F77_INT& INFO);
}
// PKG_ADD: autoload ("__sl_tg01jd__", "__control_slicot_functions__.oct");
@@ -74,9 +73,9 @@ For internal use only.")
Matrix b = args(2).matrix_value ();
Matrix c = args(3).matrix_value ();
double tol = args(4).double_value ();
- const octave_idx_type scaled = args(5).int_value ();
- const octave_idx_type ijob = args(6).int_value ();
- const octave_idx_type isystyp = args(7).int_value ();
+ const F77_INT scaled = args(5).int_value ();
+ const F77_INT ijob = args(6).int_value ();
+ const F77_INT isystyp = args(7).int_value ();
if (scaled == 0)
equil = 'S';
@@ -113,14 +112,14 @@ For internal use only.")
error ("__sl_tg01jd__: argument systyp invalid");
}
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type m = b.columns (); // m: number of inputs
- octave_idx_type p = c.rows (); // p: number of outputs
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT m = TO_F77_INT (b.columns ()); // m: number of inputs
+ F77_INT p = TO_F77_INT (c.rows ()); // p: number of outputs
- octave_idx_type lda = max (1, n);
- octave_idx_type lde = max (1, n);
- octave_idx_type ldb = max (1, n);
- octave_idx_type ldc;
+ F77_INT lda = max (1, n);
+ F77_INT lde = max (1, n);
+ F77_INT ldb = max (1, n);
+ F77_INT ldc;
if (n == 0)
ldc = 1;
@@ -138,14 +137,14 @@ For internal use only.")
c.resize (ldc, n);
// arguments out
- octave_idx_type nr;
- octave_idx_type infred[7];
+ F77_INT nr;
+ F77_INT infred[7];
// workspace
- octave_idx_type liwork = n + max (m, p);
- octave_idx_type ldwork;
- // octave_idx_type ldwork = max (n, 2*m, 2*p);
- // octave_idx_type ldwork = n * (2*n + m + p) + max (n, 2*m, 2*p);
+ F77_INT liwork = n + max (m, p);
+ F77_INT ldwork;
+ // F77_INT ldwork = max (n, 2*m, 2*p);
+ // F77_INT ldwork = n * (2*n + m + p) + max (n, 2*m, 2*p);
if (equil == 'S')
ldwork = max (8*n, 2*m, 2*p);
@@ -168,11 +167,11 @@ For internal use only.")
order reduction took place.
*/
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, liwork);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, liwork);
OCTAVE_LOCAL_BUFFER (double, dwork, ldwork);
// error indicators
- octave_idx_type info = 0;
+ F77_INT info = 0;
// SLICOT routine TG01JD
diff --git a/src/sl_tg04bx.cc b/src/sl_tg04bx.cc
--- a/src/sl_tg04bx.cc
+++ b/src/sl_tg04bx.cc
@@ -26,7 +26,6 @@ Version: 0.2
*/
#include
-#include
#include "common.h"
#include
#include
@@ -34,8 +33,8 @@ Version: 0.2
extern "C"
{
int F77_FUNC (tg04bx, TG04BX)
- (octave_idx_type& IP, octave_idx_type& IZ,
- double* A, octave_idx_type& LDA,
+ (F77_INT& IP, F77_INT& IZ,
+ double* A, F77_INT& LDA,
double* E,
double* B,
double* C,
@@ -43,7 +42,7 @@ extern "C"
double* PR, double* PI,
double* ZR, double* ZI,
double& GAIN,
- octave_idx_type* IWORK);
+ F77_INT* IWORK);
}
// PKG_ADD: autoload ("__sl_tg04bx__", "__control_slicot_functions__.oct");
@@ -75,9 +74,9 @@ For internal use only.")
ColumnVector zr = args(7).column_vector_value ();
ColumnVector zi = args(8).column_vector_value ();
- octave_idx_type n = a.rows (); // n: number of states
- octave_idx_type ip = pr.length (); // ip: number of finite poles
- octave_idx_type iz = zr.length (); // iz: number of zeros
+ F77_INT n = TO_F77_INT (a.rows ()); // n: number of states
+ F77_INT ip = TO_F77_INT (pr.length ()); // ip: number of finite poles
+ F77_INT iz = TO_F77_INT (zr.length ()); // iz: number of zeros
// For ss, IP = n is always true.
// However, dss models with poles at infinity
@@ -86,13 +85,13 @@ For internal use only.")
// Take pr.length == pi.length == ip for granted,
// and the same for iz, zr and zi.
- octave_idx_type lda = max (1, n);
+ F77_INT lda = max (1, n);
// arguments out
double gain;
// workspace
- OCTAVE_LOCAL_BUFFER (octave_idx_type, iwork, lda);
+ OCTAVE_LOCAL_BUFFER (F77_INT, iwork, lda);
F77_XFCN (tg04bx, TG04BX,