home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / octave-1.1.1p1-bin.lha / include / octave / dbleGEPBAL.h < prev    next >
C/C++ Source or Header  |  1996-10-12  |  3KB  |  117 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_GEPBALANCE_h)
  25. #define octave_GEPBALANCE_h 1
  26.  
  27. class ostream;
  28.  
  29. #include "dMatrix.h"
  30.  
  31. extern "C++" {
  32.  
  33. class GEPBALANCE
  34. {
  35. friend class Matrix;
  36.  
  37. public:
  38.  
  39.   GEPBALANCE (void) {}
  40.  
  41.   GEPBALANCE (const Matrix& a, const Matrix &, const char *balance_job);
  42.  
  43.   GEPBALANCE (const GEPBALANCE& a);
  44.  
  45.   GEPBALANCE& operator = (const GEPBALANCE& a);
  46.   Matrix balanced_a_matrix (void) const;
  47.   Matrix balanced_b_matrix (void) const;
  48.   Matrix left_balancing_matrix (void) const;
  49.   Matrix right_balancing_matrix (void) const;
  50.   friend ostream& operator << (ostream& os, const GEPBALANCE& a);
  51.  
  52. private:
  53.  
  54.   int init (const Matrix& a, const Matrix& b, const char * balance_job);
  55.  
  56.   Matrix balanced_a_mat;
  57.   Matrix balanced_b_mat;
  58.   Matrix left_balancing_mat;
  59.   Matrix right_balancing_mat;
  60. };
  61.  
  62. inline GEPBALANCE::GEPBALANCE (const Matrix& a, const Matrix& b, 
  63.                    const char * balance_job) 
  64. {
  65.   init (a, b, balance_job); 
  66. }
  67.  
  68. inline GEPBALANCE::GEPBALANCE (const GEPBALANCE& a)
  69. {
  70.   balanced_a_mat = a.balanced_a_mat;
  71.   balanced_b_mat = a.balanced_b_mat;
  72.   left_balancing_mat = a.left_balancing_mat;
  73.   right_balancing_mat = a.right_balancing_mat;
  74. }
  75.  
  76. inline GEPBALANCE&
  77. GEPBALANCE::operator = (const GEPBALANCE& a)
  78. {
  79.   balanced_a_mat = a.balanced_a_mat;
  80.   balanced_b_mat = a.balanced_b_mat;
  81.   left_balancing_mat = a.left_balancing_mat;
  82.   right_balancing_mat = a.right_balancing_mat;
  83.  
  84.   return *this;
  85. }
  86.  
  87. inline Matrix GEPBALANCE::balanced_a_matrix (void) const 
  88. {
  89.   return balanced_a_mat;
  90. }
  91.  
  92. inline Matrix GEPBALANCE::balanced_b_matrix (void) const 
  93. {
  94.   return balanced_b_mat;
  95. }
  96.  
  97. inline Matrix GEPBALANCE::left_balancing_matrix (void) const 
  98. {
  99.   return left_balancing_mat;
  100. }
  101.  
  102. inline Matrix GEPBALANCE::right_balancing_matrix (void) const 
  103. {
  104.   return right_balancing_mat;
  105. }
  106.  
  107. } // extern "C++"
  108.  
  109. #endif
  110.  
  111. /*
  112. ;;; Local Variables: ***
  113. ;;; mode: C++ ***
  114. ;;; page-delimiter: "^/\\*" ***
  115. ;;; End: ***
  116. */
  117.