Skip to content

Commit

Permalink
Fix handling of 1-row matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Jan 14, 2024
1 parent 429b648 commit b33dd02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inst/include/rcpp_eigen_interop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace Rcpp {
SEXP eigen_wrap(const T& x) {
const static int RTYPE = Rcpp::traits::r_sexptype_traits<stan::scalar_type_t<T>>::rtype;
Rcpp::Vector<RTYPE> vec_rtn(Rcpp::wrap(stan::math::to_array_1d(x)));
if (x.cols() > 1) {
if (!stan::is_eigen_col_vector<T>::value) {
vec_rtn.attr("dim") = Rcpp::Dimension(x.rows(), x.cols());
}
return vec_rtn;
Expand Down

0 comments on commit b33dd02

Please sign in to comment.