示例#1
0
cmat operator/(const cmat &m, const double &s)
{
  it_assert_debug(m.rows() > 0 && m.cols() > 0, "operator/(): Matrix of zero length");

  cmat temp = m;
  for (int i = 0;i < m._datasize();i++) {
    temp._data()[i] /= (double)s;
  }
  return temp;
}
示例#2
0
cmat operator-(const double &s, const cmat &m)
{
  it_assert_debug(m.rows() > 0 && m.cols() > 0, "operator-(): Matrix of zero length");

  cmat temp(m.rows(), m.cols());
  for (int i = 0;i < m._datasize();i++) {
    temp._data()[i] = std::complex<double>((double)s - m(i).real(), -m(i).imag());
  }
  return temp;
}