diff --git a/include/armadillo_bits/unwrap.hpp b/include/armadillo_bits/unwrap.hpp index 0d7c9441..ded10d8b 100644 --- a/include/armadillo_bits/unwrap.hpp +++ b/include/armadillo_bits/unwrap.hpp @@ -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)) || (void_ptr(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.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.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)); } }; @@ -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)) || (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)); } }; @@ -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)) || (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)); } }; @@ -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)) || (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)); } }; @@ -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)) || (void_ptr(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.mem) == void_ptr(X.mem)) : 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)) || (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)); } 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)) || (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)); } static constexpr bool do_trans = false; 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)) || (void_ptr(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.mem) == void_ptr(X.mem)) : 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)) || (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)); } 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)) || (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)); } static constexpr bool do_trans = true; static constexpr bool do_times = false; @@ -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)) || (void_ptr(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.mem) == void_ptr(X.mem)) : 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)) || (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)); } 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 - 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)) ); } + arma_inline bool is_alias(const Mat& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); } static constexpr bool do_trans = true; static constexpr bool do_times = true; @@ -2143,7 +2143,7 @@ struct partial_unwrap< eOp, eop_scalar_times> > arma_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)) || (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)); } static constexpr bool do_trans = false; static constexpr bool do_times = true; @@ -2350,7 +2350,7 @@ struct partial_unwrap< eOp, eop_neg> > 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)) || (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)); } static constexpr bool do_trans = false; static constexpr bool do_times = true;