From 1ee58d1a5cf9ff3553a9f7f2b4e4b606721f99a2 Mon Sep 17 00:00:00 2001 From: atrayees <121290945+atrayees@users.noreply.github.com> Date: Fri, 5 Jul 2024 20:10:28 +0530 Subject: [PATCH] fix spaces, add function parameter --- include/matrix_operations/EigenvaluesProblems.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/matrix_operations/EigenvaluesProblems.h b/include/matrix_operations/EigenvaluesProblems.h index 33a8ef2e5..7bad48cbc 100644 --- a/include/matrix_operations/EigenvaluesProblems.h +++ b/include/matrix_operations/EigenvaluesProblems.h @@ -442,19 +442,17 @@ class EigenvaluesProblems, E /// Check if a matrix is indeed a correlation matrix /// return true if input matrix is found to be a correlation matrix /// |param[in] matrix - bool is_correlation_matrix(const MT& matrix){ - - const double tol = 1e-8; + bool is_correlation_matrix(const MT& matrix, const double tol = 1e-8){ //check if all the diagonal elements are ones - for(int i=0 ; i tol){ + for (int i=0 ; i tol){ return false; } } //check if the matrix is positive definite - if(isPositiveSemidefinite(matrix)) return true; + if (isPositiveSemidefinite(matrix)) return true; return false; }