From b33dd0294f459b303d9d9776ce2da62e2a4c73f1 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 14 Jan 2024 22:11:56 +0200 Subject: [PATCH] Fix handling of 1-row matrices --- inst/include/rcpp_eigen_interop.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/include/rcpp_eigen_interop.hpp b/inst/include/rcpp_eigen_interop.hpp index 9e6c4b54..f916fff9 100644 --- a/inst/include/rcpp_eigen_interop.hpp +++ b/inst/include/rcpp_eigen_interop.hpp @@ -46,7 +46,7 @@ namespace Rcpp { SEXP eigen_wrap(const T& x) { const static int RTYPE = Rcpp::traits::r_sexptype_traits>::rtype; Rcpp::Vector vec_rtn(Rcpp::wrap(stan::math::to_array_1d(x))); - if (x.cols() > 1) { + if (!stan::is_eigen_col_vector::value) { vec_rtn.attr("dim") = Rcpp::Dimension(x.rows(), x.cols()); } return vec_rtn;