Skip to content

Commit f6844ba

Browse files
committed
fix bug in matrix operator=
We were accidentally grabbing the SEXP from the current object rather than the other object.
1 parent b138780 commit f6844ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

inst/include/Rcpp/api/meat/Matrix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace Rcpp{
6262

6363
template <int RTYPE, template <class> class StoragePolicy >
6464
Matrix<RTYPE, StoragePolicy>& Matrix<RTYPE,StoragePolicy>::operator=(const Matrix& other) {
65-
SEXP x = VECTOR::get__() ;
65+
SEXP x = other.get__() ;
6666
if( ! ::Rf_isMatrix(x) ) not_compatible("not a matrix") ;
6767
VECTOR::set__( x ) ;
6868
nrows = other.nrows ;

0 commit comments

Comments
 (0)