GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
hess.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_hess_h)
27 #define octave_hess_h 1
28 
29 #include "octave-config.h"
30 
31 #include <iosfwd>
32 
34 
36 
37 template <typename T>
38 class
39 hess
40 {
41 public:
42 
43  hess ()
44  : m_hess_mat (), m_unitary_hess_mat ()
45  { }
46 
47  hess (const T& a)
48  : m_hess_mat (), m_unitary_hess_mat ()
49  {
50  init (a);
51  }
52 
53  hess (const T& a, octave_idx_type& info)
54  : m_hess_mat (), m_unitary_hess_mat ()
55  {
56  info = init (a);
57  }
58 
59  hess (const hess& a)
60  : m_hess_mat (a.m_hess_mat), m_unitary_hess_mat (a.m_unitary_hess_mat)
61  { }
62 
63  hess& operator = (const hess& a)
64  {
65  if (this != &a)
66  {
67  m_hess_mat = a.m_hess_mat;
68  m_unitary_hess_mat = a.m_unitary_hess_mat;
69  }
70 
71  return *this;
72  }
73 
74  ~hess () = default;
75 
76  T hess_matrix () const { return m_hess_mat; }
77 
78  T unitary_hess_matrix () const { return m_unitary_hess_mat; }
79 
80 private:
81 
82  T m_hess_mat;
83  T m_unitary_hess_mat;
84 
85  OCTAVE_API octave_idx_type init (const T& a);
86 };
87 
88 template <typename T>
89 extern OCTAVE_API std::ostream&
90 operator << (std::ostream& os, const hess<T>& a);
91 
92 OCTAVE_END_NAMESPACE(math)
93 OCTAVE_END_NAMESPACE(octave)
94 
95 #endif
Definition: hess.h:40
T hess_matrix() const
Definition: hess.h:76
T unitary_hess_matrix() const
Definition: hess.h:78
~hess()=default
hess(const T &a, octave_idx_type &info)
Definition: hess.h:53
hess(const T &a)
Definition: hess.h:47
hess()
Definition: hess.h:43
hess(const hess &a)
Definition: hess.h:59
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
std::ostream & operator<<(std::ostream &os, const hess< T > &a)
#define OCTAVE_API
Definition: main.cc:55