Mercurial > hg > octave-lojdl
changeset 1881:950825cea083
[project @ 1996-02-05 18:07:21 by jwe]
author | jwe |
---|---|
date | Mon, 05 Feb 1996 18:07:21 +0000 |
parents | cbdbec67ad60 |
children | 1281a23a34dd |
files | liboctave/CmplxAEPBAL.h liboctave/CmplxCHOL.h liboctave/CmplxDET.h liboctave/CmplxHESS.h liboctave/CmplxLU.h liboctave/CmplxQR.h liboctave/CmplxQRP.h liboctave/CmplxSCHUR.h liboctave/CmplxSVD.h liboctave/dbleAEPBAL.h liboctave/dbleCHOL.h liboctave/dbleDET.h liboctave/dbleGEPBAL.h liboctave/dbleHESS.h liboctave/dbleLU.h liboctave/dbleQR.h liboctave/dbleQRP.h liboctave/dbleSCHUR.h liboctave/dbleSVD.h |
diffstat | 19 files changed, 203 insertions(+), 228 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/CmplxAEPBAL.h +++ b/liboctave/CmplxAEPBAL.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -34,13 +34,12 @@ #include "CMatrix.h" -class ComplexAEPBALANCE +class +ComplexAEPBALANCE { -friend class ComplexMatrix; - public: - ComplexAEPBALANCE (void) { } + ComplexAEPBALANCE (void) : balanced_mat (), balancing_mat () { } ComplexAEPBALANCE (const ComplexMatrix& a, const string& balance_job) { @@ -48,16 +47,15 @@ } ComplexAEPBALANCE (const ComplexAEPBALANCE& a) - { - balanced_mat = a.balanced_mat; - balancing_mat = a.balancing_mat; - } + : balanced_mat (a.balanced_mat), balancing_mat (a.balancing_mat) { } ComplexAEPBALANCE& operator = (const ComplexAEPBALANCE& a) { - balanced_mat = a.balanced_mat; - balancing_mat = a.balancing_mat; - + if (this != &a) + { + balanced_mat = a.balanced_mat; + balancing_mat = a.balancing_mat; + } return *this; } @@ -69,10 +67,10 @@ private: - int init (const ComplexMatrix& a, const string& balance_job); - ComplexMatrix balanced_mat; ComplexMatrix balancing_mat; + + int init (const ComplexMatrix& a, const string& balance_job); }; #endif
--- a/liboctave/CmplxCHOL.h +++ b/liboctave/CmplxCHOL.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -32,13 +32,12 @@ #include "CMatrix.h" -class ComplexCHOL +class +ComplexCHOL { -friend class ComplexMatrix; - public: - ComplexCHOL (void) { } + ComplexCHOL (void) : chol_mat () { } ComplexCHOL::ComplexCHOL (const ComplexMatrix& a) { init (a); } @@ -48,13 +47,12 @@ } ComplexCHOL::ComplexCHOL (const ComplexCHOL& a) - { - chol_mat = a.chol_mat; - } + : chol_mat (a.chol_mat) { } ComplexCHOL& ComplexCHOL::operator = (const ComplexCHOL& a) { - chol_mat = a.chol_mat; + if (this != &a) + chol_mat = a.chol_mat; return *this; } @@ -68,9 +66,9 @@ private: - int init (const ComplexMatrix& a); + ComplexMatrix chol_mat; - ComplexMatrix chol_mat; + int init (const ComplexMatrix& a); }; #endif
--- a/liboctave/CmplxDET.h +++ b/liboctave/CmplxDET.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -32,9 +32,10 @@ #include "oct-cmplx.h" -class ComplexDET +class +ComplexDET { - friend class ComplexMatrix; +friend class ComplexMatrix; public: @@ -48,9 +49,11 @@ ComplexDET& operator = (const ComplexDET& a) { - det[0] = a.det[0]; - det[1] = a.det[1]; - + if (this != &a) + { + det[0] = a.det[0]; + det[1] = a.det[1]; + } return *this; }
--- a/liboctave/CmplxHESS.h +++ b/liboctave/CmplxHESS.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -32,29 +32,27 @@ #include "CMatrix.h" -class ComplexHESS +class +ComplexHESS { -friend class ComplexMatrix; - public: - ComplexHESS (void) { } + ComplexHESS (void) : hess_mat (), unitary_hess_mat () { } ComplexHESS (const ComplexMatrix& a) { init (a); } ComplexHESS (const ComplexMatrix& a, int& info) { info = init (a); } ComplexHESS (const ComplexHESS& a) - { - hess_mat = a.hess_mat; - unitary_hess_mat = a.unitary_hess_mat; - } + : hess_mat (a.hess_mat), unitary_hess_mat (a.unitary_hess_mat) { } ComplexHESS& operator = (const ComplexHESS& a) { - hess_mat = a.hess_mat; - unitary_hess_mat = a.unitary_hess_mat; - + if (this != &a) + { + hess_mat = a.hess_mat; + unitary_hess_mat = a.unitary_hess_mat; + } return *this; } @@ -69,10 +67,10 @@ private: - int init (const ComplexMatrix& a); - ComplexMatrix hess_mat; ComplexMatrix unitary_hess_mat; + + int init (const ComplexMatrix& a); }; #endif
--- a/liboctave/CmplxLU.h +++ b/liboctave/CmplxLU.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -33,29 +33,25 @@ #include "dMatrix.h" #include "CMatrix.h" -class ComplexLU +class +ComplexLU { -friend class ComplexMatrix; - public: - ComplexLU (void) { } + ComplexLU (void) : l (), u (), p () { } ComplexLU (const ComplexMatrix& a); - ComplexLU (const ComplexLU& a) - { - l = a.l; - u = a.u; - p = a.p; - } + ComplexLU (const ComplexLU& a) : l (a.l), u (a.u), p (a.p) { } ComplexLU& operator = (const ComplexLU& a) { - l = a.l; - u = a.u; - p = a.p; - + if (this != &a) + { + l = a.l; + u = a.u; + p = a.p; + } return *this; }
--- a/liboctave/CmplxQR.h +++ b/liboctave/CmplxQR.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -33,25 +33,24 @@ #include "CMatrix.h" #include "dbleQR.h" -class ComplexQR +class +ComplexQR { public: - ComplexQR (void) { } + ComplexQR (void) : q (), r () { } ComplexQR (const ComplexMatrix& A, QR::type qr_type = QR::std); - ComplexQR (const ComplexQR& a) - { - q = a.q; - r = a.r; - } + ComplexQR (const ComplexQR& a) : q (a.q), r (a.r) { } ComplexQR& operator = (const ComplexQR& a) { - q = a.q; - r = a.r; - + if (this != &a) + { + q = a.q; + r = a.r; + } return *this; }
--- a/liboctave/CmplxQRP.h +++ b/liboctave/CmplxQRP.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -32,21 +32,24 @@ #include "CmplxQR.h" -class ComplexQRP : public ComplexQR +class +ComplexQRP : public ComplexQR { public: - ComplexQRP (void) { } + ComplexQRP (void) : ComplexQR (), p () { } ComplexQRP (const ComplexMatrix& A, QR::type qr_type = QR::std); - ComplexQRP (const ComplexQRP& a) : ComplexQR (a) { p = a.p; } + ComplexQRP (const ComplexQRP& a) : ComplexQR (a), p (a.p) { } ComplexQRP& operator = (const ComplexQRP& a) { - ComplexQR::operator = (a); - p = a.p; - + if (this != &a) + { + ComplexQR::operator = (a); + p = a.p; + } return *this; }
--- a/liboctave/CmplxSCHUR.h +++ b/liboctave/CmplxSCHUR.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -34,13 +34,12 @@ #include "CMatrix.h" -class ComplexSCHUR +class +ComplexSCHUR { -friend class ComplexMatrix; - public: - ComplexSCHUR (void) { } + ComplexSCHUR (void) : schur_mat (), unitary_mat () { } ComplexSCHUR (const ComplexMatrix& a, const string& ord) { @@ -53,37 +52,30 @@ } ComplexSCHUR (const ComplexSCHUR& a) - { - schur_mat = a.schur_mat; - unitary_mat = a.unitary_mat; - } + : schur_mat (a.schur_mat), unitary_mat (a.unitary_mat) { } ComplexSCHUR& operator = (const ComplexSCHUR& a) { - schur_mat = a.schur_mat; - unitary_mat = a.unitary_mat; - + if (this != &a) + { + schur_mat = a.schur_mat; + unitary_mat = a.unitary_mat; + } return *this; } - ComplexMatrix schur_matrix (void) const - { - return schur_mat; - } + ComplexMatrix schur_matrix (void) const { return schur_mat; } - ComplexMatrix unitary_matrix (void) const - { - return unitary_mat; - } + ComplexMatrix unitary_matrix (void) const { return unitary_mat; } friend ostream& operator << (ostream& os, const ComplexSCHUR& a); private: - int init (const ComplexMatrix& a, const string& ord); - ComplexMatrix schur_mat; ComplexMatrix unitary_mat; + + int init (const ComplexMatrix& a, const string& ord); }; #endif
--- a/liboctave/CmplxSVD.h +++ b/liboctave/CmplxSVD.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -34,15 +34,13 @@ #include "CMatrix.h" #include "dbleSVD.h" -class ComplexSVD +class +ComplexSVD { -friend class ComplexMatrix; - public: ComplexSVD (void) { } - ComplexSVD (const ComplexMatrix& a, SVD::type svd_type = SVD::std) { init (a, svd_type); @@ -55,18 +53,16 @@ } ComplexSVD (const ComplexSVD& a) - { - sigma = a.sigma; - left_sm = a.left_sm; - right_sm = a.right_sm; - } + : sigma (a.sigma), left_sm (a.left_sm), right_sm (a.right_sm) { } ComplexSVD& operator = (const ComplexSVD& a) { - sigma = a.sigma; - left_sm = a.left_sm; - right_sm = a.right_sm; - + if (this != &a) + { + sigma = a.sigma; + left_sm = a.left_sm; + right_sm = a.right_sm; + } return *this; } @@ -80,13 +76,13 @@ private: - int init (const ComplexMatrix& a, SVD::type svd_type = SVD::std); - SVD::type type_computed; DiagMatrix sigma; ComplexMatrix left_sm; ComplexMatrix right_sm; + + int init (const ComplexMatrix& a, SVD::type svd_type = SVD::std); }; #endif
--- a/liboctave/dbleAEPBAL.h +++ b/liboctave/dbleAEPBAL.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -34,13 +34,12 @@ #include "dMatrix.h" -class AEPBALANCE +class +AEPBALANCE { -friend class Matrix; - public: - AEPBALANCE (void) { } + AEPBALANCE (void) : balanced_mat (), balancing_mat () { } AEPBALANCE (const Matrix& a,const string& balance_job) { @@ -48,16 +47,15 @@ } AEPBALANCE (const AEPBALANCE& a) - { - balanced_mat = a.balanced_mat; - balancing_mat = a.balancing_mat; - } + : balanced_mat (a.balanced_mat), balancing_mat (a.balancing_mat) { } AEPBALANCE& operator = (const AEPBALANCE& a) { - balanced_mat = a.balanced_mat; - balancing_mat = a.balancing_mat; - + if (this != &a) + { + balanced_mat = a.balanced_mat; + balancing_mat = a.balancing_mat; + } return *this; } @@ -69,10 +67,10 @@ private: - int init (const Matrix& a, const string& balance_job); - Matrix balanced_mat; Matrix balancing_mat; + + int init (const Matrix& a, const string& balance_job); }; #endif
--- a/liboctave/dbleCHOL.h +++ b/liboctave/dbleCHOL.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -32,23 +32,23 @@ #include "dMatrix.h" -class CHOL +class +CHOL { -friend class Matrix; - public: - CHOL (void) { } + CHOL (void) : chol_mat () { } CHOL (const Matrix& a) { init (a); } CHOL (const Matrix& a, int& info) { info = init (a); } - CHOL (const CHOL& a) { chol_mat = a.chol_mat; } + CHOL (const CHOL& a) : chol_mat (a.chol_mat) { } CHOL& operator = (const CHOL& a) { - chol_mat = a.chol_mat; + if (this != &a) + chol_mat = a.chol_mat; return *this; } @@ -59,9 +59,9 @@ private: - int init (const Matrix& a); + Matrix chol_mat; - Matrix chol_mat; + int init (const Matrix& a); }; #endif
--- a/liboctave/dbleDET.h +++ b/liboctave/dbleDET.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -30,7 +30,8 @@ class ostream; -class DET +class +DET { friend class Matrix; @@ -46,9 +47,11 @@ DET& operator = (const DET& a) { - det[0] = a.det[0]; - det[1] = a.det[1]; - + if (this != &a) + { + det[0] = a.det[0]; + det[1] = a.det[1]; + } return *this; }
--- a/liboctave/dbleGEPBAL.h +++ b/liboctave/dbleGEPBAL.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -34,13 +34,14 @@ #include "dMatrix.h" -class GEPBALANCE +class +GEPBALANCE { -friend class Matrix; - public: - GEPBALANCE (void) { } + GEPBALANCE (void) + : balanced_a_mat (), balanced_b_mat (), left_balancing_mat (), + right_balancing_mat () { } GEPBALANCE (const Matrix& a, const Matrix& b, const string& balance_job) { @@ -48,20 +49,20 @@ } GEPBALANCE (const GEPBALANCE& a) - { - balanced_a_mat = a.balanced_a_mat; - balanced_b_mat = a.balanced_b_mat; - left_balancing_mat = a.left_balancing_mat; - right_balancing_mat = a.right_balancing_mat; - } + : balanced_a_mat (a.balanced_a_mat), + balanced_b_mat (a.balanced_b_mat), + left_balancing_mat (a.left_balancing_mat), + right_balancing_mat (a.right_balancing_mat) { } GEPBALANCE& operator = (const GEPBALANCE& a) { - balanced_a_mat = a.balanced_a_mat; - balanced_b_mat = a.balanced_b_mat; - left_balancing_mat = a.left_balancing_mat; - right_balancing_mat = a.right_balancing_mat; - + if (this != &a) + { + balanced_a_mat = a.balanced_a_mat; + balanced_b_mat = a.balanced_b_mat; + left_balancing_mat = a.left_balancing_mat; + right_balancing_mat = a.right_balancing_mat; + } return *this; } @@ -75,12 +76,12 @@ private: - int init (const Matrix& a, const Matrix& b, const string& balance_job); - Matrix balanced_a_mat; Matrix balanced_b_mat; Matrix left_balancing_mat; Matrix right_balancing_mat; + + int init (const Matrix& a, const Matrix& b, const string& balance_job); }; #endif
--- a/liboctave/dbleHESS.h +++ b/liboctave/dbleHESS.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -32,29 +32,27 @@ #include "dMatrix.h" -class HESS +class +HESS { -friend class Matrix; - public: - HESS (void) { } + HESS (void) : hess_mat (), unitary_hess_mat () { } HESS (const Matrix& a) { init (a); } HESS (const Matrix& a, int& info) { info = init (a); } HESS (const HESS& a) - { - hess_mat = a.hess_mat; - unitary_hess_mat = a.unitary_hess_mat; - } + : hess_mat (a.hess_mat), unitary_hess_mat (a.unitary_hess_mat) { } HESS& operator = (const HESS& a) { - hess_mat = a.hess_mat; - unitary_hess_mat = a.unitary_hess_mat; - + if (this != &a) + { + hess_mat = a.hess_mat; + unitary_hess_mat = a.unitary_hess_mat; + } return *this; } @@ -66,10 +64,10 @@ private: - int init (const Matrix& a); - Matrix hess_mat; Matrix unitary_hess_mat; + + int init (const Matrix& a); }; #endif
--- a/liboctave/dbleLU.h +++ b/liboctave/dbleLU.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -34,27 +34,22 @@ class LU { -friend class Matrix; - public: - LU (void) { } + LU (void) : l (), u (), p () { } LU (const Matrix& a); - LU (const LU& a) - { - l = a.l; - u = a.u; - p = a.p; - } + LU (const LU& a) : l (a.l), u (a.u), p (a.p) { } LU& operator = (const LU& a) { - l = a.l; - u = a.u; - p = a.p; - + if (this != &a) + { + l = a.l; + u = a.u; + p = a.p; + } return *this; }
--- a/liboctave/dbleQR.h +++ b/liboctave/dbleQR.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -32,7 +32,8 @@ #include "dMatrix.h" -class QR +class +QR { public: @@ -43,21 +44,19 @@ economy, }; - QR (void) { } + QR (void) : q (), r () { } QR (const Matrix& A, type qr_type = QR::std); - QR (const QR& a) - { - q = a.q; - r = a.r; - } + QR (const QR& a) : q (a.q), r (a.r) { } QR& operator = (const QR& a) { - q = a.q; - r = a.r; - + if (this != &a) + { + q = a.q; + r = a.r; + } return *this; }
--- a/liboctave/dbleQRP.h +++ b/liboctave/dbleQRP.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -32,20 +32,24 @@ #include "dbleQR.h" -class QRP : public QR +class +QRP : public QR { public: - QRP (void) { } + QRP (void) : QR (), p () { } QRP (const Matrix& A, QR::type qr_type = QR::std); - QRP (const QRP& a) : QR (a) { p = a.p; } + QRP (const QRP& a) : QR (a), p (a.p) { } QRP& operator = (const QRP& a) { - QR::operator = (a); - p = a.p; + if (this != &a) + { + QR::operator = (a); + p = a.p; + } return *this; }
--- a/liboctave/dbleSCHUR.h +++ b/liboctave/dbleSCHUR.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -34,13 +34,12 @@ #include "dMatrix.h" -class SCHUR +class +SCHUR { -friend class Matrix; - public: - SCHUR (void) { } + SCHUR (void) : schur_mat (), unitary_mat () { } SCHUR (const Matrix& a, const string& ord) { init (a, ord); } @@ -50,16 +49,15 @@ } SCHUR (const SCHUR& a) - { - schur_mat = a.schur_mat; - unitary_mat = a.unitary_mat; - } + : schur_mat (a.schur_mat), unitary_mat (a.unitary_mat) { } SCHUR& operator = (const SCHUR& a) { - schur_mat = a.schur_mat; - unitary_mat = a.unitary_mat; - + if (this != &a) + { + schur_mat = a.schur_mat; + unitary_mat = a.unitary_mat; + } return *this; } @@ -71,10 +69,10 @@ private: - int init (const Matrix& a, const string& ord); - Matrix schur_mat; Matrix unitary_mat; + + int init (const Matrix& a, const string& ord); }; #endif
--- a/liboctave/dbleSVD.h +++ b/liboctave/dbleSVD.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* -Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton +Copyright (C) 1996 John W. Eaton This file is part of Octave. @@ -45,7 +45,7 @@ sigma_only, }; - SVD (void) { } + SVD (void) : sigma (), left_sm (), right_sm () { } SVD (const Matrix& a, type svd_type = SVD::std) { init (a, svd_type); } @@ -55,11 +55,7 @@ } SVD (const SVD& a) - { - sigma = a.sigma; - left_sm = a.left_sm; - right_sm = a.right_sm; - } + : sigma (a.sigma), left_sm (a.left_sm), right_sm (a.right_sm) { } SVD& operator = (const SVD& a) {