メインページ   クラス階層   構成   ファイル一覧   構成メンバ   ファイルメンバ  

dDiagMatrix.h

解説を見る。
00001 /*
00002 
00003 Copyright (C) 1996, 1997 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 2, or (at your option) any
00010 later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, write to the Free
00019 Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00020 
00021 */
00022 
00023 #if !defined (octave_DiagMatrix_h)
00024 #define octave_DiagMatrix_h 1
00025 
00026 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
00027 #pragma interface
00028 #endif
00029 
00030 #include "MDiagArray2.h"
00031 
00032 #include "dRowVector.h"
00033 #include "dColVector.h"
00034 
00035 #include "mx-defs.h"
00036 
00037 class
00038 DiagMatrix : public MDiagArray2<double>
00039 {
00040 friend class SVD;
00041 friend class ComplexSVD;
00042 
00043 public:
00044 
00045   DiagMatrix (void) : MDiagArray2<double> () { }
00046 
00047   DiagMatrix (int r, int c) : MDiagArray2<double> (r, c) { }
00048 
00049   DiagMatrix (int r, int c, double val) : MDiagArray2<double> (r, c, val) { }
00050 
00051   DiagMatrix (const DiagMatrix& a) : MDiagArray2<double> (a) { }
00052 
00053   DiagMatrix (const MDiagArray2<double>& a) : MDiagArray2<double> (a) { }
00054 
00055   explicit DiagMatrix (const RowVector& a) : MDiagArray2<double> (a) { }
00056 
00057   explicit DiagMatrix (const ColumnVector& a) : MDiagArray2<double> (a) { }
00058 
00059   DiagMatrix& operator = (const DiagMatrix& a)
00060     {
00061       MDiagArray2<double>::operator = (a);
00062       return *this;
00063     }
00064 
00065   bool operator == (const DiagMatrix& a) const;
00066   bool operator != (const DiagMatrix& a) const;
00067 
00068   DiagMatrix& fill (double val);
00069   DiagMatrix& fill (double val, int beg, int end);
00070   DiagMatrix& fill (const ColumnVector& a);
00071   DiagMatrix& fill (const RowVector& a);
00072   DiagMatrix& fill (const ColumnVector& a, int beg);
00073   DiagMatrix& fill (const RowVector& a, int beg);
00074 
00075   DiagMatrix transpose (void) const;
00076 
00077   friend DiagMatrix real (const ComplexDiagMatrix& a);
00078   friend DiagMatrix imag (const ComplexDiagMatrix& a);
00079 
00080   // resize is the destructive analog for this one
00081 
00082   Matrix extract (int r1, int c1, int r2, int c2) const;
00083 
00084   // extract row or column i.
00085 
00086   RowVector row (int i) const;
00087   RowVector row (char *s) const;
00088 
00089   ColumnVector column (int i) const;
00090   ColumnVector column (char *s) const;
00091 
00092   DiagMatrix inverse (void) const;
00093   DiagMatrix inverse (int& info) const;
00094 
00095   // other operations
00096 
00097   ColumnVector diag (void) const;
00098   ColumnVector diag (int k) const;
00099 
00100   // i/o
00101 
00102   friend std::ostream& operator << (std::ostream& os, const DiagMatrix& a);
00103 
00104 private:
00105 
00106   DiagMatrix (double *d, int nr, int nc) : MDiagArray2<double> (d, nr, nc) { }
00107 };
00108 
00109 // diagonal matrix by diagonal matrix -> diagonal matrix operations
00110 
00111 DiagMatrix
00112 operator * (const DiagMatrix& a, const DiagMatrix& b);
00113 
00114 MDIAGARRAY2_FORWARD_DEFS (MDiagArray2, DiagMatrix, double)
00115 
00116 #endif
00117 
00118 /*
00119 ;;; Local Variables: ***
00120 ;;; mode: C++ ***
00121 ;;; End: ***
00122 */

Wed Dec 29 11:51:13 2004に生成されました。 doxygen1.2.18
SEO [PR] 爆速!無料ブログ 無料ホームページ開設 無料ライブ放送