complex.pxd 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # Note: add integer versions of the functions?
  2. cdef extern from "<complex>" namespace "std" nogil:
  3. cdef cppclass complex[T]:
  4. complex() except +
  5. complex(T, T) except +
  6. complex(complex[T]&) except +
  7. # How to make the converting constructor, i.e. convert complex[double]
  8. # to complex[float]?
  9. complex[T] operator+(complex[T]&)
  10. complex[T] operator-(complex[T]&)
  11. complex[T] operator+(complex[T]&, complex[T]&)
  12. complex[T] operator+(complex[T]&, T&)
  13. complex[T] operator+(T&, complex[T]&)
  14. complex[T] operator-(complex[T]&, complex[T]&)
  15. complex[T] operator-(complex[T]&, T&)
  16. complex[T] operator-(T&, complex[T]&)
  17. complex[T] operator*(complex[T]&, complex[T]&)
  18. complex[T] operator*(complex[T]&, T&)
  19. complex[T] operator*(T&, complex[T]&)
  20. complex[T] operator/(complex[T]&, complex[T]&)
  21. complex[T] operator/(complex[T]&, T&)
  22. complex[T] operator/(T&, complex[T]&)
  23. bint operator==(complex[T]&, complex[T]&)
  24. bint operator==(complex[T]&, T&)
  25. bint operator==(T&, complex[T]&)
  26. bint operator!=(complex[T]&, complex[T]&)
  27. bint operator!=(complex[T]&, T&)
  28. bint operator!=(T&, complex[T]&)
  29. # Access real part
  30. T real()
  31. void real(T)
  32. # Access imaginary part
  33. T imag()
  34. void imag(T)
  35. # Return real part
  36. T real[T](complex[T]&)
  37. long double real(long double)
  38. double real(double)
  39. float real(float)
  40. # Return imaginary part
  41. T imag[T](complex[T]&)
  42. long double imag(long double)
  43. double imag(double)
  44. float imag(float)
  45. T abs[T](complex[T]&)
  46. T arg[T](complex[T]&)
  47. long double arg(long double)
  48. double arg(double)
  49. float arg(float)
  50. T norm[T](complex[T])
  51. long double norm(long double)
  52. double norm(double)
  53. float norm(float)
  54. complex[T] conj[T](complex[T]&)
  55. complex[long double] conj(long double)
  56. complex[double] conj(double)
  57. complex[float] conj(float)
  58. complex[T] proj[T](complex[T])
  59. complex[long double] proj(long double)
  60. complex[double] proj(double)
  61. complex[float] proj(float)
  62. complex[T] polar[T](T&, T&)
  63. complex[T] ploar[T](T&)
  64. complex[T] exp[T](complex[T]&)
  65. complex[T] log[T](complex[T]&)
  66. complex[T] log10[T](complex[T]&)
  67. complex[T] pow[T](complex[T]&, complex[T]&)
  68. complex[T] pow[T](complex[T]&, T&)
  69. complex[T] pow[T](T&, complex[T]&)
  70. # There are some promotion versions too
  71. complex[T] sqrt[T](complex[T]&)
  72. complex[T] sin[T](complex[T]&)
  73. complex[T] cos[T](complex[T]&)
  74. complex[T] tan[T](complex[T]&)
  75. complex[T] asin[T](complex[T]&)
  76. complex[T] acos[T](complex[T]&)
  77. complex[T] atan[T](complex[T]&)
  78. complex[T] sinh[T](complex[T]&)
  79. complex[T] cosh[T](complex[T]&)
  80. complex[T] tanh[T](complex[T]&)
  81. complex[T] asinh[T](complex[T]&)
  82. complex[T] acosh[T](complex[T]&)
  83. complex[T] atanh[T](complex[T]&)