armadillo how to get rid of error message
Running the following code still produces an error message that goes to stdout (not stderr) although the exception was successfully caught: Mat<double> matrix_quantiles(const vector<double> & quantiles, const Mat<double> & m) { Mat<double> sorted_matrix; try { sorted_matrix = arma::sort(arma::cor(m)); } catch(std::logic_error & e) { /* Sometimes a col is constant, causing the correlation to be infinite. If that happens, add normal random jitter to the values and retry. */ const Mat<double> jitter = Mat<double>( m.n_rows, m.n_cols, arma::fill::randn); return matrix_quantiles(quantiles, 1.e-3 *