diff --git a/include/armadillo_bits/unwrap.hpp b/include/armadillo_bits/unwrap.hpp index 29b27b6e..9cc83632 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) == void_ptr(&X)) || (void_ptr(M.mem) == void_ptr(X.mem)); } + arma_inline bool is_alias(const Mat& X) const { return (void_ptr(M.mem) == void_ptr(X.mem)); } }; @@ -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) == void_ptr(&X)) || (void_ptr(M.mem) == void_ptr(X.mem)); } + arma_inline bool is_alias(const Mat& X) const { return (void_ptr(M.mem) == void_ptr(X.mem)); } }; @@ -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) == void_ptr(&X)) || (void_ptr(M.mem) == void_ptr(X.mem)); } + arma_inline bool is_alias(const Mat& X) const { return (void_ptr(M.mem) == void_ptr(X.mem)); } }; @@ -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)) == void_ptr(&X)) : 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.mem) == void_ptr(X.mem)) : false ); } }; @@ -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) == void_ptr(&X)) || (void_ptr(orig.mem) == void_ptr(X.mem)) || (void_ptr(M.mem) == void_ptr(X.mem)); } + arma_inline bool is_alias(const Mat& X) const { return ( (void_ptr(orig.mem) == void_ptr(X.mem)) || (void_ptr(M.mem) == void_ptr(X.mem)) ); } }; @@ -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) == void_ptr(&X)) || (void_ptr(orig.mem) == void_ptr(X.mem)) || (void_ptr(M.mem) == void_ptr(X.mem)); } + arma_inline bool is_alias(const Mat& X) const { return ( (void_ptr(orig.mem) == void_ptr(X.mem)) || (void_ptr(M.mem) == void_ptr(X.mem)) ); } }; @@ -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) == void_ptr(&X)) || (void_ptr(orig.mem) == void_ptr(X.mem)); } + arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); } }; @@ -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) == void_ptr(&X)) || (void_ptr(orig.mem) == void_ptr(X.mem)); } + arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); } }; @@ -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) == void_ptr(&X)) || (void_ptr(orig.mem) == void_ptr(X.mem)); } + arma_inline bool is_alias(const Mat& X) const { return ( (void_ptr(orig.mem) == void_ptr(X.mem)) || (void_ptr(M.mem) == void_ptr(X.mem)) ); } }; @@ -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) == void_ptr(&X)) || (void_ptr(orig.mem) == void_ptr(X.mem)); } + arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); } }; @@ -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) == void_ptr(&X)) || (void_ptr(orig.mem) == void_ptr(X.mem)); } + arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); } }; @@ -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) == void_ptr(&X)) || (void_ptr(orig.mem) == void_ptr(X.mem)); } + arma_inline bool is_alias(const Mat& X) const { return ( (void_ptr(orig.mem) == void_ptr(X.mem)) || (void_ptr(M.mem) == void_ptr(X.mem)) ); } };