GNU Octave 11.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
sparse-chol.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1998-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_sparse_chol_h)
27#define octave_sparse_chol_h 1
28
29#include "octave-config.h"
30
31#include <memory>
32
33#include "mx-fwd.h"
34
35#include "CSparse.h"
36
39
40// If the sparse matrix classes become templated on the element type
41// (i.e., sparse_matrix<double>), then it might be best to make the
42// template parameter of this class also be the element type instead
43// of the matrix type.
44
45template <typename chol_type>
47{
48public:
49
50 sparse_chol ();
51
52 sparse_chol (const chol_type& a, bool natural, bool force);
53
54 sparse_chol (const chol_type& a, octave_idx_type& info,
55 bool natural, bool force);
56
57 sparse_chol (const chol_type& a, octave_idx_type& info, bool natural);
58
59 sparse_chol (const chol_type& a, octave_idx_type& info);
60
61 sparse_chol (const sparse_chol<chol_type>& a) = default;
62
63 virtual ~sparse_chol () = default;
64
66 operator = (const sparse_chol<chol_type>& a) = default;
67
68 chol_type L () const;
69
70 chol_type R () const { return L ().hermitian (); }
71
72 octave_idx_type P () const;
73
74 RowVector perm () const;
75
76 SparseMatrix Q () const;
77
78 bool is_positive_definite () const;
79
80 double rcond () const;
81
82 chol_type inverse () const;
83
84protected:
85
86 typedef typename chol_type::element_type chol_elt;
87
88 class sparse_chol_rep;
89
90private:
91
92 std::shared_ptr<sparse_chol_rep> m_rep;
93};
94
95template <typename chol_type>
97chol_type
98chol2inv (const chol_type& r);
99
100OCTAVE_END_NAMESPACE(math)
101OCTAVE_END_NAMESPACE(octave)
102
103#endif
chol_type R() const
Definition sparse-chol.h:70
virtual ~sparse_chol()=default
chol_type::element_type chol_elt
Definition sparse-chol.h:86
sparse_chol(const sparse_chol< chol_type > &a)=default
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
F77_RET_T const F77_INT const F77_INT const F77_INT F77_DBLE const F77_INT F77_DBLE const F77_INT F77_DBLE * Q
#define OCTAVE_API
Definition main.in.cc:55
chol_type chol2inv(const chol_type &r)