mul_gemv.hpp (armadillo-10.8.2.tar.xz) | : | mul_gemv.hpp (armadillo-11.0.0.tar.xz) | ||
---|---|---|---|---|
skipping to change at line 194 | skipping to change at line 194 | |||
val_real += (a*c) - (b*d); | val_real += (a*c) - (b*d); | |||
val_imag += (a*d) + (b*c); | val_imag += (a*d) + (b*c); | |||
} | } | |||
return std::complex<T>(val_real, val_imag); | return std::complex<T>(val_real, val_imag); | |||
} | } | |||
}; | }; | |||
//! \brief | //! \brief | |||
//! Partial emulation of ATLAS/BLAS gemv(). | //! Partial emulation of BLAS gemv(). | |||
//! 'y' is assumed to have been set to the correct size (ie. taking into account the transpose) | //! 'y' is assumed to have been set to the correct size (ie. taking into account the transpose) | |||
template<const bool do_trans_A=false, const bool use_alpha=false, const bool use _beta=false> | template<const bool do_trans_A=false, const bool use_alpha=false, const bool use _beta=false> | |||
class gemv_emul | class gemv_emul | |||
{ | { | |||
public: | public: | |||
template<typename eT, typename TA> | template<typename eT, typename TA> | |||
arma_hot | arma_hot | |||
inline | inline | |||
skipping to change at line 275 | skipping to change at line 275 | |||
op_htrans::apply_mat_noalias(AA, A); | op_htrans::apply_mat_noalias(AA, A); | |||
gemv_emul<false, use_alpha, use_beta>::apply(y, AA, x, alpha, beta); | gemv_emul<false, use_alpha, use_beta>::apply(y, AA, x, alpha, beta); | |||
} | } | |||
} | } | |||
} | } | |||
}; | }; | |||
//! \brief | //! \brief | |||
//! Wrapper for ATLAS/BLAS gemv function, using template arguments to control th e arguments passed to gemv. | //! Wrapper for BLAS gemv function, using template arguments to control the argu ments passed to gemv. | |||
//! 'y' is assumed to have been set to the correct size (ie. taking into account the transpose) | //! 'y' is assumed to have been set to the correct size (ie. taking into account the transpose) | |||
template<const bool do_trans_A=false, const bool use_alpha=false, const bool use _beta=false> | template<const bool do_trans_A=false, const bool use_alpha=false, const bool use _beta=false> | |||
class gemv | class gemv | |||
{ | { | |||
public: | public: | |||
template<typename eT, typename TA> | template<typename eT, typename TA> | |||
inline | inline | |||
static | static | |||
skipping to change at line 309 | skipping to change at line 309 | |||
arma_debug_assert_atlas_size(A); | arma_debug_assert_atlas_size(A); | |||
if(is_cx<eT>::no) | if(is_cx<eT>::no) | |||
{ | { | |||
// use gemm() instead of gemv() to work around a speed issue in Atlas 3.8.4 | // use gemm() instead of gemv() to work around a speed issue in Atlas 3.8.4 | |||
arma_extra_debug_print("atlas::cblas_gemm()"); | arma_extra_debug_print("atlas::cblas_gemm()"); | |||
atlas::cblas_gemm<eT> | atlas::cblas_gemm<eT> | |||
( | ( | |||
atlas::CblasColMajor, | atlas_CblasColMajor, | |||
(do_trans_A) ? ( is_cx<eT>::yes ? CblasConjTrans : atlas::CblasTrans | (do_trans_A) ? ( is_cx<eT>::yes ? atlas_CblasConjTrans : atlas_Cblas | |||
) : atlas::CblasNoTrans, | Trans ) : atlas_CblasNoTrans, | |||
atlas::CblasNoTrans, | atlas_CblasNoTrans, | |||
(do_trans_A) ? A.n_cols : A.n_rows, | (do_trans_A) ? A.n_cols : A.n_rows, | |||
1, | 1, | |||
(do_trans_A) ? A.n_rows : A.n_cols, | (do_trans_A) ? A.n_rows : A.n_cols, | |||
(use_alpha) ? alpha : eT(1), | (use_alpha) ? alpha : eT(1), | |||
A.mem, | A.mem, | |||
A.n_rows, | A.n_rows, | |||
x, | x, | |||
(do_trans_A) ? A.n_rows : A.n_cols, | (do_trans_A) ? A.n_rows : A.n_cols, | |||
(use_beta) ? beta : eT(0), | (use_beta) ? beta : eT(0), | |||
y, | y, | |||
(do_trans_A) ? A.n_cols : A.n_rows | (do_trans_A) ? A.n_cols : A.n_rows | |||
); | ); | |||
} | } | |||
else | else | |||
{ | { | |||
arma_extra_debug_print("atlas::cblas_gemv()"); | arma_extra_debug_print("atlas::cblas_gemv()"); | |||
atlas::cblas_gemv<eT> | atlas::cblas_gemv<eT> | |||
( | ( | |||
atlas::CblasColMajor, | atlas_CblasColMajor, | |||
(do_trans_A) ? ( is_cx<eT>::yes ? CblasConjTrans : atlas::CblasTrans | (do_trans_A) ? ( is_cx<eT>::yes ? atlas_CblasConjTrans : atlas_Cblas | |||
) : atlas::CblasNoTrans, | Trans ) : atlas_CblasNoTrans, | |||
A.n_rows, | A.n_rows, | |||
A.n_cols, | A.n_cols, | |||
(use_alpha) ? alpha : eT(1), | (use_alpha) ? alpha : eT(1), | |||
A.mem, | A.mem, | |||
A.n_rows, | A.n_rows, | |||
x, | x, | |||
1, | 1, | |||
(use_beta) ? beta : eT(0), | (use_beta) ? beta : eT(0), | |||
y, | y, | |||
1 | 1 | |||
End of changes. 4 change blocks. | ||||
9 lines changed or deleted | 9 lines changed or added |