home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / octave-1.1.1p1-bin.lha / include / octave / dbleQR.h < prev    next >
C/C++ Source or Header  |  1996-10-12  |  2KB  |  96 lines

  1. //                                  -*- C++ -*-
  2. /*
  3.  
  4. Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton
  5.  
  6. This file is part of Octave.
  7.  
  8. Octave is free software; you can redistribute it and/or modify it
  9. under the terms of the GNU General Public License as published by the
  10. Free Software Foundation; either version 2, or (at your option) any
  11. later version.
  12.  
  13. Octave is distributed in the hope that it will be useful, but WITHOUT
  14. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16. for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with Octave; see the file COPYING.  If not, write to the Free
  20. Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  
  22. */
  23.  
  24. #if !defined (octave_QR_h)
  25. #define octave_QR_h 1
  26.  
  27. class ostream;
  28.  
  29. #include "dMatrix.h"
  30.  
  31. extern "C++" {
  32.  
  33. class QR
  34. {
  35. public:
  36.  
  37.   enum type
  38.     {
  39.       std,
  40.       raw,
  41.       economy,
  42.     };
  43.  
  44.   QR (void) {}
  45.  
  46.   QR (const Matrix& A, type qr_type = QR::std);
  47.  
  48.   QR (const QR& a);
  49.  
  50.   QR& operator = (const QR& a);
  51.  
  52.   Matrix Q (void) const;
  53.   Matrix R (void) const;
  54.  
  55.   friend ostream&  operator << (ostream& os, const QR& a);
  56.  
  57. protected:
  58.  
  59.   Matrix q;
  60.   Matrix r;
  61. };
  62.  
  63. inline QR::QR (const QR& a)
  64. {
  65.   q = a.q;
  66.   r = a.r;
  67. }
  68.  
  69. inline QR& QR::operator = (const QR& a)
  70. {
  71.   q = a.q;
  72.   r = a.r;
  73.   return *this;
  74. }
  75.  
  76. inline Matrix QR::Q (void) const
  77. {
  78.   return q;
  79. }
  80.  
  81. inline Matrix QR::R (void) const
  82. {
  83.   return r;
  84. }
  85.  
  86. } // extern "C++"
  87.  
  88. #endif
  89.  
  90. /*
  91. ;;; Local Variables: ***
  92. ;;; mode: C++ ***
  93. ;;; page-delimiter: "^/\\*" ***
  94. ;;; End: ***
  95. */
  96.