GNU Octave 11.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-2026 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-oct.h"
34
37
38template <typename T>
39class lu
40{
41public:
42
43 typedef typename T::column_vector_type VT;
44 typedef typename T::element_type ELT_T;
45
46 lu ()
47 : m_a_fact (), m_L (), m_ipvt () { }
48
49 OCTAVE_API lu (const T& a);
50
51 lu (const lu& a)
52 : m_a_fact (a.m_a_fact), m_L (a.m_L), m_ipvt (a.m_ipvt) { }
53
54 OCTAVE_API lu (const T& l, const T& u, const PermMatrix& p);
55
56 lu& operator = (const lu& a)
57 {
58 if (this != &a)
59 {
61 m_L = a.m_L;
62 m_ipvt = a.m_ipvt;
63 }
64
65 return *this;
66 }
67
68 virtual ~lu () = default;
69
70 OCTAVE_API bool packed () const;
71
72 OCTAVE_API void unpack ();
73
74 OCTAVE_API T L () const;
75
76 OCTAVE_API T U () const;
77
78 OCTAVE_API T Y () const;
79
80 OCTAVE_API PermMatrix P () const;
81
83
84 OCTAVE_API bool regular () const;
85
86 OCTAVE_API void update (const VT& u, const VT& v);
87
88 OCTAVE_API void update (const T& u, const T& v);
89
90 OCTAVE_API void update_piv (const VT& u, const VT& v);
91
92 OCTAVE_API void update_piv (const T& u, const T& v);
93
94protected:
95
96 // The result of getp is passed to other Octave Matrix functions,
97 // so we use octave_idx_type.
99
102
103 // This is internal storage that is passed to Fortran,
104 // so we need a Fortran INTEGER.
106};
107
108OCTAVE_END_NAMESPACE(math)
109OCTAVE_END_NAMESPACE(octave)
110
111#endif
N Dimensional Array with copy-on-write semantics.
Definition Array-base.h:130
Definition lu.h:40
bool packed() const
Definition lu.cc:67
T m_L
Definition lu.h:101
lu()
Definition lu.h:46
void update_piv(const VT &u, const VT &v)
lu(const lu &a)
Definition lu.h:51
Array< octave_f77_int_type > m_ipvt
Definition lu.h:105
virtual ~lu()=default
T U() const
Definition lu.cc:122
void unpack()
Definition lu.cc:74
ColumnVector P_vec() const
Definition lu.cc:195
T::column_vector_type VT
Definition lu.h:43
void update_piv(const T &u, const T &v)
bool regular() const
Definition lu.cc:211
void update(const VT &u, const VT &v)
void update(const T &u, const T &v)
T::element_type ELT_T
Definition lu.h:44
PermMatrix P() const
Definition lu.cc:188
Array< octave_idx_type > getp() const
Definition lu.cc:157
T L() const
Definition lu.cc:95
lu & operator=(const lu &a)
Definition lu.h:56
lu(const T &a)
T m_a_fact
Definition lu.h:100
T Y() const
Definition lu.cc:146
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define OCTAVE_API
Definition main.in.cc:55