/third_party/mindspore/tests/ut/cpp/base/ |
D | complex_test.cc | 29 ASSERT_EQ(sizeof(Complex<float>), 2 * sizeof(float)); in TEST_F() 30 ASSERT_EQ(sizeof(Complex<double>), 2 * sizeof(double)); in TEST_F() 31 ASSERT_EQ(alignof(Complex<float>), 2 * sizeof(float)); in TEST_F() 32 ASSERT_EQ(alignof(Complex<double>), 2 * sizeof(double)); in TEST_F() 39 ASSERT_EQ(Complex<T>().real(), T()); in test_construct() 40 ASSERT_EQ(Complex<T>().imag(), T()); in test_construct() 41 ASSERT_EQ(Complex<T>(real, imag).real(), real); in test_construct() 42 ASSERT_EQ(Complex<T>(real, imag).imag(), imag); in test_construct() 43 ASSERT_EQ(Complex<T>(real).real(), real); in test_construct() 44 ASSERT_EQ(Complex<T>(real).imag(), T()); in test_construct() [all …]
|
/third_party/mindspore/mindspore/ccsrc/utils/ |
D | complex.h | 36 struct alignas(sizeof(T) * 2) Complex { struct 37 Complex() = default; 38 ~Complex() = default; 40 Complex(const Complex<T> &other) noexcept = default; 41 Complex(Complex<T> &&other) noexcept = default; 43 Complex &operator=(const Complex<T> &other) noexcept = default; argument 44 Complex &operator=(Complex<T> &&other) noexcept = default; argument 46 …HOST_DEVICE inline constexpr Complex(const T &real, const T &imag = T()) : real_(real), imag_(imag… in real_() argument 49 …inline explicit constexpr Complex(const std::complex<U> &other) : Complex(other.real(), other.imag… in Complex() function 55 …HOST_DEVICE inline explicit constexpr Complex(const float16 &real) : real_(static_cast<T>(real)), … in Complex() argument [all …]
|
/third_party/boost/libs/math/example/ |
D | daubechies_coefficients.cpp | 36 template<class Complex> 37 std::vector<std::pair<Complex, Complex>> find_roots(size_t p) in find_roots() 41 typedef typename Complex::value_type Real; in find_roots() 42 std::vector<Complex> coeffs(p); in find_roots() 45 coeffs[k] = Complex(binomial_coefficient<Real>(p-1+k, k), 0); in find_roots() 48 polynomial<Complex> P(std::move(coeffs)); in find_roots() 49 polynomial<Complex> Pcopy = P; in find_roots() 50 polynomial<Complex> Pcopy_prime = P.prime(); in find_roots() 51 … auto orig = [&](Complex z) { return std::make_pair<Complex, Complex>(Pcopy(z), Pcopy_prime(z)); }; in find_roots() 53 polynomial<Complex> P_prime = P.prime(); in find_roots() [all …]
|
/third_party/boost/libs/math/example/daubechies_wavelets/ |
D | daubechies_coefficients.cpp | 44 template<class Complex> 45 std::vector<std::pair<Complex, Complex>> find_roots(size_t p) in find_roots() 49 typedef typename Complex::value_type Real; in find_roots() 50 std::vector<Complex> coeffs(p); in find_roots() 53 coeffs[k] = Complex(binomial_coefficient<Real>(p-1+k, k), 0); in find_roots() 56 polynomial<Complex> P(std::move(coeffs)); in find_roots() 57 polynomial<Complex> Pcopy = P; in find_roots() 58 polynomial<Complex> Pcopy_prime = P.prime(); in find_roots() 59 … auto orig = [&](Complex z) { return std::make_pair<Complex, Complex>(Pcopy(z), Pcopy_prime(z)); }; in find_roots() 61 polynomial<Complex> P_prime = P.prime(); in find_roots() [all …]
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/math/ |
D | broadcast_complex_gpu_kernel.cc | 33 using Complex = mindspore::utils::Complex<T>; typedef 34 MS_REG_BROADCAST_COMPLEX_GPU_KERNEL(Add, kNumberTypeComplex64, kNumberTypeFloat32, Complex<float>, … 35 MS_REG_BROADCAST_COMPLEX_GPU_KERNEL(Add, kNumberTypeComplex128, kNumberTypeFloat64, Complex<double>… 36 MS_REG_BROADCAST_COMPLEX_GPU_KERNEL(Sub, kNumberTypeComplex64, kNumberTypeFloat32, Complex<float>, … 37 MS_REG_BROADCAST_COMPLEX_GPU_KERNEL(Sub, kNumberTypeComplex128, kNumberTypeFloat64, Complex<double>… 38 MS_REG_BROADCAST_COMPLEX_GPU_KERNEL(Mul, kNumberTypeComplex64, kNumberTypeFloat32, Complex<float>, … 39 MS_REG_BROADCAST_COMPLEX_GPU_KERNEL(Mul, kNumberTypeComplex128, kNumberTypeFloat64, Complex<double>… 40 MS_REG_BROADCAST_COMPLEX_GPU_KERNEL(Div, kNumberTypeComplex64, kNumberTypeFloat32, Complex<float>, … 41 MS_REG_BROADCAST_COMPLEX_GPU_KERNEL(Div, kNumberTypeComplex128, kNumberTypeFloat64, Complex<double>… 42 MS_REG_BROADCAST_COMPLEX_GPU_KERNEL(RealDiv, kNumberTypeComplex64, kNumberTypeFloat32, Complex<floa… [all …]
|
D | unary_op_complex_gpu_kernel.h | 31 using Complex = mindspore::utils::Complex<T>; variable 44 Complex<T> *input_addr = GetDeviceAddress<Complex<T>>(inputs, 0); in Launch() 49 Real(input_addr, output_addr, inputs[0]->size / sizeof(Complex<T>), in Launch() 54 Imag(input_addr, output_addr, inputs[0]->size / sizeof(Complex<T>), in Launch() 63 Complex<T> *output_addr = GetDeviceAddress<Complex<T>>(outputs, 0); in Launch() 66 Conj(input_addr, output_addr, inputs[0]->size / sizeof(Complex<T>), in Launch() 108 input_size_ = sizeof(Complex<T>); in ResetResource() 109 output_size_ = sizeof(Complex<T>); in ResetResource()
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/cuda_impl/ |
D | cast_impl.cu | 120 template void Cast(const int input_size, const int8_t *input_addr, Complex<float> *output_addr, cud… 121 template void Cast(const int input_size, const int8_t *input_addr, Complex<double> *output_addr, cu… 135 template void Cast(const int input_size, const int16_t *input_addr, Complex<float> *output_addr, cu… 136 template void Cast(const int input_size, const int16_t *input_addr, Complex<double> *output_addr, c… 151 template void Cast(const int input_size, const int32_t *input_addr, Complex<float> *output_addr, cu… 152 template void Cast(const int input_size, const int32_t *input_addr, Complex<double> *output_addr, c… 167 template void Cast(const int input_size, const int64_t *input_addr, Complex<float> *output_addr, cu… 168 template void Cast(const int input_size, const int64_t *input_addr, Complex<double> *output_addr, c… 182 template void Cast(const int input_size, const uint8_t *input_addr, Complex<float> *output_addr, cu… 183 template void Cast(const int input_size, const uint8_t *input_addr, Complex<double> *output_addr, c… [all …]
|
D | broadcast_impl.cu | 160 …__device__ __host__ __forceinline__ Complex<T> operator()(const Complex<T> &lhs, const T &rhs) { r… in operator ()() 161 …__device__ __host__ __forceinline__ Complex<T> operator()(const T &lhs, const Complex<T> &rhs) { r… in operator ()() 162 …__device__ __host__ __forceinline__ Complex<T> operator()(const Complex<T> &lhs, const Complex<T> … in operator ()() 170 …__device__ __host__ __forceinline__ Complex<T> operator()(const Complex<T> &lhs, const T &rhs) { r… in operator ()() 171 …__device__ __host__ __forceinline__ Complex<T> operator()(const T &lhs, const Complex<T> &rhs) { r… in operator ()() 172 …__device__ __host__ __forceinline__ Complex<T> operator()(const Complex<T> &lhs, const Complex<T> … in operator ()() 180 …__device__ __host__ __forceinline__ Complex<T> operator()(const Complex<T> &lhs, const T &rhs) { r… in operator ()() 181 …__device__ __host__ __forceinline__ Complex<T> operator()(const T &lhs, const Complex<T> &rhs) { r… in operator ()() 182 …__device__ __host__ __forceinline__ Complex<T> operator()(const Complex<T> &lhs, const Complex<T> … in operator ()() 190 …__device__ __host__ __forceinline__ Complex<T> operator()(const Complex<T> &lhs, const T &rhs) { r… in operator ()() [all …]
|
D | unary_op_impl.cuh | 69 void Real(const Complex<T> *input, T *output, const size_t count, cudaStream_t cuda_stream); 71 void Imag(const Complex<T> *input, T *output, const size_t count, cudaStream_t cuda_stream); 73 void Conj(const Complex<T> *input, Complex<T> *output, const size_t count, cudaStream_t cuda_stream…
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/arrays/ |
D | cast_gpu_kernel.cc | 46 using Complex = mindspore::utils::Complex<T>; typedef 48 CastGpuKernel, int8_t, Complex<float>) 50 CastGpuKernel, int8_t, Complex<double>) 77 CastGpuKernel, int16_t, Complex<float>) 79 CastGpuKernel, int16_t, Complex<double>) 106 CastGpuKernel, int32_t, Complex<float>) 108 CastGpuKernel, int32_t, Complex<double>) 135 CastGpuKernel, int64_t, Complex<float>) 137 CastGpuKernel, int64_t, Complex<double>) 164 CastGpuKernel, uint8_t, Complex<float>) [all …]
|
/third_party/boost/libs/math/test/ |
D | test_trapezoidal.cpp | 29 template<class Complex> 32 … the adaptive trapezoidal routine on type " << boost::typeindex::type_id<Complex>().pretty_name() … in test_complex_bessel() 33 typedef typename Complex::value_type Real; in test_complex_bessel() 34 Complex z{2, 3}; in test_complex_bessel() 37 auto bessel_integrand = [&n, &z](Real theta)->Complex in test_complex_bessel() 43 Complex arg = z*t1 + t2; in test_complex_bessel() 51 Complex Jnz = trapezoidal<decltype(bessel_integrand), Real>(bessel_integrand, a, b); in test_complex_bessel() 62 template<class Complex> 65 … the adaptive trapezoidal routine on type " << boost::typeindex::type_id<Complex>().pretty_name() … in test_I0_complex() 66 typedef typename Complex::value_type Real; in test_I0_complex() [all …]
|
D | test_roots.cpp | 441 template <class Complex> 444 typedef typename Complex::value_type Real; in test_complex_newton() 454 polynomial<Complex> p{{1,0}, {0, 0}, {1,0}}; in test_complex_newton() 455 Complex guess{1,1}; in test_complex_newton() 456 polynomial<Complex> p_prime = p.prime(); in test_complex_newton() 457 auto f = [&](Complex z) { return std::make_pair<Complex, Complex>(p(z), p_prime(z)); }; in test_complex_newton() 458 Complex root = complex_newton(f, guess); in test_complex_newton() 471 p = polynomial<Complex>({{-1,0}, {0,-2}, {1,0}}); in test_complex_newton() 474 auto g = [&](Complex z) { return std::make_pair<Complex, Complex>(p(z), p_prime(z)); }; in test_complex_newton() 481 p = polynomial<Complex>({{1,0}, {0,1}, {1,0}}); in test_complex_newton() [all …]
|
D | norms_test.cpp | 160 template<class Complex> 163 typedef typename Complex::value_type Real; in test_complex_lp() 165 std::vector<Complex> v{{1,0}, {0,0}, {0,0}}; in test_complex_lp() 172 v = generate_random_vector<Complex>(global_size, global_seed); in test_complex_lp() 225 template<class Complex> 228 using Real = typename Complex::value_type; in test_complex_lp_distance() 231 std::vector<Complex> u{{1,0},{0,0},{0,0}}; in test_complex_lp_distance() 232 std::vector<Complex> v{{0,0},{0,0},{0,0}}; in test_complex_lp_distance() 240 v = generate_random_vector<Complex>(global_size, global_seed); in test_complex_lp_distance() 241 u = generate_random_vector<Complex>(global_size, global_seed + 1); in test_complex_lp_distance() [all …]
|
D | sinh_sinh_quadrature_test.cpp | 233 template<class Complex> 236 typedef typename Complex::value_type Real; in test_dirichlet_eta() 239 Complex Q; in test_dirichlet_eta() 243 Complex z = {1,1}; in test_dirichlet_eta() 244 auto eta = [&z](Real t)->Complex { in test_dirichlet_eta() 248 Complex i = {0,1}; in test_dirichlet_eta() 249 Complex num = pow((Real)1/ (Real)2 + i*t, -z); in test_dirichlet_eta() 251 Complex res = num/denom; in test_dirichlet_eta() 256 …Complex Q_expected = {boost::lexical_cast<Real>("0.72655977506246326320149572854724138631112950273… in test_dirichlet_eta()
|
D | signal_statistics_test.cpp | 108 template<class Complex> 111 typedef typename Complex::value_type Real; in test_complex_hoyer_sparsity() 114 std::vector<Complex> v{{0,1}, {0, 0}, {0,0}}; in test_complex_hoyer_sparsity() 231 template<class Complex> 234 using Real = typename Complex::value_type; in test_complex_oracle_snr() 239 std::vector<Complex> signal(length, {1,0}); in test_complex_oracle_snr() 240 std::vector<Complex> noisy_signal = signal; in test_complex_oracle_snr() 242 noisy_signal[0] += Complex(1,0); in test_complex_oracle_snr()
|
/third_party/python/Doc/library/ |
D | numbers.rst | 5 :synopsis: Numeric abstract base classes (Complex, Real, Integral, etc.). 25 .. class:: Complex 48 To :class:`Complex`, :class:`Real` adds the operations that work on real 55 Real also provides defaults for :func:`complex`, :attr:`~Complex.real`, 56 :attr:`~Complex.imag`, and :meth:`~Complex.conjugate`. 110 those. You can add ``MyFoo`` between :class:`Complex` and 113 class MyFoo(Complex): ... 147 elif isinstance(other, Complex): 154 of :class:`Complex`. I'll refer to all of the above code that doesn't 157 of :class:`Complex` (``a : A <: Complex``), and ``b : B <: [all …]
|
/third_party/mindspore/mindspore/core/ir/dtype/ |
D | number.h | 154 class MS_CORE_API Complex : public Number { 156 Complex() : Number(kNumberTypeComplex64, 64, false) {} in Complex() function 157 explicit Complex(const int nbits); 158 ~Complex() override {} in ~Complex() 159 MS_DECLARE_PARENT(Complex, Number) in MS_DECLARE_PARENT() argument 162 TypePtr DeepCopy() const override { return std::make_shared<Complex>(nbits()); } in DeepCopy() 184 inline const TypePtr kComplex64 = std::make_shared<Complex>(static_cast<int>(BitsNum::eBits64)); 185 inline const TypePtr kComplex128 = std::make_shared<Complex>(static_cast<int>(BitsNum::eBits128));
|
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/sponge/pme/ |
D | ifft_3d_kernel.h | 30 using Complex = mindspore::utils::Complex<T>; variable 56 auto input_tensor = GetDeviceAddress<Complex<T>>(inputs, 0); in Launch() 66 input_size_list_.push_back(Nfft * sizeof(Complex<T>)); in InitSizeLists()
|
D | fft_3d_kernel.h | 30 using Complex = mindspore::utils::Complex<T>; variable 57 auto output_tensor = GetDeviceAddress<Complex<T>>(outputs, 0); in Launch() 67 output_size_list_.push_back(Nfft * sizeof(Complex<T>)); in InitSizeLists()
|
/third_party/boost/boost/math/tools/ |
D | roots.hpp | 780 template<class Complex, class F> 781 Complex complex_newton(F g, Complex guess, int max_iterations = std::numeric_limits<typename Comple… in complex_newton() 783 typedef typename Complex::value_type Real; in complex_newton() 788 Complex z0 = guess + Complex(1, 0); in complex_newton() 789 Complex z1 = guess + Complex(0, 1); in complex_newton() 790 Complex z2 = guess; in complex_newton() 797 Complex q = (z2 - z1) / (z1 - z0); in complex_newton() 800 Complex qp1 = static_cast<Complex>(1) + q; in complex_newton() 801 Complex A = q * (pair.first - qp1 * P1.first + q * P0.first); in complex_newton() 803 …Complex B = (static_cast<Complex>(2) * q + static_cast<Complex>(1)) * pair.first - qp1 * qp1 * P1.… in complex_newton() [all …]
|
/third_party/boost/libs/multiprecision/example/ |
D | complex128_examples.cpp | 15 template<class Complex> 18 Complex z1{0, 1}; in complex_number_examples() 19 std::cout << std::setprecision(std::numeric_limits<typename Complex::value_type>::digits10); in complex_number_examples() 31 typename Complex::value_type r = 1; in complex_number_examples() 32 typename Complex::value_type theta = 0.8; in complex_number_examples()
|
D | mpc_examples.cpp | 15 template<class Complex> 18 Complex z1{0, 1}; in complex_number_examples() 19 std::cout << std::setprecision(std::numeric_limits<typename Complex::value_type>::digits10); in complex_number_examples() 31 typename Complex::value_type r = 1; in complex_number_examples() 32 typename Complex::value_type theta = 0.8; in complex_number_examples()
|
D | cpp_complex_examples.cpp | 15 template<class Complex> 18 Complex z1{0, 1}; in complex_number_examples() 19 std::cout << std::setprecision(std::numeric_limits<typename Complex::value_type>::digits10); in complex_number_examples() 31 typename Complex::value_type r = 1; in complex_number_examples() 32 typename Complex::value_type theta = 0.8; in complex_number_examples()
|
/third_party/quickjs/ |
D | qjscalc.js | 27 var Integer, Float, Fraction, Complex, Mod, Polynomial, PolyMod, RationalFunction, Series, Matrix; variable 599 return Complex(this).log(); 697 return Complex(this).log(); 706 Complex = function Complex(re, im) class 711 if (re instanceof Complex) 716 obj = Object.create(Complex.prototype); 724 a = Complex(a); 725 b = Complex(b); 726 return Complex.toComplex(a.re + b.re, a.im + b.im); 729 a = Complex(a); [all …]
|
/third_party/python/Lib/test/ |
D | test_abstract_numbers.py | 6 from numbers import Complex, Real, Rational, Integral 11 self.assertTrue(issubclass(int, Complex)) 31 self.assertTrue(issubclass(complex, Complex))
|