From 669db3d7768b3b94d31d6552a1012ee29f54b8d8 Mon Sep 17 00:00:00 2001 From: Chen-Pang He Date: Sun, 9 Sep 2012 02:55:10 +0800 Subject: Extend rank-1 updates for different storage orders. --- blas/GeneralRank1Update.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'blas/GeneralRank1Update.h') diff --git a/blas/GeneralRank1Update.h b/blas/GeneralRank1Update.h index a3301ed92..6d33fbcc1 100644 --- a/blas/GeneralRank1Update.h +++ b/blas/GeneralRank1Update.h @@ -13,15 +13,28 @@ namespace internal { /* Optimized matrix += alpha * uv' */ -template -struct general_rank1_update +template +struct general_rank1_update; + +template +struct general_rank1_update { static void run(Index rows, Index cols, Scalar* mat, Index stride, const Scalar* u, const Scalar* v, Scalar alpha) { - typedef Matrix PlainVector; internal::conj_if cj; + typedef Map > OtherMap; + typedef typename internal::conditional::type ConjRhsType; for (Index i=0; i(mat+stride*i,rows) += alpha * cj(v[i]) * Map(u,rows); + Map >(mat+stride*i,rows) += alpha * cj(v[i]) * ConjRhsType(OtherMap(u,rows)); + } +}; + +template +struct general_rank1_update +{ + static void run(Index rows, Index cols, Scalar* mat, Index stride, const Scalar* u, const Scalar* v, Scalar alpha) + { + general_rank1_update::run(rows,cols,mat,stride,u,v,alpha); } }; -- cgit v1.2.3