From cf2286cb36984024d4f23d6ca96a5cd92f0fe23a Mon Sep 17 00:00:00 2001 From: Nestor Demeure Date: Sun, 3 Nov 2019 09:36:03 +0100 Subject: [PATCH] added assertion --- src/linalg/cholesky.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/linalg/cholesky.rs b/src/linalg/cholesky.rs index 25e632c5..0362f809 100644 --- a/src/linalg/cholesky.rs +++ b/src/linalg/cholesky.rs @@ -156,6 +156,11 @@ where { // heavily inspired by Eigen's `llt_rank_update_lower` implementation https://eigen.tuxfamily.org/dox/LLT_8h_source.html let n = x.nrows(); + assert_eq!( + n, + self.chol.nrows(), + "The input vector must be of the same size as the factorized matrix." + ); let mut x = x.clone_owned(); let mut beta = crate::one::(); for j in 0..n {