fEIG.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_float_EIG_h)
00024 #define octave_float_EIG_h 1
00025 
00026 #include <iosfwd>
00027 
00028 #include "fMatrix.h"
00029 #include "fCMatrix.h"
00030 #include "fCColVector.h"
00031 
00032 class
00033 OCTAVE_API
00034 FloatEIG
00035 {
00036 friend class FloatMatrix;
00037 friend class FloatComplexMatrix;
00038 
00039 public:
00040 
00041   FloatEIG (void)
00042     : lambda (), v () { }
00043 
00044   FloatEIG (const FloatMatrix& a, bool calc_eigenvectors = true)
00045     : lambda (), v ()
00046   {
00047     init (a, calc_eigenvectors);
00048   }
00049 
00050   FloatEIG (const FloatMatrix& a, octave_idx_type& info,
00051             bool calc_eigenvectors = true)
00052     : lambda (), v ()
00053   {
00054     info = init (a, calc_eigenvectors);
00055   }
00056 
00057   FloatEIG (const FloatMatrix& a, const FloatMatrix& b,
00058             bool calc_eigenvectors = true)
00059     : lambda (), v ()
00060   {
00061     init (a, b, calc_eigenvectors);
00062   }
00063 
00064   FloatEIG (const FloatMatrix& a, const FloatMatrix& b, octave_idx_type& info,
00065             bool calc_eigenvectors = true)
00066     : lambda (), v ()
00067   {
00068     info = init (a, b, calc_eigenvectors);
00069   }
00070 
00071   FloatEIG (const FloatComplexMatrix& a, bool calc_eigenvectors = true)
00072     : lambda (), v ()
00073   {
00074     init (a, calc_eigenvectors);
00075   }
00076 
00077   FloatEIG (const FloatComplexMatrix& a, octave_idx_type& info,
00078             bool calc_eigenvectors = true)
00079     : lambda (), v ()
00080   {
00081     info = init (a, calc_eigenvectors);
00082   }
00083 
00084   FloatEIG (const FloatComplexMatrix& a, const FloatComplexMatrix& b,
00085             bool calc_eigenvectors = true)
00086     : lambda (), v ()
00087   {
00088     init (a, b, calc_eigenvectors);
00089   }
00090 
00091   FloatEIG (const FloatComplexMatrix& a, const FloatComplexMatrix& b,
00092             octave_idx_type& info, bool calc_eigenvectors = true)
00093     : lambda (), v ()
00094   {
00095     info = init (a, b, calc_eigenvectors);
00096   }
00097 
00098   FloatEIG (const FloatEIG& a) : lambda (a.lambda), v (a.v) { }
00099 
00100   FloatEIG& operator = (const FloatEIG& a)
00101     {
00102       if (this != &a)
00103         {
00104           lambda = a.lambda;
00105           v = a.v;
00106         }
00107       return *this;
00108     }
00109 
00110   ~FloatEIG (void) { }
00111 
00112   FloatComplexColumnVector eigenvalues (void) const { return lambda; }
00113 
00114   FloatComplexMatrix eigenvectors (void) const { return v; }
00115 
00116   friend std::ostream&  operator << (std::ostream& os, const FloatEIG& a);
00117 
00118 private:
00119 
00120   FloatComplexColumnVector lambda;
00121   FloatComplexMatrix v;
00122 
00123   octave_idx_type init (const FloatMatrix& a, bool calc_eigenvectors);
00124   octave_idx_type init (const FloatMatrix& a, const FloatMatrix& b, bool calc_eigenvectors);
00125   octave_idx_type init (const FloatComplexMatrix& a, bool calc_eigenvectors);
00126   octave_idx_type init (const FloatComplexMatrix& a, const FloatComplexMatrix& b, bool calc_eigenvectors);
00127 
00128   octave_idx_type symmetric_init (const FloatMatrix& a, bool calc_eigenvectors);
00129   octave_idx_type symmetric_init (const FloatMatrix& a, const FloatMatrix& b, bool calc_eigenvectors);
00130   octave_idx_type hermitian_init (const FloatComplexMatrix& a, bool calc_eigenvectors);
00131   octave_idx_type hermitian_init (const FloatComplexMatrix& a, const FloatComplexMatrix& b, bool calc_eigenvectors);
00132 };
00133 
00134 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines