Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed Jan 14, 2024
1 parent 345c1be commit 429b648
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions inst/include/rcpp_eigen_interop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ namespace Rcpp {
Rcpp::internal::export_indexing<Eigen::Matrix<T, R, 1>, T>(object, result);
return result;
} else {
Shield<SEXP> dims( ::Rf_getAttrib( object, R_DimSymbol ) );
if( Rf_isNull(dims) || Rf_length(dims) != 2 ){
throw ::Rcpp::not_a_matrix();
Shield<SEXP> dims(Rf_getAttrib(object, R_DimSymbol));
if (Rf_isNull(dims) || Rf_length(dims) != 2) {
throw Rcpp::not_a_matrix();
}
int* dims_ = INTEGER(dims);
Eigen::Matrix<T, R, C> result(dims_[0],dims_[1]);
Eigen::Matrix<T, R, C> result(dims_[0], dims_[1]);
T* result_data = result.data();
Rcpp::internal::export_indexing<T*, T>(object, result_data);
return result;
Expand All @@ -44,7 +44,7 @@ namespace Rcpp {
namespace RcppEigen {
template <typename T>
SEXP eigen_wrap(const T& x) {
const static int RTYPE = ::Rcpp::traits::r_sexptype_traits<stan::scalar_type_t<T>>::rtype;
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) {
vec_rtn.attr("dim") = Rcpp::Dimension(x.rows(), x.cols());
Expand Down

0 comments on commit 429b648

Please sign in to comment.