Mercurial > octave
changeset 30508:6f07492c9c20 stable
Provide header file with forward declarations of matrix types (bug #59820).
* liboctave/array/mx-fwd.h: New file.
* liboctave/array/module.mk: Add new file to build system.
* other files in liboctave: Include mx-fwd.h instead of forward declaring matrix
types.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Mon, 06 Dec 2021 19:27:28 +0100 |
parents | f79deeded5d3 |
children | 6ffa6dbbf42a 84344af9b019 |
files | liboctave/array/CSparse.h liboctave/array/MatrixType.h liboctave/array/Sparse.h liboctave/array/boolSparse.h liboctave/array/dSparse.h liboctave/array/intNDArray.h liboctave/array/module.mk liboctave/array/mx-fwd.h liboctave/numeric/DAEFunc.h liboctave/numeric/DASPK.h liboctave/numeric/DASSL.h liboctave/numeric/EIG.h liboctave/numeric/ODEFunc.h liboctave/numeric/ODESFunc.h liboctave/numeric/eigs-base.h liboctave/numeric/fEIG.h liboctave/numeric/lo-specfun.h liboctave/numeric/lu.h liboctave/numeric/oct-convn.h liboctave/numeric/oct-norm.h liboctave/numeric/sparse-chol.h liboctave/numeric/sparse-lu.h liboctave/numeric/sparse-qr.h liboctave/operators/Sparse-op-decls.h liboctave/operators/mx-defs.h liboctave/operators/mx-op-decl.h |
diffstat | 26 files changed, 103 insertions(+), 142 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/array/CSparse.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/array/CSparse.h Mon Dec 06 19:27:28 2021 +0100 @@ -39,12 +39,7 @@ #include "dMatrix.h" #include "dNDArray.h" #include "oct-cmplx.h" - -class PermMatrix; -class DiagMatrix; -class ComplexDiagMatrix; -class SparseMatrix; -class SparseBoolMatrix; +#include "mx-fwd.h" class OCTAVE_API
--- a/liboctave/array/MatrixType.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/array/MatrixType.h Mon Dec 06 19:27:28 2021 +0100 @@ -28,14 +28,9 @@ #include "octave-config.h" -#include "MSparse.h" +#include "mx-fwd.h" -class Matrix; -class ComplexMatrix; -class FloatMatrix; -class FloatComplexMatrix; -class SparseMatrix; -class SparseComplexMatrix; +#include "MSparse.h" class MatrixType
--- a/liboctave/array/Sparse.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/array/Sparse.h Mon Dec 06 19:27:28 2021 +0100 @@ -37,8 +37,7 @@ #include "Array-fwd.h" #include "Sparse-fwd.h" - -class PermMatrix; +#include "mx-fwd.h" // Two dimensional sparse class. Handles the reference counting for // all the derived classes.
--- a/liboctave/array/boolSparse.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/array/boolSparse.h Mon Dec 06 19:27:28 2021 +0100 @@ -33,8 +33,7 @@ #include "Sparse.h" #include "boolMatrix.h" #include "boolNDArray.h" - -class SparseMatrix; +#include "mx-fwd.h" class OCTAVE_API
--- a/liboctave/array/dSparse.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/array/dSparse.h Mon Dec 06 19:27:28 2021 +0100 @@ -28,6 +28,8 @@ #include "octave-config.h" +#include "mx-fwd.h" + #include "CColVector.h" #include "CMatrix.h" #include "DET.h" @@ -38,11 +40,6 @@ #include "dMatrix.h" #include "dNDArray.h" -class PermMatrix; -class DiagMatrix; -class SparseComplexMatrix; -class SparseBoolMatrix; - class SparseMatrix : public MSparse<double> {
--- a/liboctave/array/intNDArray.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/array/intNDArray.h Mon Dec 06 19:27:28 2021 +0100 @@ -29,11 +29,10 @@ #include "octave-config.h" #include "intNDArray-fwd.h" +#include "mx-fwd.h" #include "MArray.h" #include "boolNDArray.h" -class NDArray; - template <typename T> class intNDArray : public MArray<T>
--- a/liboctave/array/module.mk Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/array/module.mk Mon Dec 06 19:27:28 2021 +0100 @@ -48,6 +48,7 @@ %reldir%/int8NDArray.h \ %reldir%/intNDArray-fwd.h \ %reldir%/intNDArray.h \ + %reldir%/mx-fwd.h \ %reldir%/range-fwd.h \ %reldir%/uint16NDArray.h \ %reldir%/uint32NDArray.h \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/liboctave/array/mx-fwd.h Mon Dec 06 19:27:28 2021 +0100 @@ -0,0 +1,66 @@ +//////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2021 The Octave Project Developers +// +// See the file COPYRIGHT.md in the top-level directory of this +// distribution or <https://octave.org/copyright/>. +// +// This file is part of Octave. +// +// Octave is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Octave is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Octave; see the file COPYING. If not, see +// <https://www.gnu.org/licenses/>. +// +//////////////////////////////////////////////////////////////////////// + +#if ! defined (octave_mx_fwd_h) +#define octave_mx_fwd_h 1 + +#include "octave-config.h" + +class OCTAVE_API Matrix; +class OCTAVE_API ComplexMatrix; +class OCTAVE_API FloatMatrix; +class OCTAVE_API FloatComplexMatrix; +class OCTAVE_API boolMatrix; +class OCTAVE_API charMatrix; + +class OCTAVE_API NDArray; +class OCTAVE_API ComplexNDArray; +class OCTAVE_API FloatNDArray; +class OCTAVE_API FloatComplexNDArray; +class OCTAVE_API boolNDArray; +class OCTAVE_API charNDArray; + +class OCTAVE_API ColumnVector; +class OCTAVE_API ComplexColumnVector; +class OCTAVE_API FloatColumnVector; +class OCTAVE_API FloatComplexColumnVector; + +class OCTAVE_API RowVector; +class OCTAVE_API ComplexRowVector; +class OCTAVE_API FloatRowVector; +class OCTAVE_API FloatComplexRowVector; + +class OCTAVE_API SparseMatrix; +class OCTAVE_API SparseComplexMatrix; +class OCTAVE_API SparseBoolMatrix; + +class OCTAVE_API DiagMatrix; +class OCTAVE_API ComplexDiagMatrix; +class OCTAVE_API FloatDiagMatrix; +class OCTAVE_API FloatComplexDiagMatrix; + +class OCTAVE_API PermMatrix; + +#endif
--- a/liboctave/numeric/DAEFunc.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/numeric/DAEFunc.h Mon Dec 06 19:27:28 2021 +0100 @@ -28,8 +28,7 @@ #include "octave-config.h" -class Matrix; -class ColumnVector; +#include "mx-fwd.h" class DAEFunc
--- a/liboctave/numeric/DASPK.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/numeric/DASPK.h Mon Dec 06 19:27:28 2021 +0100 @@ -33,7 +33,7 @@ #include "Array.h" #include "DASPK-opts.h" -class Matrix; +#include "mx-fwd.h" class OCTAVE_API
--- a/liboctave/numeric/DASSL.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/numeric/DASSL.h Mon Dec 06 19:27:28 2021 +0100 @@ -30,11 +30,11 @@ #include <string> +#include "mx-fwd.h" + #include "Array.h" #include "DASSL-opts.h" -class Matrix; - class OCTAVE_API DASSL : public DAE, public DASSL_options
--- a/liboctave/numeric/EIG.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/numeric/EIG.h Mon Dec 06 19:27:28 2021 +0100 @@ -30,11 +30,11 @@ #include <iosfwd> +#include "mx-fwd.h" + #include "CColVector.h" #include "CMatrix.h" -class Matrix; - class OCTAVE_API EIG
--- a/liboctave/numeric/ODEFunc.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/numeric/ODEFunc.h Mon Dec 06 19:27:28 2021 +0100 @@ -28,8 +28,7 @@ #include "octave-config.h" -class Matrix; -class ColumnVector; +#include "mx-fwd.h" class ODEFunc
--- a/liboctave/numeric/ODESFunc.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/numeric/ODESFunc.h Mon Dec 06 19:27:28 2021 +0100 @@ -28,9 +28,9 @@ #include "octave-config.h" -#include "dMatrix.h" +#include "mx-fwd.h" -class ColumnVector; +#include "dMatrix.h" class ODESFunc
--- a/liboctave/numeric/eigs-base.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/numeric/eigs-base.h Mon Dec 06 19:27:28 2021 +0100 @@ -32,13 +32,9 @@ #include <iosfwd> #include <string> +#include "mx-fwd.h" #include "oct-cmplx.h" -class ColumnVector; -class ComplexColumnVector; -class Matrix; -class ComplexMatrix; - typedef std::function<ColumnVector (const ColumnVector& x, int& eigs_error)> EigsFunc;
--- a/liboctave/numeric/fEIG.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/numeric/fEIG.h Mon Dec 06 19:27:28 2021 +0100 @@ -30,11 +30,11 @@ #include <iosfwd> +#include "mx-fwd.h" + #include "fCColVector.h" #include "fCMatrix.h" -class FloatMatrix; - class OCTAVE_API FloatEIG
--- a/liboctave/numeric/lo-specfun.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/numeric/lo-specfun.h Mon Dec 06 19:27:28 2021 +0100 @@ -28,22 +28,11 @@ #include "octave-config.h" +#include "mx-fwd.h" + #include "Array.h" #include "oct-cmplx.h" -class ComplexColumnVector; -class ComplexMatrix; -class ComplexNDArray; -class FloatComplexColumnVector; -class FloatComplexMatrix; -class FloatComplexNDArray; -class FloatMatrix; -class FloatNDArray; -class FloatRowVector; -class Matrix; -class NDArray; -class RowVector; - namespace octave { namespace math
--- a/liboctave/numeric/lu.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/numeric/lu.h Mon Dec 06 19:27:28 2021 +0100 @@ -28,10 +28,9 @@ #include "octave-config.h" -#include "Array.h" +#include "mx-fwd.h" -class ColumnVector; -class PermMatrix; +#include "Array.h" namespace octave {
--- a/liboctave/numeric/oct-convn.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/numeric/oct-convn.h Mon Dec 06 19:27:28 2021 +0100 @@ -28,25 +28,7 @@ #include "octave-config.h" -class ColumnVector; -class RowVector; -class Matrix; -class NDArray; - -class ComplexColumnVector; -class ComplexRowVector; -class ComplexMatrix; -class ComplexNDArray; - -class FloatColumnVector; -class FloatRowVector; -class FloatMatrix; -class FloatNDArray; - -class FloatComplexColumnVector; -class FloatComplexRowVector; -class FloatComplexMatrix; -class FloatComplexNDArray; +#include "mx-fwd.h" // The remaining includes can be removed when the global enum // declaration, the convert_enum function, and the deprecated functions
--- a/liboctave/numeric/oct-norm.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/numeric/oct-norm.h Mon Dec 06 19:27:28 2021 +0100 @@ -28,26 +28,9 @@ #include "octave-config.h" -#include "oct-cmplx.h" - -class ColumnVector; -class RowVector; -class Matrix; - -class FloatColumnVector; -class FloatRowVector; -class FloatMatrix; +#include "mx-fwd.h" -class ComplexColumnVector; -class ComplexRowVector; -class ComplexMatrix; - -class FloatComplexColumnVector; -class FloatComplexRowVector; -class FloatComplexMatrix; - -class SparseMatrix; -class SparseComplexMatrix; +#include "oct-cmplx.h" // The remaining includes can be removed when the deprecated functions // at the end of this file are removed.
--- a/liboctave/numeric/sparse-chol.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/numeric/sparse-chol.h Mon Dec 06 19:27:28 2021 +0100 @@ -30,11 +30,9 @@ #include <memory> -#include "CSparse.h" +#include "mx-fwd.h" -class RowVector; -class SparseMatrix; -class SparseComplexMatrix; +#include "CSparse.h" namespace octave {
--- a/liboctave/numeric/sparse-lu.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/numeric/sparse-lu.h Mon Dec 06 19:27:28 2021 +0100 @@ -28,13 +28,12 @@ #include "octave-config.h" +#include "mx-fwd.h" + #include "MArray.h" #include "dMatrix.h" #include "dSparse.h" -class ColumnVector; -class PermMatrix; - namespace octave { namespace math @@ -46,6 +45,7 @@ template <typename lu_type> class + OCTAVE_API sparse_lu { public:
--- a/liboctave/numeric/sparse-qr.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/numeric/sparse-qr.h Mon Dec 06 19:27:28 2021 +0100 @@ -32,12 +32,7 @@ #include "oct-cmplx.h" #include "MArray-fwd.h" - -class Matrix; -class ComplexMatrix; -class SparseMatrix; -class SparseComplexMatrix; -class ColumnVector; +#include "mx-fwd.h" namespace octave {
--- a/liboctave/operators/Sparse-op-decls.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/operators/Sparse-op-decls.h Mon Dec 06 19:27:28 2021 +0100 @@ -28,7 +28,7 @@ #include "octave-config.h" -class SparseBoolMatrix; +#include "mx-fwd.h" #define SPARSE_BIN_OP_DECL(R, OP, X, Y, API) \ extern API R OP (const X&, const Y&)
--- a/liboctave/operators/mx-defs.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/operators/mx-defs.h Mon Dec 06 19:27:28 2021 +0100 @@ -30,36 +30,7 @@ // Classes we declare. -class Matrix; -class ComplexMatrix; -class FloatMatrix; -class FloatComplexMatrix; -class boolMatrix; -class charMatrix; - -class NDArray; -class ComplexNDArray; -class FloatNDArray; -class FloatComplexNDArray; -class boolNDArray; -class charNDArray; - -class ColumnVector; -class ComplexColumnVector; -class FloatColumnVector; -class FloatComplexColumnVector; - -class RowVector; -class ComplexRowVector; -class FloatRowVector; -class FloatComplexRowVector; - -class DiagMatrix; -class ComplexDiagMatrix; -class FloatDiagMatrix; -class FloatComplexDiagMatrix; - -class PermMatrix; +#include "mx-fwd.h" template <typename T> class aepbalance;
--- a/liboctave/operators/mx-op-decl.h Fri Dec 17 21:30:46 2021 +0100 +++ b/liboctave/operators/mx-op-decl.h Mon Dec 06 19:27:28 2021 +0100 @@ -31,8 +31,7 @@ #define BIN_OP_DECL(R, OP, X, Y, API) \ extern API R OP (const X&, const Y&) -class boolMatrix; -class boolNDArray; +#include "mx-fwd.h" #define CMP_OP_DECL(OP, X, Y, API) \ extern API boolMatrix OP (const X&, const Y&)