From 47a1a24807c6021d4a42de19a72860e1bad8c1f6 Mon Sep 17 00:00:00 2001 From: jiri Date: Tue, 15 Aug 2006 20:29:01 +0000 Subject: [PATCH] *** empty log message *** --- nonclass.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/nonclass.h b/nonclass.h index 24f5503..52b8a4a 100644 --- a/nonclass.h +++ b/nonclass.h @@ -9,8 +9,15 @@ //MISC export template -const NRSMat twoside_transform(const NRSMat &S, const NRMat &C) //calculate C^dagger S C +const NRSMat twoside_transform(const NRSMat &S, const NRMat &C, bool transp=0) //calculate C^dagger S C { +if(transp) + { + NRMat tmp = C * S; + NRMat result(C.rows(),C.nrows()); + result.gemm((T)0,tmp,'n',C,'t',(T)1); + return NRSMat(result); + } NRMat tmp = S * C; NRMat result(C.ncols(),C.ncols()); result.gemm((T)0,C,'t',tmp,'n',(T)1); @@ -18,16 +25,6 @@ return NRSMat(result); } -export template -const NRSMat twoside_transform_t(const NRSMat &S, const NRMat &C) //calculate C S C^dagger -{ -NRMat tmp = C * S; -NRMat result(C.rows(),C.nrows()); -result.gemm((T)0,tmp,'n',C,'t',(T)1); -return NRSMat(result); -} - - export template