예제 #1
0
파일: gsl.c 프로젝트: xushiwei/pure-lang
int gsl_matrix_complex_pow_elements(gsl_matrix_complex* a,
				    const gsl_matrix_complex* b)
{
  size_t i, j;
  const size_t n = a->size1, m = a->size2;
  if (n != b->size1 || m != b->size2)
    return GSL_EBADLEN;
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) {
      gsl_complex *x = (gsl_complex*)(a->data+2*(i*a->tda+j));
      gsl_complex *y = (gsl_complex*)(b->data+2*(i*b->tda+j));
      *x = gsl_complex_pow(*x, *y);
    }
  return GSL_SUCCESS;
}
예제 #2
0
 /** Complex number to the z2 complex order
 \ingroup complex
 \param[in] z1 Complex number
 \param[in] z2 Complex number
 \return \f$ z_1^{z_2} \f$*/
 complex pow(const complex& z1,
             const complex& z2)
 {
   return complex(gsl_complex_pow(z1.as_gsl_type(),
                                  z2.as_gsl_type()));
 }