*** empty log message ***
This commit is contained in:
parent
2c99357806
commit
47a1a24807
19
nonclass.h
19
nonclass.h
@ -9,8 +9,15 @@
|
||||
|
||||
//MISC
|
||||
export template <class T>
|
||||
const NRSMat<T> twoside_transform(const NRSMat<T> &S, const NRMat<T> &C) //calculate C^dagger S C
|
||||
const NRSMat<T> twoside_transform(const NRSMat<T> &S, const NRMat<T> &C, bool transp=0) //calculate C^dagger S C
|
||||
{
|
||||
if(transp)
|
||||
{
|
||||
NRMat<T> tmp = C * S;
|
||||
NRMat<T> result(C.rows(),C.nrows());
|
||||
result.gemm((T)0,tmp,'n',C,'t',(T)1);
|
||||
return NRSMat<T>(result);
|
||||
}
|
||||
NRMat<T> tmp = S * C;
|
||||
NRMat<T> result(C.ncols(),C.ncols());
|
||||
result.gemm((T)0,C,'t',tmp,'n',(T)1);
|
||||
@ -18,16 +25,6 @@ return NRSMat<T>(result);
|
||||
}
|
||||
|
||||
|
||||
export template <class T>
|
||||
const NRSMat<T> twoside_transform_t(const NRSMat<T> &S, const NRMat<T> &C) //calculate C S C^dagger
|
||||
{
|
||||
NRMat<T> tmp = C * S;
|
||||
NRMat<T> result(C.rows(),C.nrows());
|
||||
result.gemm((T)0,tmp,'n',C,'t',(T)1);
|
||||
return NRSMat<T>(result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export template <class T>
|
||||
|
Loading…
Reference in New Issue
Block a user