simplifications

This commit is contained in:
conrad
2022-06-07 23:36:55 +10:00
parent 2059fc3b3b
commit 08138bf06c
+16 -16
View File
@@ -372,7 +372,7 @@ struct quasi_unwrap< subview<eT> >
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<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& 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<eT2>& 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<eT> >
static constexpr bool has_orig_mem = true;
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& 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<eT2>& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
};
@@ -442,7 +442,7 @@ struct quasi_unwrap< subview_cols<eT> >
static constexpr bool has_orig_mem = true;
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& 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<eT2>& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
};
@@ -584,7 +584,7 @@ struct quasi_unwrap< Op<subview_col<eT>, op_strans> >
static constexpr bool has_orig_mem = true;
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& 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<eT2>& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
};
@@ -744,7 +744,7 @@ struct quasi_unwrap_subview_col_htrans< Op<subview_col<eT>, op_htrans> >
static constexpr bool has_orig_mem = true;
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& 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<eT2>& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
};
@@ -1352,7 +1352,7 @@ struct partial_unwrap< subview<eT> >
constexpr eT get_val() const { return eT(1); }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& 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<eT2>& 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<eT> >
constexpr eT get_val() const { return eT(1); }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& 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<eT2>& 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<eT> >
constexpr eT get_val() const { return eT(1); }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& 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<eT2>& 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<eT>, op_htrans> >
constexpr eT get_val() const { return eT(1); }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& 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<eT2>& 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<eT>, op_htrans> >
constexpr eT get_val() const { return eT(1); }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& 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<eT2>& 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<eT>, op_htrans> >
constexpr eT get_val() const { return eT(1); }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& 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<eT2>& 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<eT>, op_htrans2> >
inline eT get_val() const { return val; }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& 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<eT2>& 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<eT>, op_htrans2> >
inline eT get_val() const { return val; }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& 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<eT2>& 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<eT>, op_htrans2> >
inline eT get_val() const { return val; }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& 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<eT2>& 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<subview_col<eT>, eop_scalar_times> >
arma_inline eT get_val() const { return val; }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& 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<eT2>& 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<subview_col<eT>, eop_neg> >
constexpr eT get_val() const { return eT(-1); }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& 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<eT2>& X) const { return (void_ptr(orig.mem) == void_ptr(X.mem)); }
static constexpr bool do_trans = false;
static constexpr bool do_times = true;