Skip to content

Commit ff46364

Browse files
committed
Ver 0.30.11
* Implement Cholesky Decomposition (#46) * Add `is_symmetric` method to Matrix
2 parents 7073c5e + 8c6c61b commit ff46364

File tree

13 files changed

+377
-20
lines changed

13 files changed

+377
-20
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "peroxide"
3-
version = "0.30.10"
3+
version = "0.30.11"
44
authors = ["axect <[email protected]>"]
55
edition = "2018"
66
description = "Rust comprehensive scientific computation library contains linear algebra, numerical analysis, statistics and machine learning tools with farmiliar syntax"

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ Peroxide can do many things.
128128
* LU Decomposition, Inverse matrix, Block partitioning
129129
* QR Decomposition (`O3` feature)
130130
* Singular Value Decomposition (SVD) (`O3` feature)
131+
* Cholesky Decomposition (`O3` feature)
131132
* Reduced Row Echelon form
132133
* Column, Row operations
133134
* Eigenvalue, Eigenvector
@@ -210,7 +211,7 @@ then Rust become great choice.
210211

211212
## Latest README version
212213

213-
Corresponding to `0.30.2`
214+
Corresponding to `0.30.11`
214215

215216
## Pre-requisite
216217

@@ -265,7 +266,7 @@ Corresponding to `0.30.2`
265266

266267
## Useful tips for features
267268

268-
* If you want to use `QR` or `SVD` then should use `O3` feature (there are no implementations for these decompositions in `default`)
269+
* If you want to use *QR* or *SVD* or *Cholesky Decomposition* then should use `O3` feature (there are no implementations for these decompositions in `default`)
269270
* If you want to write your numerical results, then use `nc` feature and `netcdf` format. (It is much more effective than `csv` and `json`.)
270271
* To plot, use `nc` feature to export data as netcdf format and use python to draw plot.
271272
* `plot` feature has limited plot abilities.

RELEASES.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Release 0.30.11 (2022-02-10)
2+
3+
* Implement Cholesky decomposition in `O3` feature.
4+
* Implement symmetricity check method - `is_symmetric` for Matrix.
5+
16
# Release 0.30.10 (2022-02-05)
27

38
* Update `netcdf` dependency to `0.7`

examples/chebyshev.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use peroxide::fuga::*;
33

44
fn main() {
55
let mut c = chebyshev_polynomial(0, SpecialKind::First);
6+
c.print();
67
for i in 1 .. 11 {
78
c = chebyshev_polynomial(i, SpecialKind::First);
89
c.print();

examples/hessian.rs

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ fn main() {
88

99
let dy = f(x, y);
1010
dy.print();
11+
12+
let dy0 = f(x0, y0);
13+
dy0.print();
1114
}
1215

1316
fn f(x: AD, y: AD) -> AD {

src/fuga/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ pub use crate::statistics::stat::QType::{
170170
pub use crate::structure::matrix::{
171171
Form::{Diagonal, Identity},
172172
SolveKind::{LU, WAZ},
173+
UPLO::{Upper, Lower}
173174
};
174175
pub use crate::structure::dataframe::DType::*;
175176
pub use crate::structure::ad::AD::*;

src/lib.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
//! * Linear Algebra (with BLAS & LAPACK)
88
//! * [Matrix](structure/matrix/index.html) operations
99
//! * `+,-,*,/`
10-
//! * LU, Determinant, Inverse
10+
//! * LU Decomposition, Determinant, Inverse
1111
//! * QR Decomposition (`O3` feature needed)
1212
//! * Singular Value Decomposition (`O3` feature needed)
13+
//! * Cholesky Decomposition (`O3` feature needed)
1314
//! * Reduced Row Echelon Form
1415
//! * [Vector](structure/vector/index.html) operations
1516
//! * [Eigenvalue, Eigenvector](numerical/eigen/index.html) algorithms
@@ -80,7 +81,7 @@
8081
//! ### Cargo.toml
8182
//!
8283
//! * To use `peroxide`, you should edit `Cargo.toml`
83-
//! * Current document version is corresponding to `0.30.2`
84+
//! * Current document version is corresponding to `0.30.11`
8485
//!
8586
//! 1. Default
8687
//! ```toml
@@ -159,7 +160,7 @@
159160
//! ## Useful tips for features
160161
//!
161162
//! * After `0.28.0`, `dataframe` feature is replaced by `nc` feature.
162-
//! * If you want to use `QR` or `SVD` then should use `O3` feature (there are no implementations for these decompositions in `default`)
163+
//! * If you want to use *QR* or *SVD* or *Cholesky Decomposition* then should use `O3` feature (there are no implementations for these decompositions in `default`)
163164
//! * If you want to write your numerical results, then use `nc` feature and `netcdf` format. (It is much more effective than `csv` and `json`.)
164165
//! * After `0.23.0`, there are two options - `fuga`, `prelude`. Choose proper option for your computations.
165166
//! * To plot, use `nc` feature to export data as netcdf format and use python to draw plot.

src/prelude/simpler.rs

+10
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ pub trait SimplerLinearAlgebra {
2727
fn waz_diag(&self) -> Option<matrix::WAZD>;
2828
fn waz(&self) -> Option<matrix::WAZD>;
2929
fn qr(&self) -> matrix::QR;
30+
fn cholesky(&self) -> Matrix;
3031
fn rref(&self) -> Matrix;
3132
fn det(&self) -> f64;
3233
fn block(&self) -> (Matrix, Matrix, Matrix, Matrix);
3334
fn inv(&self) -> Matrix;
3435
fn pseudo_inv(&self) -> Matrix;
3536
fn solve(&self, b: &Vec<f64>) -> Vec<f64>;
3637
fn solve_mat(&self, m: &Matrix) -> Matrix;
38+
fn is_symmetric(&self) -> bool;
3739
}
3840

3941
/// Simple Eigenpair
@@ -115,6 +117,14 @@ impl SimplerLinearAlgebra for Matrix {
115117
fn solve_mat(&self, m: &Matrix) -> Matrix {
116118
matrix::LinearAlgebra::solve_mat(self, m, matrix::SolveKind::LU)
117119
}
120+
121+
fn cholesky(&self) -> Matrix {
122+
matrix::LinearAlgebra::cholesky(self, matrix::UPLO::Lower)
123+
}
124+
125+
fn is_symmetric(&self) -> bool {
126+
matrix::LinearAlgebra::is_symmetric(self)
127+
}
118128
}
119129

120130
/// Simple solve

0 commit comments

Comments
 (0)