6 #include <symengine/complex_double.h>
13 SYMENGINE_ASSIGN_TYPEID()
19 return real_double(i.real());
24 return real_double(i.imag());
30 double im = -i.imag();
31 return complex_double(std::complex<double>(re, im));
35 hash_t seed = SYMENGINE_COMPLEX_DOUBLE;
36 hash_combine<double>(seed, i.real());
37 hash_combine<double>(seed, i.imag());
43 if (is_a<ComplexDouble>(o)) {
45 return this->i == s.i;
52 SYMENGINE_ASSERT(is_a<ComplexDouble>(o))
56 if (i.real() == s.i.real()) {
57 return i.imag() < s.i.imag() ? -1 : 1;
59 return i.real() < s.i.real() ? -1 : 1;
62 RCP<const ComplexDouble> complex_double(std::complex<double> x)
64 return make_rcp<const ComplexDouble>(x);
67 RCP<const ComplexDouble> complex_double(
double real,
double imag)
69 return make_rcp<const ComplexDouble>(std::complex<double>(real, imag));
The lowest unit of symbolic representation.
Complex Double Class to hold std::complex<double> values.
bool __eq__(const Basic &o) const override
int compare(const Basic &o) const override
RCP< const Basic > conjugate() const override
Get the conjugate of the complex number.
hash_t __hash__() const override
RCP< const Number > real_part() const override
Get the real part of the complex number.
ComplexDouble(std::complex< double > i)
Constructor of ComplexDouble class.
RCP< const Number > imaginary_part() const override
Get the imaginary part of the complex number.
Main namespace for SymEngine package.