# HG changeset patch # User Rik # Date 1494344767 25200 # Node ID d691ed3082379ee74181e2312664664c8fb8d2bc # Parent 70edb5512c6e98a3645ec75001d57dd6f4ef1425 maint: Clean up #includes in liboctave/numeric directory. * build-aux/mk-opts.pl: Change Perl to generate "" around local include libraries rather than <>. Include "lo-math.h" rather than . * CollocWt.cc, DAERTFunc.h, DASPK.cc, DASPK.h, DASRT.cc, DASRT.h, DASSL.cc, DASSL.h, DET.h, EIG.cc, EIG.h, LSODE.cc, LSODE.h, ODE.h, ODES.cc, ODESFunc.h, Quad.cc, aepbalance.cc, base-de.h, base-min.h, bsxfun-decl.h, bsxfun-defs.cc, bsxfun.h, chol.cc, eigs-base.cc, fEIG.cc, fEIG.h, gepbalance.cc, gsvd.cc, hess.cc, lo-blas-proto.h, lo-lapack-proto.h, lo-mappers.cc, lo-mappers.h, lo-qrupdate-proto.h, lo-slatec-proto.h, lo-specfun.cc, lo-specfun.h, lu.cc, lu.h, oct-convn.cc, oct-convn.h, oct-fftw.cc, oct-fftw.h, oct-norm.cc, oct-rand.cc, oct-rand.h, oct-spparms.cc, oct-spparms.h, qr.cc, qr.h, qrp.cc, randgamma.cc, randpoisson.cc, schur.cc, schur.h, sparse-chol.cc, sparse-chol.h, sparse-dmsolve.cc, sparse-lu.cc, sparse-lu.h, sparse-qr.cc, sparse-qr.h, svd.cc: Rationalize #includes. Use forward declarations of just classes where possible. Reformat some long lines < 80 characters. Reformat some comments for readabliity. * mx-inlines.cc: Rationalize #includes for this file in liboctave/operators used by many in liboctave/numeric. diff -r 70edb5512c6e -r d691ed308237 build-aux/mk-opts.pl --- a/build-aux/mk-opts.pl Mon May 08 20:58:14 2017 -0700 +++ b/build-aux/mk-opts.pl Tue May 09 08:46:07 2017 -0700 @@ -110,7 +110,7 @@ } elsif (/^\s*INCLUDE\s*=\s*"(\S+)"\s*$/) { - $INCLUDE .= "#include <$1>\n"; + $INCLUDE .= qq (#include "$1"\n); } elsif (/^\s*DOC_STRING\s*$/) { @@ -374,10 +374,9 @@ #if ! defined (octave_${CLASS_NAME}_h) #define octave_${CLASS_NAME}_h 1 -#include - #include +#include "lo-math.h" $INCLUDE class diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/CollocWt.cc --- a/liboctave/numeric/CollocWt.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/CollocWt.cc Tue May 09 08:46:07 2017 -0700 @@ -24,12 +24,16 @@ # include "config.h" #endif +#include +#include + #include #include +#include "Array.h" #include "CollocWt.h" -#include "f77-fcn.h" #include "lo-error.h" +#include "lo-mappers.h" // The following routines jcobi, dif, and dfopr are based on the code // found in Villadsen, J. and M. L. Michelsen, Solution of Differential diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/DAERTFunc.h --- a/liboctave/numeric/DAERTFunc.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/DAERTFunc.h Tue May 09 08:46:07 2017 -0700 @@ -26,7 +26,6 @@ #include "octave-config.h" #include "DAEFunc.h" -#include "dMatrix.h" class DAERTFunc : public DAEFunc diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/DASPK.cc --- a/liboctave/numeric/DASPK.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/DASPK.cc Tue May 09 08:46:07 2017 -0700 @@ -27,9 +27,9 @@ #include #include "DASPK.h" +#include "dMatrix.h" #include "f77-fcn.h" #include "lo-error.h" -#include "lo-math.h" #include "quit.h" typedef F77_INT (*daspk_fcn_ptr) (const double&, const double*, const double*, @@ -148,8 +148,7 @@ ColumnVector DASPK::do_integrate (double tout) { - // FIXME: should handle all this option stuff just once - // for each new problem. + // FIXME: should handle all this option stuff just once for each new problem. ColumnVector retval; @@ -248,7 +247,6 @@ } else { - // FIXME: Should this be a warning? (*current_liboctave_error_handler) ("daspk: inconsistent sizes for tolerance arrays"); diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/DASPK.h --- a/liboctave/numeric/DASPK.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/DASPK.h Tue May 09 08:46:07 2017 -0700 @@ -27,8 +27,11 @@ #include +#include "Array.h" #include "DASPK-opts.h" +class Matrix; + class OCTAVE_API DASPK : public DAE, public DASPK_options diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/DASRT.cc --- a/liboctave/numeric/DASRT.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/DASRT.cc Tue May 09 08:46:07 2017 -0700 @@ -29,7 +29,6 @@ #include "DASRT.h" #include "f77-fcn.h" #include "lo-error.h" -#include "lo-math.h" #include "quit.h" typedef F77_INT (*dasrt_fcn_ptr) (const double&, const double*, const double*, diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/DASRT.h --- a/liboctave/numeric/DASRT.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/DASRT.h Tue May 09 08:46:07 2017 -0700 @@ -27,7 +27,9 @@ #include +#include "Array.h" #include "DASRT-opts.h" +#include "dMatrix.h" class DASRT_result diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/DASSL.cc --- a/liboctave/numeric/DASSL.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/DASSL.cc Tue May 09 08:46:07 2017 -0700 @@ -27,9 +27,9 @@ #include #include "DASSL.h" +#include "dMatrix.h" #include "f77-fcn.h" #include "lo-error.h" -#include "lo-math.h" #include "quit.h" typedef F77_INT (*dassl_fcn_ptr) (const double&, const double*, diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/DASSL.h --- a/liboctave/numeric/DASSL.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/DASSL.h Tue May 09 08:46:07 2017 -0700 @@ -27,8 +27,11 @@ #include +#include "Array.h" #include "DASSL-opts.h" +class Matrix; + class OCTAVE_API DASSL : public DAE, public DASSL_options diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/DET.h --- a/liboctave/numeric/DET.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/DET.h Tue May 09 08:46:07 2017 -0700 @@ -25,9 +25,9 @@ #include "octave-config.h" -#include +#include "lo-mappers.h" +#include "lo-math.h" #include "oct-cmplx.h" -#include "lo-mappers.h" template class diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/EIG.cc --- a/liboctave/numeric/EIG.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/EIG.cc Tue May 09 08:46:07 2017 -0700 @@ -25,8 +25,10 @@ # include "config.h" #endif +#include "Array.h" #include "EIG.h" #include "dColVector.h" +#include "dMatrix.h" #include "lo-error.h" #include "lo-lapack-proto.h" @@ -280,10 +282,11 @@ F77_CONST_CHAR_ARG2 (calc_rev ? "V" : "N", 1), F77_CONST_CHAR_ARG2 ("N", 1), n, F77_DBLE_CMPLX_ARG (tmp_data), n, - F77_DBLE_CMPLX_ARG (pw), F77_DBLE_CMPLX_ARG (pvl), n, - F77_DBLE_CMPLX_ARG (pvr), n, ilo, ihi, pscale, abnrm, - prconde, prcondv, - F77_DBLE_CMPLX_ARG (&dummy_work), lwork, prwork, info + F77_DBLE_CMPLX_ARG (pw), F77_DBLE_CMPLX_ARG (pvl), + n, F77_DBLE_CMPLX_ARG (pvr), n, ilo, ihi, + pscale, abnrm, prconde, prcondv, + F77_DBLE_CMPLX_ARG (&dummy_work), lwork, prwork, + info F77_CHAR_ARG_LEN (1) F77_CHAR_ARG_LEN (1) F77_CHAR_ARG_LEN (1) @@ -301,9 +304,9 @@ F77_CONST_CHAR_ARG2 (calc_rev ? "V" : "N", 1), F77_CONST_CHAR_ARG2 ("N", 1), n, F77_DBLE_CMPLX_ARG (tmp_data), n, - F77_DBLE_CMPLX_ARG (pw), F77_DBLE_CMPLX_ARG (pvl), n, - F77_DBLE_CMPLX_ARG (pvr), n, ilo, ihi, pscale, abnrm, - prconde, prcondv, + F77_DBLE_CMPLX_ARG (pw), F77_DBLE_CMPLX_ARG (pvl), + n, F77_DBLE_CMPLX_ARG (pvr), n, ilo, ihi, + pscale, abnrm, prconde, prcondv, F77_DBLE_CMPLX_ARG (pwork), lwork, prwork, info F77_CHAR_ARG_LEN (1) F77_CHAR_ARG_LEN (1) @@ -660,7 +663,8 @@ F77_DBLE_CMPLX_ARG (pbeta), F77_DBLE_CMPLX_ARG (pvl), n, F77_DBLE_CMPLX_ARG (pvr), n, - F77_DBLE_CMPLX_ARG (&dummy_work), lwork, prwork, info + F77_DBLE_CMPLX_ARG (&dummy_work), lwork, prwork, + info F77_CHAR_ARG_LEN (1) F77_CHAR_ARG_LEN (1))); diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/EIG.h --- a/liboctave/numeric/EIG.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/EIG.h Tue May 09 08:46:07 2017 -0700 @@ -27,9 +27,10 @@ #include -#include "dMatrix.h" +#include "CColVector.h" #include "CMatrix.h" -#include "CColVector.h" + +class Matrix; class OCTAVE_API diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/LSODE.cc --- a/liboctave/numeric/LSODE.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/LSODE.cc Tue May 09 08:46:07 2017 -0700 @@ -29,7 +29,6 @@ #include "LSODE.h" #include "f77-fcn.h" #include "lo-error.h" -#include "lo-math.h" #include "quit.h" typedef F77_INT (*lsode_fcn_ptr) (const F77_INT&, const double&, double*, diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/LSODE.h --- a/liboctave/numeric/LSODE.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/LSODE.h Tue May 09 08:46:07 2017 -0700 @@ -27,6 +27,7 @@ #include +#include "Array.h" #include "LSODE-opts.h" class diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/ODE.h --- a/liboctave/numeric/ODE.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/ODE.h Tue May 09 08:46:07 2017 -0700 @@ -27,6 +27,7 @@ #include "ODEFunc.h" #include "base-de.h" +#include "dMatrix.h" class ODE : public base_diff_eqn, public ODEFunc diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/ODES.cc --- a/liboctave/numeric/ODES.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/ODES.cc Tue May 09 08:46:07 2017 -0700 @@ -25,7 +25,6 @@ #endif #include "ODES.h" -#include "lo-error.h" void ODES::initialize (const ColumnVector& xx, double tt) diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/ODESFunc.h --- a/liboctave/numeric/ODESFunc.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/ODESFunc.h Tue May 09 08:46:07 2017 -0700 @@ -27,6 +27,8 @@ #include "dMatrix.h" +class ColumnVector; + class ODESFunc { diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/Quad.cc --- a/liboctave/numeric/Quad.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/Quad.cc Tue May 09 08:46:07 2017 -0700 @@ -24,6 +24,9 @@ # include "config.h" #endif +#include + +#include "Array.h" #include "Quad.h" #include "f77-fcn.h" #include "lo-error.h" diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/aepbalance.cc --- a/liboctave/numeric/aepbalance.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/aepbalance.cc Tue May 09 08:46:07 2017 -0700 @@ -25,17 +25,14 @@ # include "config.h" #endif -#include - -#include "CColVector.h" #include "CMatrix.h" #include "aepbalance.h" #include "dColVector.h" #include "dMatrix.h" -#include "fCColVector.h" #include "fCMatrix.h" #include "fColVector.h" #include "fMatrix.h" +#include "lo-error.h" #include "lo-lapack-proto.h" static inline char @@ -56,7 +53,8 @@ F77_INT n = octave::to_f77_int (a.cols ()); if (a.rows () != n) - (*current_liboctave_error_handler) ("aepbalance: requires square matrix"); + (*current_liboctave_error_handler) + ("aepbalance: requires square matrix"); scale = ColumnVector (n); @@ -106,7 +104,8 @@ F77_INT n = octave::to_f77_int (a.cols ()); if (a.rows () != n) - (*current_liboctave_error_handler) ("aepbalance: requires square matrix"); + (*current_liboctave_error_handler) + ("aepbalance: requires square matrix"); scale = FloatColumnVector (n); @@ -156,7 +155,8 @@ F77_INT n = octave::to_f77_int (a.cols ()); if (a.rows () != n) - (*current_liboctave_error_handler) ("aepbalance: requires square matrix"); + (*current_liboctave_error_handler) + ("aepbalance: requires square matrix"); scale = ColumnVector (n); @@ -207,7 +207,8 @@ F77_INT n = octave::to_f77_int (a.cols ()); if (a.rows () != n) - (*current_liboctave_error_handler) ("aepbalance: requires square matrix"); + (*current_liboctave_error_handler) + ("aepbalance: requires square matrix"); scale = FloatColumnVector (n); diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/base-de.h --- a/liboctave/numeric/base-de.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/base-de.h Tue May 09 08:46:07 2017 -0700 @@ -28,7 +28,6 @@ #include #include "dColVector.h" -#include "dMatrix.h" class base_diff_eqn diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/base-min.h --- a/liboctave/numeric/base-min.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/base-min.h Tue May 09 08:46:07 2017 -0700 @@ -48,14 +48,13 @@ return *this; } - // Derived classes must provide a function to actually do the - // minimization. + // Derived classes must provide a function to actually do the minimization. virtual ColumnVector do_minimize (double& objf, octave_idx_type& inform, ColumnVector& lambda) = 0; - // Lots of ways to call the single function and optionally set and - // get additional information. + // Lots of ways to call the single function and optionally set and get + // additional information. virtual ColumnVector minimize (void) { diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/bsxfun-decl.h --- a/liboctave/numeric/bsxfun-decl.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/bsxfun-decl.h Tue May 09 08:46:07 2017 -0700 @@ -24,8 +24,6 @@ #if ! defined (octave_bsxfun_decl_h) #define octave_bsxfun_decl_h 1 -#include "octave-config.h" - #define BSXFUN_OP_DECL(OP, ARRAY, API) \ extern API ARRAY bsxfun_ ## OP (const ARRAY&, const ARRAY&); diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/bsxfun-defs.cc --- a/liboctave/numeric/bsxfun-defs.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/bsxfun-defs.cc Tue May 09 08:46:07 2017 -0700 @@ -24,18 +24,15 @@ #if ! defined (octave_bsxfun_defs_h) #define octave_bsxfun_defs_h 1 -// This file should not include config.h. It is only included in other -// C++ source files that should have included config.h before including -// this file. +// This file should *not* include config.h. It is only included in other C++ +// source files that should have included config.h before including this file. #include -#include #include "dim-vector.h" +#include "lo-error.h" +#include "mx-inlines.cc" #include "oct-locbuf.h" -#include "lo-error.h" - -#include "mx-inlines.cc" template Array diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/bsxfun.h --- a/liboctave/numeric/bsxfun.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/bsxfun.h Tue May 09 08:46:07 2017 -0700 @@ -28,10 +28,9 @@ #include "octave-config.h" #include +#include -#include "Array.h" #include "dim-vector.h" -#include "lo-error.h" inline bool diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/chol.cc --- a/liboctave/numeric/chol.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/chol.cc Tue May 09 08:46:07 2017 -0700 @@ -25,21 +25,16 @@ # include "config.h" #endif -#include - +#include "Array.h" #include "CColVector.h" #include "CMatrix.h" -#include "CRowVector.h" #include "chol.h" #include "dColVector.h" #include "dMatrix.h" -#include "dRowVector.h" #include "fCColVector.h" #include "fCMatrix.h" -#include "fCRowVector.h" #include "fColVector.h" #include "fMatrix.h" -#include "fRowVector.h" #include "lo-error.h" #include "lo-lapack-proto.h" #include "lo-qrupdate-proto.h" diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/eigs-base.cc --- a/liboctave/numeric/eigs-base.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/eigs-base.cc Tue May 09 08:46:07 2017 -0700 @@ -27,19 +27,21 @@ #include #include +#include "Array.h" #include "CSparse.h" #include "MatrixType.h" +#include "PermMatrix.h" #include "chol.h" #include "dSparse.h" #include "eigs-base.h" -#include "f77-fcn.h" #include "lo-arpack-proto.h" #include "lo-blas-proto.h" +#include "lo-error.h" +#include "lo-ieee.h" #include "lu.h" #include "mx-ops.h" #include "oct-locbuf.h" #include "oct-rand.h" -#include "quit.h" #include "sparse-chol.h" #include "sparse-lu.h" diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/fEIG.cc --- a/liboctave/numeric/fEIG.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/fEIG.cc Tue May 09 08:46:07 2017 -0700 @@ -25,8 +25,10 @@ # include "config.h" #endif +#include "Array.h" #include "fEIG.h" #include "fColVector.h" +#include "fMatrix.h" #include "lo-error.h" #include "lo-lapack-proto.h" diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/fEIG.h --- a/liboctave/numeric/fEIG.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/fEIG.h Tue May 09 08:46:07 2017 -0700 @@ -27,9 +27,10 @@ #include -#include "fMatrix.h" +#include "fCColVector.h" #include "fCMatrix.h" -#include "fCColVector.h" + +class FloatMatrix; class OCTAVE_API diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/gepbalance.cc --- a/liboctave/numeric/gepbalance.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/gepbalance.cc Tue May 09 08:46:07 2017 -0700 @@ -24,17 +24,16 @@ # include "config.h" #endif -#include -#include - -#include "Array-util.h" #include "CMatrix.h" #include "dMatrix.h" #include "fCMatrix.h" #include "fMatrix.h" #include "gepbalance.h" +#include "lo-array-errwarn.h" +#include "lo-error.h" #include "lo-lapack-proto.h" #include "oct-locbuf.h" +#include "quit.h" namespace octave { @@ -48,7 +47,8 @@ F77_INT n = octave::to_f77_int (a.cols ()); if (a.rows () != n) - (*current_liboctave_error_handler) ("GEPBALANCE requires square matrix"); + (*current_liboctave_error_handler) + ("GEPBALANCE requires square matrix"); if (a.dims () != b.dims ()) octave::err_nonconformant ("GEPBALANCE", n, n, b.rows(), b.cols()); @@ -116,7 +116,8 @@ ("FloatGEPBALANCE requires square matrix"); if (a.dims () != b.dims ()) - octave::err_nonconformant ("FloatGEPBALANCE", n, n, b.rows(), b.cols()); + octave::err_nonconformant ("FloatGEPBALANCE", + n, n, b.rows(), b.cols()); F77_INT info; F77_INT ilo; @@ -182,7 +183,8 @@ ("ComplexGEPBALANCE requires square matrix"); if (a.dims () != b.dims ()) - octave::err_nonconformant ("ComplexGEPBALANCE", n, n, b.rows(), b.cols()); + octave::err_nonconformant ("ComplexGEPBALANCE", + n, n, b.rows(), b.cols()); F77_INT info; F77_INT ilo; @@ -200,7 +202,8 @@ char job = balance_job[0]; F77_XFCN (zggbal, ZGGBAL, (F77_CONST_CHAR_ARG2 (&job, 1), - n, F77_DBLE_CMPLX_ARG (p_balanced_mat), n, F77_DBLE_CMPLX_ARG (p_balanced_mat2), + n, F77_DBLE_CMPLX_ARG (p_balanced_mat), + n, F77_DBLE_CMPLX_ARG (p_balanced_mat2), n, ilo, ihi, plscale, prscale, pwork, info F77_CHAR_ARG_LEN (1))); @@ -251,7 +254,8 @@ } if (a.dims () != b.dims ()) - octave::err_nonconformant ("FloatComplexGEPBALANCE", n, n, b.rows(), b.cols()); + octave::err_nonconformant ("FloatComplexGEPBALANCE", + n, n, b.rows(), b.cols()); F77_INT info; F77_INT ilo; @@ -269,7 +273,8 @@ char job = balance_job[0]; F77_XFCN (cggbal, CGGBAL, (F77_CONST_CHAR_ARG2 (&job, 1), - n, F77_CMPLX_ARG (p_balanced_mat), n, F77_CMPLX_ARG (p_balanced_mat2), + n, F77_CMPLX_ARG (p_balanced_mat), + n, F77_CMPLX_ARG (p_balanced_mat2), n, ilo, ihi, plscale, prscale, pwork, info F77_CHAR_ARG_LEN (1))); diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/gsvd.cc --- a/liboctave/numeric/gsvd.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/gsvd.cc Tue May 09 08:46:07 2017 -0700 @@ -28,16 +28,15 @@ #include +#include "CMatrix.h" +#include "dDiagMatrix.h" +#include "dMatrix.h" +#include "fCMatrix.h" +#include "fDiagMatrix.h" +#include "fMatrix.h" #include "gsvd.h" - #include "lo-error.h" #include "lo-lapack-proto.h" -#include "dMatrix.h" -#include "fMatrix.h" -#include "CMatrix.h" -#include "fCMatrix.h" -#include "dDiagMatrix.h" -#include "fDiagMatrix.h" namespace octave { diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/hess.cc --- a/liboctave/numeric/hess.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/hess.cc Tue May 09 08:46:07 2017 -0700 @@ -24,6 +24,7 @@ # include "config.h" #endif +#include "Array.h" #include "CMatrix.h" #include "dMatrix.h" #include "fCMatrix.h" @@ -39,7 +40,7 @@ template <> octave_idx_type hess::init (const Matrix& a) - { + { F77_INT a_nr = octave::to_f77_int (a.rows ()); F77_INT a_nc = octave::to_f77_int (a.cols ()); diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/lo-blas-proto.h --- a/liboctave/numeric/lo-blas-proto.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/lo-blas-proto.h Tue May 09 08:46:07 2017 -0700 @@ -110,7 +110,8 @@ const F77_INT&, const F77_DBLE&, const F77_DBLE*, const F77_INT&, const F77_DBLE*, const F77_INT&, - const F77_DBLE&, F77_DBLE*, const F77_INT& + const F77_DBLE&, F77_DBLE*, + const F77_INT& F77_CHAR_ARG_LEN_DECL F77_CHAR_ARG_LEN_DECL); @@ -133,7 +134,8 @@ const F77_INT&, const F77_DBLE_CMPLX&, const F77_DBLE_CMPLX*, const F77_INT&, const F77_DBLE_CMPLX*, const F77_INT&, - const F77_DBLE_CMPLX&, F77_DBLE_CMPLX*, const F77_INT& + const F77_DBLE_CMPLX&, F77_DBLE_CMPLX*, + const F77_INT& F77_CHAR_ARG_LEN_DECL F77_CHAR_ARG_LEN_DECL); diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/lo-lapack-proto.h --- a/liboctave/numeric/lo-lapack-proto.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/lo-lapack-proto.h Tue May 09 08:46:07 2017 -0700 @@ -46,8 +46,8 @@ const F77_INT&, const F77_INT&, const F77_INT&, F77_DBLE_CMPLX*, const F77_INT&, const F77_INT*, - const F77_DBLE&, F77_DBLE&, F77_DBLE_CMPLX*, F77_DBLE*, - F77_INT& + const F77_DBLE&, F77_DBLE&, F77_DBLE_CMPLX*, + F77_DBLE*, F77_INT& F77_CHAR_ARG_LEN_DECL); // GBTRF @@ -191,9 +191,8 @@ F77_RET_T F77_FUNC (cgehrd, CGEHRD) (const F77_INT&, const F77_INT&, const F77_INT&, F77_CMPLX*, - const F77_INT&, F77_CMPLX*, - F77_CMPLX*, const F77_INT&, - F77_INT&); + const F77_INT&, F77_CMPLX*, F77_CMPLX*, + const F77_INT&, F77_INT&); F77_RET_T F77_FUNC (dgehrd, DGEHRD) (const F77_INT&, const F77_INT&, @@ -229,15 +228,14 @@ F77_RET_T F77_FUNC (sgeqp3, SGEQP3) (const F77_INT&, const F77_INT&, - F77_REAL*, const F77_INT&, F77_INT*, - F77_REAL*, F77_REAL*, const F77_INT&, - F77_INT&); + F77_REAL*, const F77_INT&, + F77_INT*, F77_REAL*, F77_REAL*, + const F77_INT&, F77_INT&); F77_RET_T F77_FUNC (zgeqp3, ZGEQP3) (const F77_INT&, const F77_INT&, F77_DBLE_CMPLX*, const F77_INT&, F77_INT*, F77_DBLE_CMPLX*, F77_DBLE_CMPLX*, - const F77_INT&, F77_DBLE*, - F77_INT&); + const F77_INT&, F77_DBLE*, F77_INT&); // GEQRF @@ -249,20 +247,21 @@ F77_RET_T F77_FUNC (dgeqrf, DGEQRF) (const F77_INT&, const F77_INT&, - F77_DBLE*, const F77_INT&, F77_DBLE*, F77_DBLE*, const F77_INT&, - F77_INT&); + F77_DBLE*, F77_DBLE*, + const F77_INT&, F77_INT&); F77_RET_T F77_FUNC (sgeqrf, SGEQRF) (const F77_INT&, const F77_INT&, - F77_REAL*, const F77_INT&, F77_REAL*, F77_REAL*, + F77_REAL*, const F77_INT&, + F77_REAL*, F77_REAL*, const F77_INT&, F77_INT&); F77_RET_T F77_FUNC (zgeqrf, ZGEQRF) (const F77_INT&, const F77_INT&, - F77_DBLE_CMPLX*, const F77_INT&, F77_DBLE_CMPLX*, F77_DBLE_CMPLX*, const F77_INT&, - F77_INT&); + F77_DBLE_CMPLX*, F77_DBLE_CMPLX*, + const F77_INT&, F77_INT&); // GESDD @@ -272,37 +271,37 @@ F77_CMPLX*, const F77_INT&, F77_REAL*, F77_CMPLX*, const F77_INT&, F77_CMPLX*, const F77_INT&, - F77_CMPLX*, const F77_INT&, - F77_REAL*, F77_INT *, F77_INT& + F77_CMPLX*, const F77_INT&, F77_REAL*, + F77_INT *, F77_INT& F77_CHAR_ARG_LEN_DECL); F77_RET_T F77_FUNC (dgesdd, DGESDD) (F77_CONST_CHAR_ARG_DECL, const F77_INT&, const F77_INT&, F77_DBLE*, const F77_INT&, F77_DBLE*, - F77_DBLE*, const F77_INT&, F77_DBLE*, - const F77_INT&, F77_DBLE*, - const F77_INT&, F77_INT *, - F77_INT& + F77_DBLE*, const F77_INT&, + F77_DBLE*, const F77_INT&, + F77_DBLE*, const F77_INT&, + F77_INT *, F77_INT& F77_CHAR_ARG_LEN_DECL); F77_RET_T F77_FUNC (sgesdd, SGESDD) (F77_CONST_CHAR_ARG_DECL, const F77_INT&, const F77_INT&, F77_REAL*, const F77_INT&, F77_REAL*, - F77_REAL*, const F77_INT&, F77_REAL*, - const F77_INT&, F77_REAL*, - const F77_INT&, F77_INT *, - F77_INT& + F77_REAL*, const F77_INT&, + F77_REAL*, const F77_INT&, + F77_REAL*, const F77_INT&, + F77_INT *, F77_INT& F77_CHAR_ARG_LEN_DECL); F77_RET_T F77_FUNC (zgesdd, ZGESDD) (F77_CONST_CHAR_ARG_DECL, const F77_INT&, const F77_INT&, + F77_DBLE_CMPLX*, const F77_INT&, F77_DBLE*, F77_DBLE_CMPLX*, const F77_INT&, - F77_DBLE*, F77_DBLE_CMPLX*, const F77_INT&, - F77_DBLE_CMPLX*, const F77_INT&, F77_DBLE_CMPLX*, - const F77_INT&, F77_DBLE*, + F77_DBLE_CMPLX*, const F77_INT&, + F77_DBLE_CMPLX*, const F77_INT&, F77_DBLE*, F77_INT *, F77_INT& F77_CHAR_ARG_LEN_DECL); // GESVD diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/lo-mappers.cc --- a/liboctave/numeric/lo-mappers.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/lo-mappers.cc Tue May 09 08:46:07 2017 -0700 @@ -25,16 +25,9 @@ # include "config.h" #endif -#include "lo-error.h" -#include "lo-ieee.h" #include "lo-mappers.h" -#include "lo-math.h" #include "lo-specfun.h" -#include "lo-utils.h" #include "math-wrappers.h" -#include "oct-cmplx.h" - -#include "f77-fcn.h" // FIXME: We used to have this situation: // diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/lo-mappers.h --- a/liboctave/numeric/lo-mappers.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/lo-mappers.h Tue May 09 08:46:07 2017 -0700 @@ -75,13 +75,16 @@ using std::atan; - // C++ now provides versions of the following funtions for - // arguments of type std::complex and T. But some compilers - // (I'm looking at you, clang) apparently don't get this right - // yet... So we provide our own wrappers for real-valued arguments. + // C++ now provides versions of the following functions for arguments of + // type std::complex and T. But some compilers (I'm looking at you, + // clang) apparently don't get this right yet... So we provide our own + // wrappers for real-valued arguments. inline double arg (double x) { return signbit (x) ? M_PI : 0; } - inline float arg (float x) { return signbit (x) ? static_cast (M_PI) : 0; } + inline float arg (float x) + { + return signbit (x) ? static_cast (M_PI) : 0; + } template T @@ -302,9 +305,16 @@ } template <> - inline double x_nint (double x) { return (finite (x) ? floor (x + 0.5) : x); } + inline double x_nint (double x) + { + return (finite (x) ? floor (x + 0.5) : x); + } + template <> - inline float x_nint (float x) { return (finite (x) ? floor (x + 0.5f) : x); } + inline float x_nint (float x) + { + return (finite (x) ? floor (x + 0.5f) : x); + } extern OCTAVE_API octave_idx_type nint_big (double x); extern OCTAVE_API octave_idx_type nint_big (float x); @@ -496,27 +506,45 @@ OCTAVE_DEPRECATED ("use 'octave::math::is_NA' instead") inline bool octave_is_NA (const Complex& x) { return octave::math::is_NA (x); } OCTAVE_DEPRECATED ("use 'octave::math::is_NA' instead") -inline bool octave_is_NA (const FloatComplex& x) { return octave::math::is_NA (x); } +inline bool octave_is_NA (const FloatComplex& x) +{ + return octave::math::is_NA (x); +} OCTAVE_DEPRECATED ("use 'octave::math::is_NaN_or_NA' instead") -inline bool octave_is_NaN_or_NA (const Complex& x) { return octave::math::is_NaN_or_NA (x); } +inline bool octave_is_NaN_or_NA (const Complex& x) +{ + return octave::math::is_NaN_or_NA (x); +} OCTAVE_DEPRECATED ("use 'octave::math::is_NaN_or_NA' instead") -inline bool octave_is_NaN_or_NA (const FloatComplex& x) { return octave::math::is_NaN_or_NA (x); } +inline bool octave_is_NaN_or_NA (const FloatComplex& x) +{ + return octave::math::is_NaN_or_NA (x); +} OCTAVE_DEPRECATED ("use 'octave::math::acos' instead") inline Complex acos (const Complex& x) { return octave::math::acos (x); } OCTAVE_DEPRECATED ("use 'octave::math::acos' instead") -inline FloatComplex acos (const FloatComplex& x) { return octave::math::acos (x); } +inline FloatComplex acos (const FloatComplex& x) +{ + return octave::math::acos (x); +} OCTAVE_DEPRECATED ("use 'octave::math::asin' instead") inline Complex asin (const Complex& x) { return octave::math::asin (x); } OCTAVE_DEPRECATED ("use 'octave::math::asin' instead") -inline FloatComplex asin (const FloatComplex& x) { return octave::math::asin (x); } +inline FloatComplex asin (const FloatComplex& x) +{ + return octave::math::asin (x); +} OCTAVE_DEPRECATED ("use 'octave::math::atan' instead") inline Complex atan (const Complex& x) { return octave::math::atan (x); } OCTAVE_DEPRECATED ("use 'octave::math::atan' instead") -inline FloatComplex atan (const FloatComplex& x) { return octave::math::atan (x); } +inline FloatComplex atan (const FloatComplex& x) +{ + return octave::math::atan (x); +} OCTAVE_DEPRECATED ("use 'octave::math::arg' instead") inline double arg (double x) { return octave::math::arg (x); } @@ -546,17 +574,29 @@ OCTAVE_DEPRECATED ("use 'octave::math::log2' instead") inline Complex xlog2 (const Complex& x) { return octave::math::log2 (x); } OCTAVE_DEPRECATED ("use 'octave::math::log2' instead") -inline FloatComplex xlog2 (const FloatComplex& x) { return octave::math::log2 (x); } +inline FloatComplex xlog2 (const FloatComplex& x) +{ + return octave::math::log2 (x); +} OCTAVE_DEPRECATED ("use 'octave::math::log2' instead") -inline double xlog2 (double x, int& exp) { return octave::math::log2 (x, exp); } +inline double xlog2 (double x, int& exp) +{ + return octave::math::log2 (x, exp); +} OCTAVE_DEPRECATED ("use 'octave::math::log2' instead") inline float xlog2 (float x, int& exp) { return octave::math::log2 (x, exp); } OCTAVE_DEPRECATED ("use 'octave::math::log2' instead") -inline Complex xlog2 (const Complex& x, int& exp) { return octave::math::log2 (x, exp); } +inline Complex xlog2 (const Complex& x, int& exp) +{ + return octave::math::log2 (x, exp); +} OCTAVE_DEPRECATED ("use 'octave::math::log2' instead") -inline FloatComplex xlog2 (const FloatComplex& x, int& exp) { return octave::math::log2 (x, exp); } +inline FloatComplex xlog2 (const FloatComplex& x, int& exp) +{ + return octave::math::log2 (x, exp); +} OCTAVE_DEPRECATED ("use 'octave::math::exp2' instead") inline double xexp2 (double x) { return octave::math::exp2 (x); } @@ -577,9 +617,15 @@ } OCTAVE_DEPRECATED ("use 'octave::math::copysign' instead") -inline double xcopysign (double x, double y) { return octave::math::copysign (x, y); } +inline double xcopysign (double x, double y) +{ + return octave::math::copysign (x, y); +} OCTAVE_DEPRECATED ("use 'octave::math::copysign' instead") -inline float xcopysign (float x, float y) { return octave::math::copysign (x, y); } +inline float xcopysign (float x, float y) +{ + return octave::math::copysign (x, y); +} template OCTAVE_DEPRECATED ("use 'octave::math::signbit' instead") @@ -590,14 +636,26 @@ } OCTAVE_DEPRECATED ("use 'octave::math::negative_sign' instead") -inline bool xnegative_sign (double x) { return octave::math::negative_sign (x); } +inline bool xnegative_sign (double x) +{ + return octave::math::negative_sign (x); +} OCTAVE_DEPRECATED ("use 'octave::math::negative_sign' instead") -inline bool xnegative_sign (float x) { return octave::math::negative_sign (x); } +inline bool xnegative_sign (float x) +{ + return octave::math::negative_sign (x); +} OCTAVE_DEPRECATED ("use 'octave::math::positive_sign' instead") -inline bool xpositive_sign (double x) { return octave::math::positive_sign (x); } +inline bool xpositive_sign (double x) +{ + return octave::math::positive_sign (x); +} OCTAVE_DEPRECATED ("use 'octave::math::positive_sign' instead") -inline bool xpositive_sign (float x) { return octave::math::positive_sign (x); } +inline bool xpositive_sign (float x) +{ + return octave::math::positive_sign (x); +} OCTAVE_DEPRECATED ("use 'octave::math::signum' instead") inline double signum (double x) { return octave::math::signum (x); } diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/lo-qrupdate-proto.h --- a/liboctave/numeric/lo-qrupdate-proto.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/lo-qrupdate-proto.h Tue May 09 08:46:07 2017 -0700 @@ -41,18 +41,18 @@ F77_RET_T F77_FUNC (dch1dn, DCH1DN) (const F77_INT&, F77_DBLE*, - const F77_INT&, F77_DBLE*, F77_DBLE*, - F77_INT&); + const F77_INT&, F77_DBLE*, + F77_DBLE*, F77_INT&); F77_RET_T F77_FUNC (sch1dn, SCH1DN) (const F77_INT&, F77_REAL*, - const F77_INT&, F77_REAL*, F77_REAL*, - F77_INT&); + const F77_INT&, F77_REAL*, + F77_REAL*, F77_INT&); F77_RET_T F77_FUNC (zch1dn, ZCH1DN) (const F77_INT&, F77_DBLE_CMPLX*, - const F77_INT&, F77_DBLE_CMPLX*, F77_DBLE*, - F77_INT&); + const F77_INT&, F77_DBLE_CMPLX*, + F77_DBLE*, F77_INT&); // CH1UP @@ -186,8 +186,8 @@ F77_FUNC (sqrdec, SQRDEC) (const F77_INT&, const F77_INT&, const F77_INT&, F77_REAL*, const F77_INT&, F77_REAL*, - const F77_INT&, - const F77_INT&, F77_REAL*); + const F77_INT&, const F77_INT&, + F77_REAL*); F77_RET_T F77_FUNC (zqrdec, ZQRDEC) (const F77_INT&, const F77_INT&, @@ -206,9 +206,9 @@ F77_RET_T F77_FUNC (dqrder, DQRDER) (const F77_INT&, const F77_INT&, - F77_DBLE*, const F77_INT&, F77_DBLE*, - const F77_INT&, const F77_INT&, - F77_DBLE*); + F77_DBLE*, const F77_INT&, + F77_DBLE*, const F77_INT&, + const F77_INT&, F77_DBLE*); F77_RET_T F77_FUNC (sqrder, SQRDER) (const F77_INT&, const F77_INT&, @@ -218,9 +218,9 @@ F77_RET_T F77_FUNC (zqrder, ZQRDER) (const F77_INT&, const F77_INT&, - F77_DBLE_CMPLX*, const F77_INT&, F77_DBLE_CMPLX*, - const F77_INT&, const F77_INT&, - F77_DBLE_CMPLX*, F77_DBLE*); + F77_DBLE_CMPLX*, const F77_INT&, + F77_DBLE_CMPLX*, const F77_INT&, + const F77_INT&, F77_DBLE_CMPLX*, F77_DBLE*); // QRINC @@ -228,7 +228,7 @@ F77_FUNC (cqrinc, CQRINC) (const F77_INT&, const F77_INT&, const F77_INT&, F77_CMPLX*, const F77_INT&, F77_CMPLX*, - const F77_INT&,const F77_INT&, + const F77_INT&, const F77_INT&, const F77_CMPLX*, F77_REAL*); F77_RET_T @@ -242,8 +242,8 @@ F77_FUNC (sqrinc, SQRINC) (const F77_INT&, const F77_INT&, const F77_INT&, F77_REAL*, const F77_INT&, F77_REAL*, - const F77_INT&, - const F77_INT&, const F77_REAL*, F77_REAL*); + const F77_INT&, const F77_INT&, + const F77_REAL*, F77_REAL*); F77_RET_T F77_FUNC (zqrinc, ZQRINC) (const F77_INT&, const F77_INT&, @@ -263,21 +263,24 @@ F77_RET_T F77_FUNC (dqrinr, DQRINR) (const F77_INT&, const F77_INT&, - F77_DBLE*, const F77_INT&, F77_DBLE*, - const F77_INT&, const F77_INT&, - const F77_DBLE*, F77_DBLE*); + F77_DBLE*, const F77_INT&, + F77_DBLE*, const F77_INT&, + const F77_INT&, const F77_DBLE*, + F77_DBLE*); F77_RET_T F77_FUNC (sqrinr, SQRINR) (const F77_INT&, const F77_INT&, F77_REAL*, const F77_INT&, F77_REAL*, const F77_INT&, - const F77_INT&, const F77_REAL*, F77_REAL*); + const F77_INT&, const F77_REAL*, + F77_REAL*); F77_RET_T F77_FUNC (zqrinr, ZQRINR) (const F77_INT&, const F77_INT&, - F77_DBLE_CMPLX*, const F77_INT&, F77_DBLE_CMPLX*, - const F77_INT&, const F77_INT&, - const F77_DBLE_CMPLX*, F77_DBLE*); + F77_DBLE_CMPLX*, const F77_INT&, + F77_DBLE_CMPLX*, const F77_INT&, + const F77_INT&, const F77_DBLE_CMPLX*, + F77_DBLE*); // QRSHC @@ -286,21 +289,22 @@ const F77_INT&, F77_CMPLX*, const F77_INT&, F77_CMPLX*, const F77_INT&, const F77_INT&, - const F77_INT&, F77_CMPLX*, - F77_REAL*); + const F77_INT&, + F77_CMPLX*, F77_REAL*); F77_RET_T F77_FUNC (dqrshc, DQRSHC) (const F77_INT&, const F77_INT&, const F77_INT&, F77_DBLE*, const F77_INT&, F77_DBLE*, const F77_INT&, const F77_INT&, - const F77_INT&, F77_DBLE*); + const F77_INT&, + F77_DBLE*); F77_RET_T F77_FUNC (sqrshc, SQRSHC) (const F77_INT&, const F77_INT&, const F77_INT&, F77_REAL*, const F77_INT&, F77_REAL*, + const F77_INT&, const F77_INT&, const F77_INT&, - const F77_INT&, const F77_INT&, F77_REAL*); F77_RET_T @@ -308,7 +312,8 @@ const F77_INT&, F77_DBLE_CMPLX*, const F77_INT&, F77_DBLE_CMPLX*, const F77_INT&, const F77_INT&, - const F77_INT&, F77_DBLE_CMPLX*, F77_DBLE*); + const F77_INT&, + F77_DBLE_CMPLX*, F77_DBLE*); #endif diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/lo-slatec-proto.h --- a/liboctave/numeric/lo-slatec-proto.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/lo-slatec-proto.h Tue May 09 08:46:07 2017 -0700 @@ -90,10 +90,12 @@ // GAMMAINC F77_RET_T - F77_FUNC (xgammainc, XGAMMAINC) (const F77_DBLE&, const F77_DBLE&, F77_DBLE&); + F77_FUNC (xgammainc, XGAMMAINC) (const F77_DBLE&, const F77_DBLE&, + F77_DBLE&); F77_RET_T - F77_FUNC (xsgammainc, XSGAMMAINC) (const F77_REAL&, const F77_REAL&, F77_REAL&); + F77_FUNC (xsgammainc, XSGAMMAINC) (const F77_REAL&, const F77_REAL&, + F77_REAL&); // LGAMS diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/lo-specfun.cc --- a/liboctave/numeric/lo-specfun.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/lo-specfun.cc Tue May 09 08:46:07 2017 -0700 @@ -28,30 +28,32 @@ # include "config.h" #endif -#include "Range.h" +#include +#include +#include + #include "CColVector.h" #include "CMatrix.h" -#include "dRowVector.h" +#include "CNDArray.h" +#include "Faddeeva.hh" #include "dMatrix.h" #include "dNDArray.h" -#include "CNDArray.h" +#include "dRowVector.h" +#include "f77-fcn.h" #include "fCColVector.h" #include "fCMatrix.h" -#include "fRowVector.h" +#include "fCNDArray.h" #include "fMatrix.h" #include "fNDArray.h" -#include "fCNDArray.h" -#include "f77-fcn.h" +#include "fRowVector.h" #include "lo-amos-proto.h" #include "lo-error.h" #include "lo-ieee.h" +#include "lo-mappers.h" +#include "lo-math.h" #include "lo-slatec-proto.h" #include "lo-specfun.h" #include "mx-inlines.cc" -#include "lo-mappers.h" -#include "lo-math.h" - -#include "Faddeeva.hh" namespace octave { diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/lo-specfun.h --- a/liboctave/numeric/lo-specfun.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/lo-specfun.h Tue May 09 08:46:07 2017 -0700 @@ -26,22 +26,21 @@ #include "octave-config.h" +#include "Array.h" #include "oct-cmplx.h" -#include "Array.h" +class ComplexColumnVector; +class ComplexMatrix; +class ComplexNDArray; +class FloatComplexColumnVector; +class FloatComplexMatrix; +class FloatComplexNDArray; +class FloatMatrix; +class FloatNDArray; +class FloatRowVector; class Matrix; -class ComplexMatrix; class NDArray; -class ComplexNDArray; class RowVector; -class ComplexColumnVector; -class FloatMatrix; -class FloatComplexMatrix; -class FloatNDArray; -class FloatComplexNDArray; -class FloatRowVector; -class FloatComplexColumnVector; -class Range; namespace octave { diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/lu.cc --- a/liboctave/numeric/lu.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/lu.cc Tue May 09 08:46:07 2017 -0700 @@ -25,8 +25,11 @@ # include "config.h" #endif +#include + #include "CColVector.h" #include "CMatrix.h" +#include "PermMatrix.h" #include "dColVector.h" #include "dMatrix.h" #include "fCColVector.h" @@ -294,8 +297,8 @@ ColumnVector utmp = u; ColumnVector vtmp = v; - F77_XFCN (dlu1up, DLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, - utmp.fortran_vec (), vtmp.fortran_vec ())); + F77_XFCN (dlu1up, DLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), + k, utmp.fortran_vec (), vtmp.fortran_vec ())); } template <> @@ -426,7 +429,8 @@ template <> void - lu::update (const FloatColumnVector& u, const FloatColumnVector& v) + lu::update (const FloatColumnVector& u, + const FloatColumnVector& v) { if (packed ()) unpack (); @@ -570,8 +574,8 @@ F77_INT info = 0; - F77_XFCN (zgetrf, ZGETRF, (a_nr, a_nc, F77_DBLE_CMPLX_ARG (tmp_data), a_nr, - pipvt, info)); + F77_XFCN (zgetrf, ZGETRF, (a_nr, a_nc, F77_DBLE_CMPLX_ARG (tmp_data), + a_nr, pipvt, info)); for (F77_INT i = 0; i < mn; i++) pipvt[i] -= 1; @@ -635,8 +639,10 @@ { ComplexColumnVector utmp = u.column (i); ComplexColumnVector vtmp = v.column (i); - F77_XFCN (zlu1up, ZLU1UP, (m, n, F77_DBLE_CMPLX_ARG (l.fortran_vec ()), - m, F77_DBLE_CMPLX_ARG (r.fortran_vec ()), k, + F77_XFCN (zlu1up, ZLU1UP, (m, n, + F77_DBLE_CMPLX_ARG (l.fortran_vec ()), + m, F77_DBLE_CMPLX_ARG (r.fortran_vec ()), + k, F77_DBLE_CMPLX_ARG (utmp.fortran_vec ()), F77_DBLE_CMPLX_ARG (vtmp.fortran_vec ()))); } @@ -671,13 +677,15 @@ m, F77_DBLE_CMPLX_ARG (r.fortran_vec ()), k, ipvt.fortran_vec (), F77_CONST_DBLE_CMPLX_ARG (utmp.data ()), - F77_CONST_DBLE_CMPLX_ARG (vtmp.data ()), F77_DBLE_CMPLX_ARG (w))); + F77_CONST_DBLE_CMPLX_ARG (vtmp.data ()), + F77_DBLE_CMPLX_ARG (w))); for (F77_INT i = 0; i < m; i++) ipvt(i) -= 1; // decrement } template <> void - lu::update_piv (const ComplexMatrix& u, const ComplexMatrix& v) + lu::update_piv (const ComplexMatrix& u, + const ComplexMatrix& v) { if (packed ()) unpack (); @@ -704,11 +712,14 @@ { ComplexColumnVector utmp = u.column (i); ComplexColumnVector vtmp = v.column (i); - F77_XFCN (zlup1up, ZLUP1UP, (m, n, F77_DBLE_CMPLX_ARG (l.fortran_vec ()), - m, F77_DBLE_CMPLX_ARG (r.fortran_vec ()), k, - ipvt.fortran_vec (), + F77_XFCN (zlup1up, ZLUP1UP, (m, n, + F77_DBLE_CMPLX_ARG (l.fortran_vec ()), + m, + F77_DBLE_CMPLX_ARG (r.fortran_vec ()), + k, ipvt.fortran_vec (), F77_CONST_DBLE_CMPLX_ARG (utmp.data ()), - F77_CONST_DBLE_CMPLX_ARG (vtmp.data ()), F77_DBLE_CMPLX_ARG (w))); + F77_CONST_DBLE_CMPLX_ARG (vtmp.data ()), + F77_DBLE_CMPLX_ARG (w))); } for (F77_INT i = 0; i < m; i++) ipvt(i) -= 1; // decrement } @@ -730,8 +741,8 @@ F77_INT info = 0; - F77_XFCN (cgetrf, CGETRF, (a_nr, a_nc, F77_CMPLX_ARG (tmp_data), a_nr, pipvt, - info)); + F77_XFCN (cgetrf, CGETRF, (a_nr, a_nc, F77_CMPLX_ARG (tmp_data), a_nr, + pipvt, info)); for (F77_INT i = 0; i < mn; i++) pipvt[i] -= 1; @@ -764,7 +775,8 @@ FloatComplexColumnVector vtmp = v; F77_XFCN (clu1up, CLU1UP, (m, n, F77_CMPLX_ARG (l.fortran_vec ()), m, F77_CMPLX_ARG (r.fortran_vec ()), k, - F77_CMPLX_ARG (utmp.fortran_vec ()), F77_CMPLX_ARG (vtmp.fortran_vec ()))); + F77_CMPLX_ARG (utmp.fortran_vec ()), + F77_CMPLX_ARG (vtmp.fortran_vec ()))); } template <> @@ -797,7 +809,8 @@ FloatComplexColumnVector vtmp = v.column (i); F77_XFCN (clu1up, CLU1UP, (m, n, F77_CMPLX_ARG (l.fortran_vec ()), m, F77_CMPLX_ARG (r.fortran_vec ()), k, - F77_CMPLX_ARG (utmp.fortran_vec ()), F77_CMPLX_ARG (vtmp.fortran_vec ()))); + F77_CMPLX_ARG (utmp.fortran_vec ()), + F77_CMPLX_ARG (vtmp.fortran_vec ()))); } } @@ -829,7 +842,8 @@ F77_XFCN (clup1up, CLUP1UP, (m, n, F77_CMPLX_ARG (l.fortran_vec ()), m, F77_CMPLX_ARG (r.fortran_vec ()), k, ipvt.fortran_vec (), - F77_CONST_CMPLX_ARG (utmp.data ()), F77_CONST_CMPLX_ARG (vtmp.data ()), + F77_CONST_CMPLX_ARG (utmp.data ()), + F77_CONST_CMPLX_ARG (vtmp.data ()), F77_CMPLX_ARG (w))); for (F77_INT i = 0; i < m; i++) ipvt(i) -= 1; // decrement } @@ -867,7 +881,8 @@ F77_XFCN (clup1up, CLUP1UP, (m, n, F77_CMPLX_ARG (l.fortran_vec ()), m, F77_CMPLX_ARG (r.fortran_vec ()), k, ipvt.fortran_vec (), - F77_CONST_CMPLX_ARG (utmp.data ()), F77_CONST_CMPLX_ARG (vtmp.data ()), + F77_CONST_CMPLX_ARG (utmp.data ()), + F77_CONST_CMPLX_ARG (vtmp.data ()), F77_CMPLX_ARG (w))); } for (F77_INT i = 0; i < m; i++) ipvt(i) -= 1; // decrement diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/lu.h --- a/liboctave/numeric/lu.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/lu.h Tue May 09 08:46:07 2017 -0700 @@ -26,7 +26,10 @@ #include "octave-config.h" -#include "PermMatrix.h" +#include "Array.h" + +class ColumnVector; +class PermMatrix; namespace octave { @@ -91,15 +94,15 @@ protected: - // The result of getp is passed to other Octave Matrix - // fucntions, so we use octave_idx_type. + // The result of getp is passed to other Octave Matrix functions, + // so we use octave_idx_type. Array getp (void) const; T a_fact; T l_fact; - // This is internal storage that is passed to Fortran, so we - // need a Fortran INTEGER. + // This is internal storage that is passed to Fortran, + // so we need a Fortran INTEGER. Array ipvt; }; } diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/oct-convn.cc --- a/liboctave/numeric/oct-convn.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/oct-convn.cc Tue May 09 08:46:07 2017 -0700 @@ -24,13 +24,12 @@ # include "config.h" #endif -#include #include +#include "Array.h" +#include "MArray.h" #include "f77-fcn.h" - #include "oct-convn.h" -#include "oct-locbuf.h" // 2d convolution with a matrix kernel. template diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/oct-convn.h --- a/liboctave/numeric/oct-convn.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/oct-convn.h Tue May 09 08:46:07 2017 -0700 @@ -26,25 +26,22 @@ #include "octave-config.h" +#include "CColVector.h" +#include "CMatrix.h" +#include "CNDArray.h" +#include "CRowVector.h" +#include "dColVector.h" #include "dMatrix.h" -#include "fMatrix.h" -#include "CMatrix.h" +#include "dNDArray.h" +#include "dRowVector.h" +#include "fCColVector.h" #include "fCMatrix.h" - -#include "dNDArray.h" -#include "fNDArray.h" -#include "CNDArray.h" #include "fCNDArray.h" - -#include "dRowVector.h" +#include "fCRowVector.h" +#include "fColVector.h" +#include "fMatrix.h" +#include "fNDArray.h" #include "fRowVector.h" -#include "CRowVector.h" -#include "fCRowVector.h" - -#include "dColVector.h" -#include "fColVector.h" -#include "CColVector.h" -#include "fCColVector.h" enum convn_type { diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/oct-fftw.cc --- a/liboctave/numeric/oct-fftw.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/oct-fftw.cc Tue May 09 08:46:07 2017 -0700 @@ -24,18 +24,14 @@ # include "config.h" #endif -#include -#include -#include - #if defined (HAVE_FFTW3_H) # include #endif #include "lo-error.h" #include "oct-fftw.h" +#include "oct-locbuf.h" #include "quit.h" -#include "oct-locbuf.h" #include "singleton-cleanup.h" #if defined (HAVE_FFTW3_THREADS) || defined (HAVE_FFTW3F_THREADS) diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/oct-fftw.h --- a/liboctave/numeric/oct-fftw.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/oct-fftw.h Tue May 09 08:46:07 2017 -0700 @@ -27,8 +27,10 @@ #include +#include + +#include "dim-vector.h" #include "oct-cmplx.h" -#include "dim-vector.h" namespace octave { diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/oct-norm.cc --- a/liboctave/numeric/oct-norm.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/oct-norm.cc Tue May 09 08:46:07 2017 -0700 @@ -28,15 +28,16 @@ #include +#include #include #include -#include "Array-util.h" #include "Array.h" #include "CColVector.h" #include "CMatrix.h" #include "CRowVector.h" #include "CSparse.h" +#include "MArray.h" #include "dColVector.h" #include "dDiagMatrix.h" #include "dMatrix.h" @@ -51,11 +52,13 @@ #include "fRowVector.h" #include "lo-error.h" #include "lo-ieee.h" +#include "lo-mappers.h" #include "mx-cm-s.h" #include "mx-fcm-fs.h" #include "mx-fs-fcm.h" #include "mx-s-cm.h" #include "oct-cmplx.h" +#include "quit.h" #include "svd.h" // Theory: norm accumulator is an object that has an accum method able diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/oct-rand.cc --- a/liboctave/numeric/oct-rand.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/oct-rand.cc Tue May 09 08:46:07 2017 -0700 @@ -24,13 +24,11 @@ # include "config.h" #endif +#include #include -#include -#include +#include -#include "data-conv.h" -#include "f77-fcn.h" #include "lo-error.h" #include "lo-ieee.h" #include "lo-mappers.h" @@ -39,6 +37,7 @@ #include "oct-locbuf.h" #include "oct-rand.h" #include "oct-time.h" +#include "quit.h" #include "randgamma.h" #include "randmtzig.h" #include "randpoisson.h" diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/oct-rand.h --- a/liboctave/numeric/oct-rand.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/oct-rand.h Tue May 09 08:46:07 2017 -0700 @@ -28,11 +28,14 @@ #include #include +#include "Array.h" #include "dColVector.h" #include "dNDArray.h" #include "fNDArray.h" #include "lo-ieee.h" +//class dim_vector; + class OCTAVE_API octave_rand diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/oct-spparms.cc --- a/liboctave/numeric/oct-spparms.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/oct-spparms.cc Tue May 09 08:46:07 2017 -0700 @@ -25,9 +25,11 @@ # include "config.h" #endif +#include + +#include "dNDArray.h" #include "lo-error.h" #include "lo-ieee.h" - #include "oct-spparms.h" #include "singleton-cleanup.h" diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/oct-spparms.h --- a/liboctave/numeric/oct-spparms.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/oct-spparms.h Tue May 09 08:46:07 2017 -0700 @@ -26,14 +26,13 @@ #include "octave-config.h" -#include -#include - #include +#include #include "str-vec.h" #include "dColVector.h" -#include "dNDArray.h" + +class NDArray; #define OCTAVE_SPARSE_CONTROLS_SIZE 13 diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/qr.cc --- a/liboctave/numeric/qr.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/qr.cc Tue May 09 08:46:07 2017 -0700 @@ -26,24 +26,27 @@ # include "config.h" #endif +#include + +#include "Array.h" #include "CColVector.h" #include "CMatrix.h" #include "CRowVector.h" #include "dColVector.h" #include "dMatrix.h" #include "dRowVector.h" -#include "f77-fcn.h" #include "fCColVector.h" #include "fCMatrix.h" #include "fCRowVector.h" #include "fColVector.h" #include "fMatrix.h" #include "fRowVector.h" -#include "idx-vector.h" #include "lo-error.h" #include "lo-lapack-proto.h" #include "lo-qrupdate-proto.h" +#include "oct-cmplx.h" #include "oct-locbuf.h" +#include "oct-sort.h" #include "qr.h" namespace octave diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/qr.h --- a/liboctave/numeric/qr.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/qr.h Tue May 09 08:46:07 2017 -0700 @@ -27,7 +27,7 @@ #include "octave-config.h" -#include "Array.h" +template class Array; namespace octave { diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/qrp.cc --- a/liboctave/numeric/qrp.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/qrp.cc Tue May 09 08:46:07 2017 -0700 @@ -27,13 +27,16 @@ #include +#include + +#include "Array.h" #include "CMatrix.h" +#include "MArray.h" #include "dMatrix.h" #include "dRowVector.h" #include "fCMatrix.h" #include "fMatrix.h" #include "fRowVector.h" -#include "lo-error.h" #include "lo-lapack-proto.h" #include "oct-locbuf.h" #include "qrp.h" diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/randgamma.cc --- a/liboctave/numeric/randgamma.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/randgamma.cc Tue May 09 08:46:07 2017 -0700 @@ -83,8 +83,8 @@ #include "lo-ieee.h" #include "lo-math.h" +#include "randgamma.h" #include "randmtzig.h" -#include "randgamma.h" #define INFINITE lo_ieee_isinf #define RUNI oct_randu() diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/randpoisson.cc --- a/liboctave/numeric/randpoisson.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/randpoisson.cc Tue May 09 08:46:07 2017 -0700 @@ -35,11 +35,12 @@ # include "config.h" #endif +#include + #include "f77-fcn.h" #include "lo-error.h" #include "lo-ieee.h" #include "lo-math.h" -#include "lo-slatec-proto.h" #include "randmtzig.h" #include "randpoisson.h" @@ -100,7 +101,8 @@ { r = 1.0 / k; rr = r * r; - return ((k + 0.5)*std::log (k) - k + C0 + r*(C1 + rr*(C3 + rr*(C5 + rr*C7)))); + return ((k + 0.5)*std::log (k) - k + C0 + + r*(C1 + rr*(C3 + rr*(C5 + rr*C7)))); } else return (logfak[static_cast (k)]); diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/schur.cc --- a/liboctave/numeric/schur.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/schur.cc Tue May 09 08:46:07 2017 -0700 @@ -24,12 +24,14 @@ # include "config.h" #endif +#include "Array.h" #include "CMatrix.h" #include "dMatrix.h" #include "fCMatrix.h" #include "fMatrix.h" #include "lo-error.h" #include "lo-lapack-proto.h" +#include "oct-locbuf.h" #include "schur.h" namespace octave diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/schur.h --- a/liboctave/numeric/schur.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/schur.h Tue May 09 08:46:07 2017 -0700 @@ -27,17 +27,17 @@ #include -#include "dMatrix.h" +// FIXME: Don't really need these for compiling schur.h, but it messes +// up compilation in liboctave/array if these are not present. #include "CMatrix.h" +#include "dMatrix.h" +#include "fCMatrix.h" #include "fMatrix.h" -#include "fCMatrix.h" namespace octave { namespace math { - template class schur; - template class schur @@ -65,7 +65,6 @@ schur (const T& s, const T& u) : schur_mat (s), unitary_mat (u) { } schur (const schur& a) - : schur_mat (a.schur_mat), unitary_mat (a.unitary_mat) { } diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/sparse-chol.cc --- a/liboctave/numeric/sparse-chol.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/sparse-chol.cc Tue May 09 08:46:07 2017 -0700 @@ -26,13 +26,20 @@ # include "config.h" #endif -#include "sparse-chol.h" -#include "sparse-util.h" +#include + +#include "CSparse.h" +#include "MatrixType.h" +#include "dRowVector.h" +#include "dSparse.h" #include "lo-error.h" +#include "oct-cmplx.h" +#include "oct-refcount.h" #include "oct-sparse.h" #include "oct-spparms.h" #include "quit.h" -#include "MatrixType.h" +#include "sparse-chol.h" +#include "sparse-util.h" namespace octave { @@ -212,7 +219,8 @@ octave_idx_type a_nc = a.cols (); if (a_nr != a_nc) - (*current_liboctave_error_handler) ("sparse_chol requires square matrix"); + (*current_liboctave_error_handler) + ("sparse_chol requires square matrix"); cholmod_common *cm = &Common; @@ -231,12 +239,15 @@ else { cm->print = static_cast (spu) + 2; - SUITESPARSE_ASSIGN_FPTR (printf_func, cm->print_function, &SparseCholPrint); + SUITESPARSE_ASSIGN_FPTR (printf_func, cm->print_function, + &SparseCholPrint); } cm->error_handler = &SparseCholError; - SUITESPARSE_ASSIGN_FPTR2 (divcomplex_func, cm->complex_divide, divcomplex); + SUITESPARSE_ASSIGN_FPTR2 (divcomplex_func, cm->complex_divide, + divcomplex); + SUITESPARSE_ASSIGN_FPTR2 (hypot_func, cm->hypotenuse, hypot); cm->final_asis = false; @@ -310,7 +321,8 @@ Lsparse->p, &n1, cm); BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; CHOLMOD_NAME(reallocate_sparse) - (static_cast(Lsparse->p)[minor_p], Lsparse, cm); + (static_cast(Lsparse->p)[minor_p], + Lsparse, cm); END_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; Lsparse->ncol = minor_p; @@ -390,21 +402,24 @@ { } template - sparse_chol::sparse_chol (const chol_type& a, octave_idx_type& info, + sparse_chol::sparse_chol (const chol_type& a, + octave_idx_type& info, bool natural, bool force) : rep (new typename sparse_chol::sparse_chol_rep (a, info, natural, force)) { } template - sparse_chol::sparse_chol (const chol_type& a, octave_idx_type& info, + sparse_chol::sparse_chol (const chol_type& a, + octave_idx_type& info, bool natural) : rep (new typename sparse_chol::sparse_chol_rep (a, info, natural, false)) { } template - sparse_chol::sparse_chol (const chol_type& a, octave_idx_type& info) + sparse_chol::sparse_chol (const chol_type& a, + octave_idx_type& info) : rep (new typename sparse_chol::sparse_chol_rep (a, info, false, false)) { } diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/sparse-chol.h --- a/liboctave/numeric/sparse-chol.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/sparse-chol.h Tue May 09 08:46:07 2017 -0700 @@ -27,9 +27,9 @@ #include "octave-config.h" -#include "CSparse.h" -#include "dRowVector.h" -#include "dSparse.h" +class RowVector; +class SparseMatrix; +class SparseComplexMatrix; namespace octave { diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/sparse-dmsolve.cc --- a/liboctave/numeric/sparse-dmsolve.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/sparse-dmsolve.cc Tue May 09 08:46:07 2017 -0700 @@ -25,15 +25,20 @@ # include "config.h" #endif -#include +#include +#include "CMatrix.h" +#include "CSparse.h" #include "MArray.h" #include "MSparse.h" #include "MatrixType.h" +#include "dSparse.h" +#include "lo-error.h" #include "oct-inttypes.h" #include "oct-locbuf.h" #include "oct-sort.h" #include "oct-sparse.h" +#include "quit.h" #include "sparse-dmsolve.h" #include "sparse-qr.h" @@ -389,9 +394,11 @@ csm.nzmax = a.nnz (); // Cast away const on A, with full knowledge that CSparse won't touch it. - // Prevents the methods below making a copy of the data. - csm.p = const_cast(octave::to_suitesparse_intptr (a.cidx ())); - csm.i = const_cast(octave::to_suitesparse_intptr (a.ridx ())); + // Prevents the methods below from making a copy of the data. + csm.p = const_cast + (octave::to_suitesparse_intptr (a.cidx ())); + csm.i = const_cast + (octave::to_suitesparse_intptr (a.ridx ())); CXSPARSE_DNAME (d) *dm = CXSPARSE_DNAME(_dmperm) (&csm, 0); octave_idx_type *p = octave::to_octave_idx_type_ptr (dm->p); @@ -414,8 +421,10 @@ ST m = dmsolve_extract (a, pinv, q, dm->rr[2], nr, dm->cc[3], nc, nnz_remaining, true); nnz_remaining -= m.nnz (); - RT mtmp = octave::math::qrsolve (m, dmsolve_extract (btmp, 0, 0, dm->rr[2], - b_nr, 0, b_nc), info); + RT mtmp = octave::math::qrsolve (m, dmsolve_extract (btmp, 0, 0, + dm->rr[2], b_nr, + 0, b_nc), + info); dmsolve_insert (retval, mtmp, q, dm->cc[3], 0); if (dm->rr[2] > 0 && ! info) @@ -463,8 +472,10 @@ { ST m = dmsolve_extract (a, pinv, q, 0, dm->rr[1], 0, dm->cc[2], nnz_remaining, true); - RT mtmp = octave::math::qrsolve (m, dmsolve_extract (btmp, 0, 0, 0, dm->rr[1], - 0, b_nc), info); + RT mtmp = octave::math::qrsolve (m, dmsolve_extract (btmp, 0, 0, 0, + dm->rr[1], 0, + b_nc), + info); dmsolve_insert (retval, mtmp, q, 0, 0); } diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/sparse-lu.cc --- a/liboctave/numeric/sparse-lu.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/sparse-lu.cc Tue May 09 08:46:07 2017 -0700 @@ -30,6 +30,7 @@ #include "PermMatrix.h" #include "dSparse.h" #include "lo-error.h" +#include "lo-mappers.h" #include "oct-locbuf.h" #include "oct-sparse.h" #include "oct-spparms.h" diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/sparse-lu.h --- a/liboctave/numeric/sparse-lu.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/sparse-lu.h Tue May 09 08:46:07 2017 -0700 @@ -28,8 +28,12 @@ #include "octave-config.h" #include "MArray.h" +#include "dMatrix.h" #include "dSparse.h" +class ColumnVector; +class PermMatrix; + namespace octave { namespace math diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/sparse-qr.cc --- a/liboctave/numeric/sparse-qr.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/sparse-qr.cc Tue May 09 08:46:07 2017 -0700 @@ -25,9 +25,17 @@ # include "config.h" #endif +#include "CMatrix.h" +#include "CSparse.h" +#include "MArray.h" +#include "dColVector.h" +#include "dMatrix.h" +#include "dSparse.h" #include "lo-error.h" #include "oct-locbuf.h" +#include "oct-refcount.h" #include "oct-sparse.h" +#include "quit.h" #include "sparse-qr.h" namespace octave @@ -184,9 +192,11 @@ A.n = ncols; // Cast away const on A, with full knowledge that CSparse won't touch it // Prevents the methods below making a copy of the data. - A.p = const_cast(to_suitesparse_intptr (a.cidx ())); - A.i = const_cast(to_suitesparse_intptr (a.ridx ())); - A.x = const_cast(a.data ()); + A.p = const_cast + (to_suitesparse_intptr (a.cidx ())); + A.i = const_cast + (to_suitesparse_intptr (a.ridx ())); + A.x = const_cast (a.data ()); A.nz = -1; BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; @@ -326,7 +336,9 @@ { OCTAVE_LOCAL_BUFFER (double, buf, S->m2); - for (volatile octave_idx_type j = 0, idx = 0; j < b_nc; j++, idx+=b_nr) + for (volatile octave_idx_type j = 0, idx = 0; + j < b_nc; + j++, idx += b_nr) { octave_quit (); @@ -950,10 +962,12 @@ A.n = ncols; // Cast away const on A, with full knowledge that CSparse won't touch it // Prevents the methods below making a copy of the data. - A.p = const_cast(to_suitesparse_intptr (a.cidx ())); - A.i = const_cast(to_suitesparse_intptr (a.ridx ())); - A.x = const_cast ( - reinterpret_cast (a.data ())); + A.p = const_cast + (to_suitesparse_intptr (a.cidx ())); + A.i = const_cast + (to_suitesparse_intptr (a.ridx ())); + A.x = const_cast + (reinterpret_cast (a.data ())); A.nz = -1; BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; @@ -1075,7 +1089,8 @@ octave_idx_type b_nc = b.cols (); octave_idx_type nc = N->L->n; octave_idx_type nr = nrows; - const cs_complex_t *bvec = reinterpret_cast (b.fortran_vec ()); + const cs_complex_t *bvec + = reinterpret_cast (b.fortran_vec ()); ComplexMatrix ret (b_nr, b_nc); Complex *vec = ret.fortran_vec (); diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/sparse-qr.h --- a/liboctave/numeric/sparse-qr.h Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/sparse-qr.h Tue May 09 08:46:07 2017 -0700 @@ -26,10 +26,12 @@ #include "octave-config.h" -#include "dMatrix.h" -#include "CMatrix.h" -#include "dSparse.h" -#include "CSparse.h" +class Matrix; +class ComplexMatrix; +class SparseComplexMatrix; +class SparseMatrix; +class ColumnVector; +template class MArray; namespace octave { diff -r 70edb5512c6e -r d691ed308237 liboctave/numeric/svd.cc --- a/liboctave/numeric/svd.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/numeric/svd.cc Tue May 09 08:46:07 2017 -0700 @@ -25,20 +25,19 @@ # include "config.h" #endif -#include "svd.h" +#include -#include #include #include "CMatrix.h" #include "dDiagMatrix.h" -#include "fDiagMatrix.h" #include "dMatrix.h" #include "fCMatrix.h" +#include "fDiagMatrix.h" #include "fMatrix.h" #include "lo-error.h" #include "lo-lapack-proto.h" -#include "oct-locbuf.h" +#include "svd.h" namespace octave { @@ -66,7 +65,6 @@ return right_sm; } - // GESVD specializations #define GESVD_REAL_STEP(f, F) \ @@ -164,7 +162,6 @@ #undef GESVD_REAL_STEP #undef GESVD_COMPLEX_STEP - // GESDD specializations #define GESDD_REAL_STEP(f, F) \ @@ -274,7 +271,6 @@ #undef GESDD_REAL_STEP #undef GESDD_COMPLEX_STEP - template svd::svd (const T& a, svd::Type type, svd::Driver driver) @@ -335,11 +331,10 @@ case svd::Type::sigma_only: - // Note: for this case, both jobu and jobv should be 'N', but - // there seems to be a bug in dgesvd from Lapack V2.0. To - // demonstrate the bug, set both jobu and jobv to 'N' and find - // the singular values of [eye(3), eye(3)]. The result is - // [-sqrt(2), -sqrt(2), -sqrt(2)]. + // Note: for this case, both jobu and jobv should be 'N', but there + // seems to be a bug in dgesvd from Lapack V2.0. To demonstrate the + // bug, set both jobu and jobv to 'N' and find the singular values of + // [eye(3), eye(3)]. The result is [-sqrt(2), -sqrt(2), -sqrt(2)]. // // For Lapack 3.0, this problem seems to be fixed. diff -r 70edb5512c6e -r d691ed308237 liboctave/operators/mx-inlines.cc --- a/liboctave/operators/mx-inlines.cc Mon May 08 20:58:14 2017 -0700 +++ b/liboctave/operators/mx-inlines.cc Tue May 09 08:46:07 2017 -0700 @@ -25,24 +25,20 @@ #if ! defined (octave_mx_inlines_h) #define octave_mx_inlines_h 1 -// This file should not include config.h. It is only included in other -// C++ source files that should have included config.h before including -// this file. +// This file should *not* include config.h. It is only included in other C++ +// source files that should have included config.h before including this file. #include #include -#include -#include + +#include -#include "quit.h" - +#include "Array-util.h" +#include "Array.h" +#include "bsxfun.h" #include "oct-cmplx.h" +#include "oct-inttypes.h" #include "oct-locbuf.h" -#include "oct-inttypes.h" -#include "Array.h" -#include "Array-util.h" - -#include "bsxfun.h" // Provides some commonly repeated, basic loop templates.