GNU Octave 10.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-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_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
38
40
41// If the sparse matrix classes become templated on the element type
42// (i.e., sparse_matrix<double>), then it might be best to make the
43// template parameter of this class also be the element type instead
44// of the matrix type.
45
46template <typename chol_type>
48{
49public:
50
51 sparse_chol ();
52
53 sparse_chol (const chol_type& a, bool natural, bool force);
54
55 sparse_chol (const chol_type& a, octave_idx_type& info,
56 bool natural, bool force);
57
58 sparse_chol (const chol_type& a, octave_idx_type& info, bool natural);
59
60 sparse_chol (const chol_type& a, octave_idx_type& info);
61
62 sparse_chol (const sparse_chol<chol_type>& a) = default;
63
64 virtual ~sparse_chol () = default;
65
67 operator = (const sparse_chol<chol_type>& a) = default;
68
69 chol_type L () const;
70
71 chol_type R () const { return L ().hermitian (); }
72
73 octave_idx_type P () const;
74
75 RowVector perm () const;
76
77 SparseMatrix Q () const;
78
79 bool is_positive_definite () const;
80
81 double rcond () const;
82
83 chol_type inverse () const;
84
85protected:
86
87 typedef typename chol_type::element_type chol_elt;
88
89 class sparse_chol_rep;
90
91private:
92
93 std::shared_ptr<sparse_chol_rep> m_rep;
94};
95
96template <typename chol_type>
98chol_type
99chol2inv (const chol_type& r);
100
101OCTAVE_END_NAMESPACE(math)
102OCTAVE_END_NAMESPACE(octave)
103
104#endif
chol_type R() const
Definition sparse-chol.h:71
virtual ~sparse_chol()=default
chol_type::element_type chol_elt
Definition sparse-chol.h:87
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)