示例#1
0
//Y <- a M X + b Y
// ----------------------------------------------------------------------
int zgemv(cpx alpha, const CpxNumMat& A, const CpxNumVec& X, cpx beta, CpxNumVec& Y)
{
  assert(Y.m() == A.m());
  assert(A.n() == X.m());
  char trans = 'N';
  int m = A.m();  int n = A.n();
  int incx = 1;  int incy = 1;
  zgemv_(&trans, &m, &n, &alpha, A.data(), &m, X.data(), &incx, &beta, Y.data(), &incy);
  return 0;
}
示例#2
0
inline float energy(CpxNumVec& m)
{
  float val=0;
  cpx* data = m.data();
  for(int i=0; i<m.m(); i++) {	 //val += data[i].re*data[i].re + data[i].im*data[i].im;
	 val += norm(data[i]);
  }
  return val;
}