GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
sparse-chol.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1998-2021 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 "CSparse.h"
32 
33 class RowVector;
34 class SparseMatrix;
36 
37 namespace octave
38 {
39  namespace math
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 
46  template <typename chol_type>
47  class
49  {
50  public:
51 
52  sparse_chol (void);
53 
54  sparse_chol (const chol_type& a, bool natural, bool force);
55 
56  sparse_chol (const chol_type& a, octave_idx_type& info,
57  bool natural, bool force);
58 
59  sparse_chol (const chol_type& a, octave_idx_type& info, bool natural);
60 
61  sparse_chol (const chol_type& a, octave_idx_type& info);
62 
64 
65  virtual ~sparse_chol (void);
66 
67  sparse_chol& operator = (const sparse_chol& a);
68 
69  chol_type L (void) const;
70 
71  chol_type R (void) const { return L ().hermitian (); }
72 
73  octave_idx_type P (void) const;
74 
75  RowVector perm (void) const;
76 
77  SparseMatrix Q (void) const;
78 
79  bool is_positive_definite (void) const;
80 
81  double rcond (void) const;
82 
83  chol_type inverse (void) const;
84 
85  protected:
86 
87  typedef typename chol_type::element_type chol_elt;
88 
89  class sparse_chol_rep;
90 
91  private:
92 
94  };
95 
96  template <typename chol_type>
97  chol_type
98  chol2inv (const chol_type& r);
99 
100  // SparseComplexMatrix specialization.
101 
102  template <>
104  (const SparseComplexMatrix& a, octave_idx_type& info);
105  }
106 }
107 
108 #endif
sparse_chol_rep * rep
Definition: sparse-chol.h:89
chol_type R(void) const
Definition: sparse-chol.h:71
chol_type::element_type chol_elt
Definition: sparse-chol.h:87
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
T * r
Definition: mx-inlines.cc:773
T chol2inv(const T &r)
Definition: chol.cc:242