Skip to content

Commit

Permalink
2.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
liborty committed Jun 9, 2024
1 parent 38e6eea commit 24b39bd
Show file tree
Hide file tree
Showing 6 changed files with 287 additions and 150 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rstats"
version = "2.1.8"
version = "2.1.9"
authors = ["Libor Spacek"]
edition = "2021"
description = "Statistics, Information Measures, Data Analysis, Linear Algebra, Clifford Algebra, Machine Learning, Geometric Median, Matrix Decompositions, Mahalanobis Distance, Hulls, Multithreading.."
Expand All @@ -22,7 +22,7 @@ maintenance = { status = "actively-developed" }
[dependencies]
rayon = "1"
indxvec = "1"
medians = "3"
ran = "2"
medians = "3"
[dev-dependencies]
times = "1"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ Methods which take an additional generic vector argument, such as a vector of we

## Appendix: Recent Releases

* **Version 2.1.9** - Added multiplications and more tests for `TriangMat`.

* **Version 2.1.8** - Improved `TriangMat::diagonal()`, restored `TriangMat::determinant()`, tidied up `triangmat` test.

* **Version 2.1.7** - Removed suspect eigen values/vectors computations. Improved 'householder' test.
Expand Down
18 changes: 8 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ pub fn sumn(n: usize) -> usize {

/// Generates full nxn unit (identity) matrix
pub fn unit_matrix(n: usize) -> Vec<Vec<f64>> {
let mut res: Vec<Vec<f64>> = Vec::with_capacity(n);
for i in 0..n {
let mut row = vec![0.; n];
row[i] = 1.0;
res.push(row);
}
res
(0..n).map(|i| basis_vec(i,n)).collect()
}

/// Generates basis vector i of n dimensional space
pub fn basis_vec(i: usize, n: usize) -> Vec<f64> {
(0..n).map(|d| if d==i { 1_f64 } else { 0_f64 }).collect()
}

/// Holds measures of central tendency and spread.
Expand Down Expand Up @@ -85,13 +84,12 @@ impl std::fmt::Display for Params {
/// The kind (field) of the TriangMat is encoded as 0..5. This enables
/// trivial transpositions by: `(kind+3) % 6`.
#[derive(Default, Clone)]
pub struct TriangMat {
pub struct TriangMat{
/// Matrix kind encoding: 0=plain, 1=antisymmetric, 2=symmetric, +3=transposed
pub kind: usize,
/// Packed 1d vector of triangular matrix data of size `(n+1)*n/2`
pub data: Vec<f64>,
pub data: Vec<f64>
}

// Traits

/// Statistical measures of a single variable (one generic vector of data) and
Expand Down
Loading

0 comments on commit 24b39bd

Please sign in to comment.