|
1 | | -///! Cholesky factorization module. |
2 | | -///! |
3 | | -///! Contains LDLT decomposition methods. |
4 | | -///! |
5 | | -///! This decomposition operates on symmetric positive definite matrices, |
6 | | -///! and is written `A = L D L` where L is lower triangular and D is diagonal. |
7 | | -///! It is closely related to the Cholesky decomposition, but is often more |
8 | | -///! numerically stable and can work on some indefinite matrices. |
9 | | -///! |
10 | | -///! The easiest way to use this API is to create a `LdlNumeric` instance from |
11 | | -///! a matrix, then use the `LdlNumeric::solve` method. |
12 | | -///! |
13 | | -///! It is possible to update a decomposition if the sparsity structure of a |
14 | | -///! matrix does not change. In that case the `LdlNumeric::update` method can |
15 | | -///! be used. |
16 | | -///! |
17 | | -///! When only the sparsity structure of a matrix is known, it is possible |
18 | | -///! to precompute part of the factorization by using the `LdlSymbolic` struct. |
19 | | -///! This struct can the be converted into a `LdlNumeric` once the non-zero |
20 | | -///! values are known, using the `LdlSymbolic::factor` method. |
21 | | -// This method is adapted from the LDL library by Tim Davis: |
22 | | -// |
23 | | -// LDL Copyright (c) 2005 by Timothy A. Davis. All Rights Reserved. |
24 | | -// |
25 | | -// LDL License: |
26 | | -// |
27 | | -// Your use or distribution of LDL or any modified version of |
28 | | -// LDL implies that you agree to this License. |
29 | | -// |
30 | | -// This library is free software; you can redistribute it and/or |
31 | | -// modify it under the terms of the GNU Lesser General Public |
32 | | -// License as published by the Free Software Foundation; either |
33 | | -// version 2.1 of the License, or (at your option) any later version. |
34 | | -// |
35 | | -// This library is distributed in the hope that it will be useful, |
36 | | -// but WITHOUT ANY WARRANTY; without even the implied warranty of |
37 | | -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
38 | | -// Lesser General Public License for more details. |
39 | | -// |
40 | | -// You should have received a copy of the GNU Lesser General Public |
41 | | -// License along with this library; if not, write to the Free Software |
42 | | -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 |
43 | | -// USA |
44 | | -// |
45 | | -// Permission is hereby granted to use or copy this program under the |
46 | | -// terms of the GNU LGPL, provided that the Copyright, this License, |
47 | | -// and the Availability of the original version is retained on all copies. |
48 | | -// User documentation of any code that uses this code or any modified |
49 | | -// version of this code must cite the Copyright, this License, the |
50 | | -// Availability note, and "Used by permission." Permission to modify |
51 | | -// the code and to distribute modified code is granted, provided the |
52 | | -// Copyright, this License, and the Availability note are retained, |
53 | | -// and a notice that the code was modified is included. |
| 1 | +//! Cholesky factorization module. |
| 2 | +//! |
| 3 | +//! Contains LDLT decomposition methods. |
| 4 | +//! |
| 5 | +//! This decomposition operates on symmetric positive definite matrices, |
| 6 | +//! and is written `A = L D L` where L is lower triangular and D is diagonal. |
| 7 | +//! It is closely related to the Cholesky decomposition, but is often more |
| 8 | +//! numerically stable and can work on some indefinite matrices. |
| 9 | +//! |
| 10 | +//! The easiest way to use this API is to create a `LdlNumeric` instance from |
| 11 | +//! a matrix, then use the `LdlNumeric::solve` method. |
| 12 | +//! |
| 13 | +//! It is possible to update a decomposition if the sparsity structure of a |
| 14 | +//! matrix does not change. In that case the `LdlNumeric::update` method can |
| 15 | +//! be used. |
| 16 | +//! |
| 17 | +//! When only the sparsity structure of a matrix is known, it is possible |
| 18 | +//! to precompute part of the factorization by using the `LdlSymbolic` struct. |
| 19 | +//! This struct can the be converted into a `LdlNumeric` once the non-zero |
| 20 | +//! values are known, using the `LdlSymbolic::factor` method. |
| 21 | +//! |
| 22 | +//! This method is adapted from the LDL library by Tim Davis: |
| 23 | +//! |
| 24 | +//! LDL Copyright (c) 2005 by Timothy A. Davis. All Rights Reserved. |
| 25 | +//! |
| 26 | +//! LDL License: |
| 27 | +//! |
| 28 | +//! Your use or distribution of LDL or any modified version of |
| 29 | +//! LDL implies that you agree to this License. |
| 30 | +//! |
| 31 | +//! This library is free software; you can redistribute it and/or |
| 32 | +//! modify it under the terms of the GNU Lesser General Public |
| 33 | +//! License as published by the Free Software Foundation; either |
| 34 | +//! version 2.1 of the License, or (at your option) any later version. |
| 35 | +//! |
| 36 | +//! This library is distributed in the hope that it will be useful, |
| 37 | +//! but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 38 | +//! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 39 | +//! Lesser General Public License for more details. |
| 40 | +//! |
| 41 | +//! You should have received a copy of the GNU Lesser General Public |
| 42 | +//! License along with this library; if not, write to the Free Software |
| 43 | +//! Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 |
| 44 | +//! USA |
| 45 | +//! |
| 46 | +//! Permission is hereby granted to use or copy this program under the |
| 47 | +//! terms of the GNU LGPL, provided that the Copyright, this License, |
| 48 | +//! and the Availability of the original version is retained on all copies. |
| 49 | +//! User documentation of any code that uses this code or any modified |
| 50 | +//! version of this code must cite the Copyright, this License, the |
| 51 | +//! Availability note, and "Used by permission." Permission to modify |
| 52 | +//! the code and to distribute modified code is granted, provided the |
| 53 | +//! Copyright, this License, and the Availability note are retained, |
| 54 | +//! and a notice that the code was modified is included. |
54 | 55 | use std::ops::Deref; |
55 | 56 |
|
56 | 57 | use num_traits::Num; |
|
0 commit comments