GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
lu.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1996-2025 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_lu_h)
27#define octave_lu_h 1
28
29#include "octave-config.h"
30
31#include "mx-fwd.h"
32
33#include "Array.h"
34
36
38
39template <typename T>
40class lu
41{
42public:
43
44 typedef typename T::column_vector_type VT;
45 typedef typename T::element_type ELT_T;
46
47 lu ()
48 : m_a_fact (), m_L (), m_ipvt () { }
49
50 OCTAVE_API lu (const T& a);
51
52 lu (const lu& a)
53 : m_a_fact (a.m_a_fact), m_L (a.m_L), m_ipvt (a.m_ipvt) { }
54
55 OCTAVE_API lu (const T& l, const T& u, const PermMatrix& p);
56
57 lu& operator = (const lu& a)
58 {
59 if (this != &a)
60 {
62 m_L = a.m_L;
63 m_ipvt = a.m_ipvt;
64 }
65
66 return *this;
67 }
68
69 virtual ~lu () = default;
70
71 OCTAVE_API bool packed () const;
72
73 OCTAVE_API void unpack ();
74
75 OCTAVE_API T L () const;
76
77 OCTAVE_API T U () const;
78
79 OCTAVE_API T Y () const;
80
81 OCTAVE_API PermMatrix P () const;
82
84
85 OCTAVE_API bool regular () const;
86
87 OCTAVE_API void update (const VT& u, const VT& v);
88
89 OCTAVE_API void update (const T& u, const T& v);
90
91 OCTAVE_API void update_piv (const VT& u, const VT& v);
92
93 OCTAVE_API void update_piv (const T& u, const T& v);
94
95protected:
96
97 // The result of getp is passed to other Octave Matrix functions,
98 // so we use octave_idx_type.
100
103
104 // This is internal storage that is passed to Fortran,
105 // so we need a Fortran INTEGER.
107};
108
109OCTAVE_END_NAMESPACE(math)
110OCTAVE_END_NAMESPACE(octave)
111
112#endif
N Dimensional Array with copy-on-write semantics.
Definition Array.h:130
Definition lu.h:41
bool packed() const
Definition lu.cc:68
T m_L
Definition lu.h:102
lu()
Definition lu.h:47
void update_piv(const VT &u, const VT &v)
lu(const lu &a)
Definition lu.h:52
Array< octave_f77_int_type > m_ipvt
Definition lu.h:106
virtual ~lu()=default
T U() const
Definition lu.cc:123
void unpack()
Definition lu.cc:75
ColumnVector P_vec() const
Definition lu.cc:196
T::column_vector_type VT
Definition lu.h:44
void update_piv(const T &u, const T &v)
bool regular() const
Definition lu.cc:212
void update(const VT &u, const VT &v)
void update(const T &u, const T &v)
T::element_type ELT_T
Definition lu.h:45
PermMatrix P() const
Definition lu.cc:189
Array< octave_idx_type > getp() const
Definition lu.cc:158
T L() const
Definition lu.cc:96
lu & operator=(const lu &a)
Definition lu.h:57
lu(const T &a)
T m_a_fact
Definition lu.h:101
T Y() const
Definition lu.cc:147
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define OCTAVE_API
Definition main.in.cc:55