Advertisement
BumiBarbi

fEIG.h

Mar 29th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.10 KB | None | 0 0
  1. /*
  2.  
  3. Copyright (C) 1994-2015 John W. Eaton
  4.  
  5. This file is part of Octave.
  6.  
  7. Octave is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 3 of the License, or (at your
  10. option) any later version.
  11.  
  12. Octave is distributed in the hope that it will be useful, but WITHOUT
  13. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15. for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with Octave; see the file COPYING.  If not, see
  19. <http://www.gnu.org/licenses/>.
  20.  
  21. */
  22.  
  23. #if ! defined (octave_fEIG_h)
  24. #define octave_fEIG_h 1
  25.  
  26. #include "octave-config.h"
  27.  
  28. #include <iosfwd>
  29.  
  30. #include "fMatrix.h"
  31. #include "fCMatrix.h"
  32. #include "fCColVector.h"
  33.  
  34. class
  35. OCTAVE_API
  36. FloatEIG
  37. {
  38.   friend class FloatMatrix;
  39.   friend class FloatComplexMatrix;
  40.  
  41. public:
  42.  
  43.   FloatEIG (void)
  44.     : lambda (), v () { }
  45.  
  46.   FloatEIG (const FloatMatrix& a, bool calc_eigenvectors = true,
  47.             bool balance = true)
  48.     : lambda (), v ()
  49.   {
  50.     init (a, calc_eigenvectors, balance);
  51.   }
  52.  
  53.   FloatEIG (const FloatMatrix& a, octave_idx_type& info,
  54.             bool calc_eigenvectors = true, bool balance = true)
  55.     : lambda (), v ()
  56.   {
  57.     info = init (a, calc_eigenvectors, balance);
  58.   }
  59.  
  60.   FloatEIG (const FloatMatrix& a, const FloatMatrix& b,
  61.             bool calc_eigenvectors = true)
  62.     : lambda (), v ()
  63.   {
  64.     init (a, b, calc_eigenvectors);
  65.   }
  66.  
  67.   FloatEIG (const FloatMatrix& a, const FloatMatrix& b,
  68.             octave_idx_type& info, bool calc_eigenvectors = true)
  69.     : lambda (), v ()
  70.   {
  71.     info = init (a, b, calc_eigenvectors);
  72.   }
  73.  
  74.   FloatEIG (const FloatComplexMatrix& a, bool calc_eigenvectors = true,
  75.             bool balance = true)
  76.     : lambda (), v ()
  77.   {
  78.     init (a, calc_eigenvectors, balance);
  79.   }
  80.  
  81.   FloatEIG (const FloatComplexMatrix& a, octave_idx_type& info,
  82.             bool calc_eigenvectors = true, bool balance = true)
  83.     : lambda (), v ()
  84.   {
  85.     info = init (a, calc_eigenvectors, balance);
  86.   }
  87.  
  88.   FloatEIG (const FloatComplexMatrix& a, const FloatComplexMatrix& b,
  89.             bool calc_eigenvectors = true)
  90.     : lambda (), v ()
  91.   {
  92.     init (a, b, calc_eigenvectors);
  93.   }
  94.  
  95.   FloatEIG (const FloatComplexMatrix& a, const FloatComplexMatrix& b,
  96.             octave_idx_type& info, bool calc_eigenvectors = true)
  97.     : lambda (), v ()
  98.   {
  99.     info = init (a, b, calc_eigenvectors);
  100.   }
  101.  
  102.   FloatEIG (const FloatEIG& a) : lambda (a.lambda), v (a.v) { }
  103.  
  104.   FloatEIG& operator = (const FloatEIG& a)
  105.   {
  106.     if (this != &a)
  107.       {
  108.         lambda = a.lambda;
  109.         v = a.v;
  110.       }
  111.     return *this;
  112.   }
  113.  
  114.   ~FloatEIG (void) { }
  115.  
  116.   FloatComplexColumnVector eigenvalues (void) const { return lambda; }
  117.  
  118.   FloatComplexMatrix eigenvectors (void) const { return v; }
  119.  
  120.   friend std::ostream&  operator << (std::ostream& os, const FloatEIG& a);
  121.  
  122. private:
  123.  
  124.   FloatComplexColumnVector lambda;
  125.   FloatComplexMatrix v;
  126.  
  127.   octave_idx_type init (const FloatMatrix& a, bool calc_eigenvectors,
  128.                         bool balance);
  129.   octave_idx_type init (const FloatMatrix& a, const FloatMatrix& b,
  130.                         bool calc_eigenvectors);
  131.   octave_idx_type init (const FloatComplexMatrix& a, bool calc_eigenvectors,
  132.                         bool balance);
  133.   octave_idx_type init (const FloatComplexMatrix& a,
  134.                         const FloatComplexMatrix& b, bool calc_eigenvectors);
  135.  
  136.   octave_idx_type symmetric_init (const FloatMatrix& a, bool calc_eigenvectors);
  137.   octave_idx_type symmetric_init (const FloatMatrix& a, const FloatMatrix& b,
  138.                                   bool calc_eigenvectors);
  139.   octave_idx_type hermitian_init (const FloatComplexMatrix& a,
  140.                                   bool calc_eigenvectors);
  141.   octave_idx_type hermitian_init (const FloatComplexMatrix& a,
  142.                                   const FloatComplexMatrix& b,
  143.                                   bool calc_eigenvectors);
  144. };
  145.  
  146. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement