avoid unnecessary alias checks
This commit is contained in:
@@ -32,6 +32,9 @@ struct op_nonzeros
|
||||
|
||||
template<typename T1>
|
||||
static inline void apply(Mat<typename T1::elem_type>& out, const Op<T1, op_nonzeros>& X);
|
||||
|
||||
template<typename T1>
|
||||
static inline void apply(Mat_noalias<typename T1::elem_type>& out, const Op<T1, op_nonzeros>& X);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -100,4 +100,20 @@ op_nonzeros::apply(Mat<typename T1::elem_type>& out, const Op<T1, op_nonzeros>&
|
||||
|
||||
|
||||
|
||||
template<typename T1>
|
||||
inline
|
||||
void
|
||||
op_nonzeros::apply(Mat_noalias<typename T1::elem_type>& out, const Op<T1, op_nonzeros>& X)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
const Proxy<T1> P(X.m);
|
||||
|
||||
if(P.get_n_elem() == 0) { out.set_size(0,1); return; }
|
||||
|
||||
op_nonzeros::apply_noalias(out, P);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
@@ -34,6 +34,9 @@ struct spglue_join_cols
|
||||
template<typename T1, typename T2>
|
||||
inline static void apply(SpMat<typename T1::elem_type>& out, const SpGlue<T1,T2,spglue_join_cols>& X);
|
||||
|
||||
template<typename T1, typename T2>
|
||||
inline static void apply(SpMat_noalias<typename T1::elem_type>& out, const SpGlue<T1,T2,spglue_join_cols>& X);
|
||||
|
||||
template<typename eT>
|
||||
inline static void apply_noalias(SpMat<eT>& out, const SpMat<eT>& A, const SpMat<eT>& B);
|
||||
|
||||
@@ -59,6 +62,9 @@ struct spglue_join_rows
|
||||
template<typename T1, typename T2>
|
||||
inline static void apply(SpMat<typename T1::elem_type>& out, const SpGlue<T1,T2,spglue_join_rows>& X);
|
||||
|
||||
template<typename T1, typename T2>
|
||||
inline static void apply(SpMat_noalias<typename T1::elem_type>& out, const SpGlue<T1,T2,spglue_join_rows>& X);
|
||||
|
||||
template<typename eT>
|
||||
inline static void apply_noalias(SpMat<eT>& out, const SpMat<eT>& A, const SpMat<eT>& B);
|
||||
|
||||
|
||||
@@ -49,6 +49,21 @@ spglue_join_cols::apply(SpMat<typename T1::elem_type>& out, const SpGlue<T1,T2,s
|
||||
|
||||
|
||||
|
||||
template<typename T1, typename T2>
|
||||
inline
|
||||
void
|
||||
spglue_join_cols::apply(SpMat_noalias<typename T1::elem_type>& out, const SpGlue<T1,T2,spglue_join_cols>& X)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
const unwrap_spmat<T1> UA(X.A);
|
||||
const unwrap_spmat<T2> UB(X.B);
|
||||
|
||||
spglue_join_cols::apply_noalias(out, UA.M, UB.M);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
void
|
||||
@@ -177,6 +192,10 @@ spglue_join_cols::apply(SpMat<eT>& out, const SpBase<eT,T1>& A_expr, const SpBas
|
||||
|
||||
|
||||
|
||||
//
|
||||
|
||||
|
||||
|
||||
template<typename T1, typename T2>
|
||||
inline
|
||||
void
|
||||
@@ -205,6 +224,21 @@ spglue_join_rows::apply(SpMat<typename T1::elem_type>& out, const SpGlue<T1,T2,s
|
||||
|
||||
|
||||
|
||||
template<typename T1, typename T2>
|
||||
inline
|
||||
void
|
||||
spglue_join_rows::apply(SpMat_noalias<typename T1::elem_type>& out, const SpGlue<T1,T2,spglue_join_rows>& X)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
const unwrap_spmat<T1> UA(X.A);
|
||||
const unwrap_spmat<T2> UB(X.B);
|
||||
|
||||
spglue_join_rows::apply_noalias(out, UA.M, UB.M);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user