EIG.h

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 1994-2012 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 3 of the License, or (at your
00010 option) any 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, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #if !defined (octave_EIG_h)
00024 #define octave_EIG_h 1
00025 
00026 #include <iosfwd>
00027 
00028 #include "dMatrix.h"
00029 #include "CMatrix.h"
00030 #include "CColVector.h"
00031 
00032 class
00033 OCTAVE_API
00034 EIG
00035 {
00036 friend class Matrix;
00037 friend class ComplexMatrix;
00038 
00039 public:
00040 
00041   EIG (void) : lambda (), v () { }
00042 
00043   EIG (const Matrix& a, bool calc_eigenvectors = true)
00044     : lambda (), v ()
00045   {
00046     init (a, calc_eigenvectors);
00047   }
00048 
00049   EIG (const Matrix& a, octave_idx_type& info, bool calc_eigenvectors = true)
00050     : lambda (), v ()
00051   {
00052     info = init (a, calc_eigenvectors);
00053   }
00054 
00055   EIG (const Matrix& a, const Matrix& b, bool calc_eigenvectors = true)
00056     : lambda (), v ()
00057   {
00058     init (a, b, calc_eigenvectors);
00059   }
00060 
00061   EIG (const Matrix& a, const Matrix& b, octave_idx_type& info,
00062        bool calc_eigenvectors = true)
00063     : lambda (), v ()
00064   {
00065     info = init (a, b, calc_eigenvectors);
00066   }
00067 
00068   EIG (const ComplexMatrix& a, bool calc_eigenvectors = true)
00069     : lambda (), v ()
00070   {
00071     init (a, calc_eigenvectors);
00072   }
00073 
00074   EIG (const ComplexMatrix& a, octave_idx_type& info,
00075        bool calc_eigenvectors = true)
00076     : lambda (), v ()
00077   {
00078     info = init (a, calc_eigenvectors);
00079   }
00080 
00081   EIG (const ComplexMatrix& a, const ComplexMatrix& b,
00082        bool calc_eigenvectors = true)
00083     : lambda (), v ()
00084   {
00085     init (a, b, calc_eigenvectors);
00086   }
00087 
00088   EIG (const ComplexMatrix& a, const ComplexMatrix& b,
00089        octave_idx_type& info, bool calc_eigenvectors = true)
00090     : lambda (), v ()
00091   {
00092     info = init (a, b, calc_eigenvectors);
00093   }
00094 
00095   EIG (const EIG& a)
00096     : lambda (a.lambda), v (a.v) { }
00097 
00098   EIG& operator = (const EIG& a)
00099     {
00100       if (this != &a)
00101         {
00102           lambda = a.lambda;
00103           v = a.v;
00104         }
00105       return *this;
00106     }
00107 
00108   ~EIG (void) { }
00109 
00110   ComplexColumnVector eigenvalues (void) const { return lambda; }
00111 
00112   ComplexMatrix eigenvectors (void) const { return v; }
00113 
00114   friend std::ostream&  operator << (std::ostream& os, const EIG& a);
00115 
00116 private:
00117 
00118   ComplexColumnVector lambda;
00119   ComplexMatrix v;
00120 
00121   octave_idx_type init (const Matrix& a, bool calc_eigenvectors);
00122 
00123   octave_idx_type init (const Matrix& a, const Matrix& b,
00124                         bool calc_eigenvectors);
00125 
00126   octave_idx_type init (const ComplexMatrix& a, bool calc_eigenvectors);
00127 
00128   octave_idx_type init (const ComplexMatrix& a, const ComplexMatrix& b,
00129                         bool calc_eigenvectors);
00130 
00131   octave_idx_type symmetric_init (const Matrix& a, bool calc_eigenvectors);
00132 
00133   octave_idx_type symmetric_init (const Matrix& a, const Matrix& b,
00134                                   bool calc_eigenvectors);
00135 
00136   octave_idx_type hermitian_init (const ComplexMatrix& a,
00137                                   bool calc_eigenvectors);
00138 
00139   octave_idx_type hermitian_init (const ComplexMatrix& a,
00140                                   const ComplexMatrix& b,
00141                                   bool calc_eigenvectors);
00142 
00143 };
00144 
00145 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines