diff liboctave/dbleAEPBAL.h @ 8386:a5e080076778

make balance more Matlab-compatible
author Jaroslav Hajek <highegg@gmail.com>
date Tue, 09 Dec 2008 10:08:19 +0100
parents a1dbe9d80eee
children d865363208d6
line wrap: on
line diff
--- a/liboctave/dbleAEPBAL.h	Tue Dec 09 03:25:31 2008 +0100
+++ b/liboctave/dbleAEPBAL.h	Tue Dec 09 10:08:19 2008 +0100
@@ -2,6 +2,7 @@
 
 Copyright (C) 1994, 1995, 1996, 1997, 2000, 2002, 2004, 2005, 2006,
               2007 John W. Eaton
+Copyright (C) 2008 Jaroslav Hajek
 
 This file is part of Octave.
 
@@ -27,48 +28,25 @@
 #include <iostream>
 #include <string>
 
+#include "base-aepbal.h"
 #include "dMatrix.h"
+#include "dColVector.h"
 
 class
 OCTAVE_API
-AEPBALANCE
+AEPBALANCE : public base_aepbal<Matrix, ColumnVector>
 {
 public:
 
-  AEPBALANCE (void) : balanced_mat (), balancing_mat () { }
+  AEPBALANCE (void) : base_aepbal<Matrix, ColumnVector> () { }
 
-  AEPBALANCE (const Matrix& a,const std::string& balance_job)
-    {
-      init (a, balance_job); 
-    }
-
-  AEPBALANCE (const AEPBALANCE& a)
-    : balanced_mat (a.balanced_mat), balancing_mat (a.balancing_mat) { }
+  AEPBALANCE (const Matrix& a, bool noperm = false,
+              bool noscal = false);
 
-  AEPBALANCE& operator = (const AEPBALANCE& a)
-    {
-      if (this != &a)
-	{
-	  balanced_mat = a.balanced_mat;
-	  balancing_mat = a.balancing_mat;
-	}
-      return *this;
-    }
-
-  ~AEPBALANCE (void) { }
+  AEPBALANCE (const AEPBALANCE& a) 
+    : base_aepbal<Matrix, ColumnVector> (a) { }
 
-  Matrix balanced_matrix (void) const { return balanced_mat; }
-
-  Matrix balancing_matrix (void) const { return balancing_mat; }
-
-  friend std::ostream& operator << (std::ostream& os, const AEPBALANCE& a);
-
-private:
-
-  Matrix balanced_mat;
-  Matrix balancing_mat;
-
-  octave_idx_type init (const Matrix& a, const std::string& balance_job);
+  Matrix balancing_matrix (void) const;
 };
 
 #endif