From 322f79404631a352c8e74f18c78e2085fced64a0 Mon Sep 17 00:00:00 2001 From: atrayees <121290945+atrayees@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:14:24 +0530 Subject: [PATCH] fixed indentation and code style --- examples/correlation_matrices/sampler.cpp | 27 ++++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/examples/correlation_matrices/sampler.cpp b/examples/correlation_matrices/sampler.cpp index e88e851bb..9a0756ebe 100644 --- a/examples/correlation_matrices/sampler.cpp +++ b/examples/correlation_matrices/sampler.cpp @@ -91,22 +91,27 @@ void write_to_file(std::string filename, std::vector const& randPoint 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){ - return false; - } + const double tol = 1e-8; + + //check if all the diagonal elements are ones + for(int i=0 ; i tol) + { + return false; } + } //check if the matrix is positive definite - Eigen::SelfAdjointEigenSolver eigen_solver(matrix); + Eigen::SelfAdjointEigenSolver eigen_solver(matrix); - if(eigen_solver.info() != Eigen::Success) return false; + if(eigen_solver.info() != Eigen::Success) + { + return false; + } - //the matrix is positive definite if all eigenvalues are positive - return eigen_solver.eigenvalues().minCoeff() > -tol; + //the matrix is positive definite if all eigenvalues are positive + return eigen_solver.eigenvalues().minCoeff() > -tol; } template