diff --git a/docs.html b/docs.html
index 0bf98dcc..df0523df 100644
--- a/docs.html
+++ b/docs.html
@@ -19506,7 +19506,6 @@ List of additions and changes for each version:
- faster handling of sparse submatrix column views by norm(), accu(), nonzeros()
- extended randu() and randn() to allow specification of distribution parameters
-- stricter handling of aliasing involving matrices that directly use auxiliary memory
diff --git a/include/armadillo_bits/Proxy.hpp b/include/armadillo_bits/Proxy.hpp
index 70f43e89..cc1b7512 100644
--- a/include/armadillo_bits/Proxy.hpp
+++ b/include/armadillo_bits/Proxy.hpp
@@ -188,7 +188,7 @@ struct Proxy< Mat >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Mat& X) const { return (is_same_type::value) ? (void_ptr(Q.mem) == void_ptr(X.mem)): false; }
+ arma_inline bool is_alias(const Mat& X) const { return (is_same_type::value) ? (void_ptr(&Q) == void_ptr(&X)) : false; }
template
arma_inline bool has_overlap(const subview& X) const { return is_alias(X.m); }
@@ -235,7 +235,7 @@ struct Proxy< Col >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Mat& X) const { return (is_same_type::value) ? (void_ptr(Q.mem) == void_ptr(X.mem)) : false; }
+ arma_inline bool is_alias(const Mat& X) const { return (is_same_type::value) ? (void_ptr(&Q) == void_ptr(&X)) : false; }
template
arma_inline bool has_overlap(const subview& X) const { return is_alias(X.m); }
@@ -282,7 +282,7 @@ struct Proxy< Row >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Mat& X) const { return (is_same_type::value) ? (void_ptr(Q.mem) == void_ptr(X.mem)): false; }
+ arma_inline bool is_alias(const Mat& X) const { return (is_same_type::value) ? (void_ptr(&Q) == void_ptr(&X)) : false; }
template
arma_inline bool has_overlap(const subview& X) const { return is_alias(X.m); }
@@ -966,7 +966,7 @@ struct Proxy< subview >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Mat& X) const { return (is_same_type::value) ? (void_ptr(Q.m.mem) == void_ptr(X.mem)) : false; }
+ arma_inline bool is_alias(const Mat& X) const { return (is_same_type::value) ? (void_ptr(&(Q.m)) == void_ptr(&X)) : false; }
template
arma_inline bool has_overlap(const subview& X) const { return Q.check_overlap(X); }
@@ -1013,7 +1013,7 @@ struct Proxy< subview_col >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Mat& X) const { return (is_same_type::value) ? (void_ptr(Q.m.mem) == void_ptr(X.mem)) : false; }
+ arma_inline bool is_alias(const Mat& X) const { return (is_same_type::value) ? (void_ptr(&(Q.m)) == void_ptr(&X)) : false; }
template
arma_inline bool has_overlap(const subview& X) const { return Q.check_overlap(X); }
@@ -1062,7 +1062,7 @@ struct Proxy< subview_cols >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Mat& X) const { return (is_same_type::value) ? (void_ptr(sv.m.mem) == void_ptr(X.mem)) : false; }
+ arma_inline bool is_alias(const Mat& X) const { return (is_same_type::value) ? (void_ptr(&(sv.m)) == void_ptr(&X)) : false; }
template
arma_inline bool has_overlap(const subview& X) const { return sv.check_overlap(X); }
@@ -1109,7 +1109,7 @@ struct Proxy< subview_row >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Mat& X) const { return (is_same_type::value) ? (void_ptr(Q.m.mem) == void_ptr(X.mem)): false; }
+ arma_inline bool is_alias(const Mat& X) const { return (is_same_type::value) ? (void_ptr(&(Q.m)) == void_ptr(&X)) : false; }
template
arma_inline bool has_overlap(const subview& X) const { return Q.check_overlap(X); }
@@ -1257,7 +1257,7 @@ struct Proxy< diagview >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Mat& X) const { return (is_same_type::value) ? (void_ptr(Q.m.mem) == void_ptr(X.mem)) : false; }
+ arma_inline bool is_alias(const Mat& X) const { return (is_same_type::value) ? (void_ptr(&(Q.m)) == void_ptr(&X)) : false; }
template
arma_inline bool has_overlap(const subview& X) const { return is_alias(X.m); }
@@ -1313,7 +1313,7 @@ struct Proxy_diagvec_mat< Op >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(R.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&R) == void_ptr(&X)); }
template
arma_inline bool has_overlap(const subview& X) const { return is_alias(X.m); }
@@ -1490,7 +1490,7 @@ struct Proxy_xtrans_default< Op >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(U.M.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return void_ptr(&(U.M)) == void_ptr(&X); }
template
arma_inline bool has_overlap(const subview& X) const { return is_alias(X.m); }
@@ -1531,7 +1531,7 @@ struct Proxy_xtrans_default< Op >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(U.M.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return void_ptr(&(U.M)) == void_ptr(&X); }
template
arma_inline bool has_overlap(const subview& X) const { return is_alias(X.m); }
@@ -1997,7 +1997,7 @@ struct Proxy< Op< Row< std::complex >, op_htrans> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(src.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return void_ptr(&src) == void_ptr(&X); }
template
arma_inline bool has_overlap(const subview& X) const { return is_alias(X.m); }
@@ -2048,7 +2048,7 @@ struct Proxy< Op< Col< std::complex >, op_htrans> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(src.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return void_ptr(&src) == void_ptr(&X); }
template
arma_inline bool has_overlap(const subview& X) const { return is_alias(X.m); }
@@ -2099,7 +2099,7 @@ struct Proxy< Op< subview_col< std::complex >, op_htrans> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(src.m.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return void_ptr(&src.m) == void_ptr(&X); }
template
arma_inline bool has_overlap(const subview& X) const { return is_alias(X.m); }
@@ -2394,7 +2394,7 @@ struct Proxy_vectorise_col_mat< Op >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(U.M.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return ( void_ptr(&X) == void_ptr(&(U.M)) ); }
template
arma_inline bool has_overlap(const subview& X) const { return is_alias(X.m); }
diff --git a/include/armadillo_bits/ProxyCube.hpp b/include/armadillo_bits/ProxyCube.hpp
index 488e3272..ef639284 100644
--- a/include/armadillo_bits/ProxyCube.hpp
+++ b/include/armadillo_bits/ProxyCube.hpp
@@ -70,7 +70,7 @@ struct ProxyCube< Cube >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Cube& X) const { return (void_ptr(Q.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Cube& X) const { return (void_ptr(&Q) == void_ptr(&X)); }
template
arma_inline bool has_overlap(const subview_cube& X) const { return is_alias(X.m); }
@@ -250,7 +250,7 @@ struct ProxyCube< subview_cube >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template
- arma_inline bool is_alias(const Cube& X) const { return (void_ptr(Q.m.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Cube& X) const { return (void_ptr(&(Q.m)) == void_ptr(&X)); }
template
arma_inline bool has_overlap(const subview_cube& X) const { return Q.check_overlap(X); }
diff --git a/include/armadillo_bits/diagmat_proxy.hpp b/include/armadillo_bits/diagmat_proxy.hpp
index 04db8ef4..262dd958 100644
--- a/include/armadillo_bits/diagmat_proxy.hpp
+++ b/include/armadillo_bits/diagmat_proxy.hpp
@@ -201,7 +201,7 @@ class diagmat_proxy< Mat >
arma_inline elem_type operator[] (const uword i) const { return P_is_vec ? P[i] : P.at(i,i); }
arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? ( P_is_vec ? P[row] : P.at(row,row) ) : elem_type(0); }
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(P.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&P)); }
const Mat& P;
const bool P_is_vec;
@@ -232,7 +232,7 @@ class diagmat_proxy< Row >
arma_inline elem_type operator[] (const uword i) const { return P[i]; }
arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? P[row] : elem_type(0); }
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(P.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&P)); }
static constexpr bool P_is_vec = true;
@@ -264,7 +264,7 @@ class diagmat_proxy< Col >
arma_inline elem_type operator[] (const uword i) const { return P[i]; }
arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? P[row] : elem_type(0); }
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(P.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&P)); }
static constexpr bool P_is_vec = true;
@@ -296,7 +296,7 @@ class diagmat_proxy< subview_row >
arma_inline elem_type operator[] (const uword i) const { return P[i]; }
arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? P[row] : elem_type(0); }
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(P.m.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&(P.m))); }
static constexpr bool P_is_vec = true;
@@ -328,7 +328,7 @@ class diagmat_proxy< subview_col >
arma_inline elem_type operator[] (const uword i) const { return P[i]; }
arma_inline elem_type at (const uword row, const uword col) const { return (row == col) ? P[row] : elem_type(0); }
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(P.m.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&(P.m))); }
static constexpr bool P_is_vec = true;
diff --git a/include/armadillo_bits/unwrap.hpp b/include/armadillo_bits/unwrap.hpp
index ded10d8b..4e935067 100644
--- a/include/armadillo_bits/unwrap.hpp
+++ b/include/armadillo_bits/unwrap.hpp
@@ -303,7 +303,7 @@ struct quasi_unwrap< Mat >
static constexpr bool has_orig_mem = true;
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(M.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&M) == void_ptr(&X)); }
};
@@ -326,7 +326,7 @@ struct quasi_unwrap< Row >
static constexpr bool has_orig_mem = true;
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(M.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&M) == void_ptr(&X)); }
};
@@ -348,7 +348,7 @@ struct quasi_unwrap< Col >
static constexpr bool has_orig_mem = true;
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(M.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&M) == void_ptr(&X)); }
};
@@ -372,7 +372,7 @@ struct quasi_unwrap< subview >
static constexpr bool has_orig_mem = false; // NOTE: set to false as this is the general case; original memory is only used when the subview is a contiguous chunk
template
- arma_inline bool is_alias(const Mat& X) const { return ( ((sv.aux_row1 == 0) && (sv.n_rows == sv.m.n_rows)) ? (void_ptr(sv.m.mem) == void_ptr(X.mem)) : false ); }
+ arma_inline bool is_alias(const Mat& X) const { return ( ((sv.aux_row1 == 0) && (sv.n_rows == sv.m.n_rows)) ? (void_ptr(&(sv.m)) == void_ptr(&X)) : false ); }
};
@@ -405,7 +405,7 @@ struct quasi_unwrap< subview_col >
inline
quasi_unwrap(const subview_col& A)
: orig( A.m )
- , M ( const_cast( A.colmem ), A.n_rows, false, false )
+ , M ( const_cast( A.colmem ), A.n_rows, false, false )
{
arma_extra_debug_sigprint();
}
@@ -418,7 +418,7 @@ struct quasi_unwrap< subview_col >
static constexpr bool has_orig_mem = true;
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&orig) == void_ptr(&X)); }
};
@@ -442,7 +442,7 @@ struct quasi_unwrap< subview_cols >
static constexpr bool has_orig_mem = true;
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&orig) == void_ptr(&X)); }
};
@@ -536,7 +536,7 @@ struct quasi_unwrap< Op, op_strans> >
static constexpr bool has_orig_mem = true;
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&orig) == void_ptr(&X)); }
};
@@ -560,7 +560,7 @@ struct quasi_unwrap< Op, op_strans> >
static constexpr bool has_orig_mem = true;
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&orig) == void_ptr(&X)); }
};
@@ -584,7 +584,7 @@ struct quasi_unwrap< Op, op_strans> >
static constexpr bool has_orig_mem = true;
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&orig)); }
};
@@ -616,7 +616,7 @@ struct quasi_unwrap_Col_htrans< Op, op_htrans> >
static constexpr bool has_orig_mem = true;
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&orig) == void_ptr(&X)); }
};
@@ -680,7 +680,7 @@ struct quasi_unwrap_Row_htrans< Op, op_htrans> >
static constexpr bool has_orig_mem = true;
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&orig) == void_ptr(&X)); }
};
@@ -744,7 +744,7 @@ struct quasi_unwrap_subview_col_htrans< Op, op_htrans> >
static constexpr bool has_orig_mem = true;
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&orig) == void_ptr(&X)); }
};
@@ -1276,7 +1276,7 @@ struct partial_unwrap< Mat >
constexpr eT get_val() const { return eT(1); }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(M.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&M)); }
static constexpr bool do_trans = false;
static constexpr bool do_times = false;
@@ -1301,7 +1301,7 @@ struct partial_unwrap< Row >
constexpr eT get_val() const { return eT(1); }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(M.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&M)); }
static constexpr bool do_trans = false;
static constexpr bool do_times = false;
@@ -1326,7 +1326,7 @@ struct partial_unwrap< Col >
constexpr eT get_val() const { return eT(1); }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(M.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&M)); }
static constexpr bool do_trans = false;
static constexpr bool do_times = false;
@@ -1352,7 +1352,7 @@ struct partial_unwrap< subview >
constexpr eT get_val() const { return eT(1); }
template
- arma_inline bool is_alias(const Mat& X) const { return ( ((sv.aux_row1 == 0) && (sv.n_rows == sv.m.n_rows)) ? (void_ptr(sv.m.mem) == void_ptr(X.mem)) : false ); }
+ arma_inline bool is_alias(const Mat& X) const { return ( ((sv.aux_row1 == 0) && (sv.n_rows == sv.m.n_rows)) ? (void_ptr(&(sv.m)) == void_ptr(&X)) : false ); }
static constexpr bool do_trans = false;
static constexpr bool do_times = false;
@@ -1379,7 +1379,7 @@ struct partial_unwrap< subview_col >
constexpr eT get_val() const { return eT(1); }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&orig)); }
static constexpr bool do_trans = false;
static constexpr bool do_times = false;
@@ -1406,7 +1406,7 @@ struct partial_unwrap< subview_cols >
constexpr eT get_val() const { return eT(1); }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&orig)); }
static constexpr bool do_trans = false;
static constexpr bool do_times = false;
@@ -1528,7 +1528,7 @@ struct partial_unwrap< Op< Mat, op_htrans> >
constexpr eT get_val() const { return eT(1); }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(M.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&M)); }
static constexpr bool do_trans = true;
static constexpr bool do_times = false;
@@ -1553,7 +1553,7 @@ struct partial_unwrap< Op< Row, op_htrans> >
constexpr eT get_val() const { return eT(1); }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(M.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&M)); }
static constexpr bool do_trans = true;
static constexpr bool do_times = false;
@@ -1578,7 +1578,7 @@ struct partial_unwrap< Op< Col, op_htrans> >
constexpr eT get_val() const { return eT(1); }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(M.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&M)); }
static constexpr bool do_trans = true;
static constexpr bool do_times = false;
@@ -1604,7 +1604,7 @@ struct partial_unwrap< Op< subview, op_htrans> >
constexpr eT get_val() const { return eT(1); }
template
- arma_inline bool is_alias(const Mat& X) const { return ( ((sv.aux_row1 == 0) && (sv.n_rows == sv.m.n_rows)) ? (void_ptr(sv.m.mem) == void_ptr(X.mem)) : false ); }
+ arma_inline bool is_alias(const Mat& X) const { return ( ((sv.aux_row1 == 0) && (sv.n_rows == sv.m.n_rows)) ? (void_ptr(&(sv.m)) == void_ptr(&X)) : false ); }
static constexpr bool do_trans = true;
static constexpr bool do_times = false;
@@ -1631,7 +1631,7 @@ struct partial_unwrap< Op< subview_cols, op_htrans> >
constexpr eT get_val() const { return eT(1); }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&orig) == void_ptr(&X)); }
static constexpr bool do_trans = true;
static constexpr bool do_times = false;
@@ -1658,7 +1658,7 @@ struct partial_unwrap< Op< subview_col, op_htrans> >
constexpr eT get_val() const { return eT(1); }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&orig)); }
static constexpr bool do_trans = true;
static constexpr bool do_times = false;
@@ -1785,7 +1785,7 @@ struct partial_unwrap< Op< Mat, op_htrans2> >
inline eT get_val() const { return val; }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(M.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&M)); }
static constexpr bool do_trans = true;
static constexpr bool do_times = true;
@@ -1812,7 +1812,7 @@ struct partial_unwrap< Op< Row, op_htrans2> >
inline eT get_val() const { return val; }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(M.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&M)); }
static constexpr bool do_trans = true;
static constexpr bool do_times = true;
@@ -1839,7 +1839,7 @@ struct partial_unwrap< Op< Col, op_htrans2> >
inline eT get_val() const { return val; }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(M.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&X) == void_ptr(&M)); }
static constexpr bool do_trans = true;
static constexpr bool do_times = true;
@@ -1867,7 +1867,7 @@ struct partial_unwrap< Op< subview, op_htrans2> >
inline eT get_val() const { return val; }
template
- arma_inline bool is_alias(const Mat& X) const { return ( ((sv.aux_row1 == 0) && (sv.n_rows == sv.m.n_rows)) ? (void_ptr(sv.m.mem) == void_ptr(X.mem)) : false ); }
+ arma_inline bool is_alias(const Mat& X) const { return ( ((sv.aux_row1 == 0) && (sv.n_rows == sv.m.n_rows)) ? (void_ptr(&(sv.m)) == void_ptr(&X)) : false ); }
static constexpr bool do_trans = true;
static constexpr bool do_times = true;
@@ -1896,7 +1896,7 @@ struct partial_unwrap< Op< subview_cols, op_htrans2> >
inline eT get_val() const { return val; }
template
- arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
+ arma_inline bool is_alias(const Mat& X) const { return (void_ptr(&orig) == void_ptr(&X)); }
static constexpr bool do_trans = true;
static constexpr bool do_times = true;
@@ -1925,7 +1925,7 @@ struct partial_unwrap< Op< subview_col, op_htrans2> >
inline eT get_val() const { return val; }
template