From ec7bcc0fd7110332083a4db2b56e4652e8989c06 Mon Sep 17 00:00:00 2001 From: jiri Date: Wed, 2 Feb 2011 09:55:59 +0000 Subject: [PATCH] *** empty log message *** --- nonclass.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/nonclass.cc b/nonclass.cc index 94130a1..1804cec 100644 --- a/nonclass.cc +++ b/nonclass.cc @@ -1523,6 +1523,24 @@ double trace2(const NRMat &a, const NRMat &b, bool trb) return sum; } +// LV +complex trace2(const NRMat > &a, const NRMat > &b, bool adjb) +{ + if (adjb && (a.nrows() != b.nrows() || a.ncols() != b.ncols()) || + !adjb && (a.nrows() != b.ncols() || a.ncols() != b.nrows())) + laerror("incompatible Mats in trace2()"); + + complex dot; + if (adjb) { cblas_zdotc_sub(a.nrows()*a.ncols(), b, 1, a, 1, &dot); return dot; } + + complex sum = complex(0.,0.); + for (int i=0; i &a, const NRSMat &b, const bool diagscaled)