GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
gepbalance.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1994-2024 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_gepbalance_h)
27 #define octave_gepbalance_h 1
28 
29 #include "octave-config.h"
30 
31 #include <string>
32 
34 
36 
37 template <typename T>
38 class
40 {
41 public:
42 
43  typedef typename T::real_matrix_type RT;
44 
46  : m_balanced_mat (), m_balanced_mat2 (), m_balancing_mat (),
47  m_balancing_mat2 ()
48  { }
49 
50  gepbalance (const T& a, const T& b, const std::string& job)
51  : m_balanced_mat (), m_balanced_mat2 (), m_balancing_mat (),
52  m_balancing_mat2 ()
53  {
54  init (a, b, job);
55  }
56 
58  : m_balanced_mat (a.m_balanced_mat),
59  m_balanced_mat2 (a.m_balanced_mat2),
60  m_balancing_mat (a.m_balancing_mat),
61  m_balancing_mat2 (a.m_balancing_mat2)
62  { }
63 
64  gepbalance& operator = (const gepbalance& a)
65  {
66  if (this != &a)
67  {
68  m_balanced_mat = a.m_balanced_mat;
69  m_balanced_mat2 = a.m_balanced_mat2;
70  m_balancing_mat = a.m_balancing_mat;
71  m_balancing_mat2 = a.m_balancing_mat2;
72  }
73 
74  return *this;
75  }
76 
77  ~gepbalance () = default;
78 
79  T balanced_matrix () const { return m_balanced_mat; }
80 
81  T balanced_matrix2 () const { return m_balanced_mat2; }
82 
83  RT balancing_matrix () const { return m_balancing_mat; }
84 
85  RT balancing_matrix2 () const { return m_balancing_mat2; }
86 
87 private:
88 
89  T m_balanced_mat;
90  T m_balanced_mat2;
91  RT m_balancing_mat;
92  RT m_balancing_mat2;
93 
95  init (const T& a, const T& b, const std::string& job);
96 };
97 
98 OCTAVE_END_NAMESPACE(math)
99 OCTAVE_END_NAMESPACE(octave)
100 
101 #endif
gepbalance(const T &a, const T &b, const std::string &job)
Definition: gepbalance.h:50
T balanced_matrix2() const
Definition: gepbalance.h:81
T balanced_matrix() const
Definition: gepbalance.h:79
RT balancing_matrix() const
Definition: gepbalance.h:83
T::real_matrix_type RT
Definition: gepbalance.h:43
RT balancing_matrix2() const
Definition: gepbalance.h:85
~gepbalance()=default
gepbalance(const gepbalance &a)
Definition: gepbalance.h:57
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define OCTAVE_API
Definition: main.cc:55