updated complex
This commit is contained in:
@ -18,23 +18,26 @@ namespace cmp
|
||||
__host__ __device__ explicit cucomp128(const double &other);
|
||||
__host__ __device__ explicit cucomp128(const double &_real, const double &_imag);
|
||||
|
||||
__host__ __device__ cucomp128& operator=(cucomp128& other);
|
||||
__host__ __device__ const cucomp128& operator=(const cucomp128& other);
|
||||
__host__ __device__ cucomp128& operator=(double& other);
|
||||
__host__ __device__ const cucomp128& operator=(const double& other);
|
||||
__host__ __device__ cucomp128& operator=(const cucomp128& other);
|
||||
__host__ __device__ cucomp128& operator=(const double& other);
|
||||
|
||||
__host__ __device__ double& operator[](int& ind);
|
||||
__host__ __device__ const double& operator[](const int& ind) const;
|
||||
|
||||
__host__ __device__ cucomp128 operator+(const cucomp128& z);
|
||||
__host__ __device__ cucomp128 operator-(const cucomp128& z);
|
||||
__host__ __device__ cucomp128 operator*(const cucomp128& z);
|
||||
__host__ __device__ cucomp128 operator/(const cucomp128& z);
|
||||
__host__ __device__ cucomp128 operator+(const cucomp128& z) const;
|
||||
__host__ __device__ cucomp128 operator-(const cucomp128& z) const;
|
||||
__host__ __device__ cucomp128 operator*(const cucomp128& z) const;
|
||||
__host__ __device__ cucomp128 operator/(const cucomp128& z) const;
|
||||
|
||||
__host__ __device__ cucomp128 operator+(const double& z);
|
||||
__host__ __device__ cucomp128 operator-(const double& z);
|
||||
__host__ __device__ cucomp128 operator*(const double& z);
|
||||
__host__ __device__ cucomp128 operator/(const double& z);
|
||||
__host__ __device__ friend cucomp128 operator+(const cucomp128& z1, const double& z2);
|
||||
__host__ __device__ friend cucomp128 operator-(const cucomp128& z1, const double& z2);
|
||||
__host__ __device__ friend cucomp128 operator*(const cucomp128& z1, const double& z2);
|
||||
__host__ __device__ friend cucomp128 operator/(const cucomp128& z1, const double& z2);
|
||||
|
||||
__host__ __device__ friend cucomp128 operator+(const double& z1, const cucomp128& z2);
|
||||
__host__ __device__ friend cucomp128 operator-(const double& z1, const cucomp128& z2);
|
||||
__host__ __device__ friend cucomp128 operator*(const double& z1, const cucomp128& z2);
|
||||
__host__ __device__ friend cucomp128 operator/(const double& z1, const cucomp128& z2);
|
||||
|
||||
__host__ __device__ friend cucomp128 operator-(const cucomp128& z); //negation sign
|
||||
|
||||
@ -54,30 +57,42 @@ namespace cmp
|
||||
__host__ __device__ bool iszero() const;
|
||||
__host__ __device__ double arg() const;
|
||||
__host__ __device__ double mag() const;
|
||||
__host__ __device__ double abs() const;
|
||||
__host__ __device__ cucomp128 conj() const;
|
||||
|
||||
//accumulation operators
|
||||
__host__ __device__ cucomp128& operator+=(const cucomp128& z);
|
||||
__host__ __device__ cucomp128& operator-=(const cucomp128& z);
|
||||
__host__ __device__ cucomp128& operator*=(const cucomp128& z);
|
||||
__host__ __device__ cucomp128& operator/=(const cucomp128& z);
|
||||
|
||||
__host__ __device__ cucomp128& operator+=(const double& z);
|
||||
__host__ __device__ cucomp128& operator-=(const double& z);
|
||||
__host__ __device__ cucomp128& operator*=(const double& z);
|
||||
__host__ __device__ cucomp128& operator/=(const double& z);
|
||||
|
||||
};
|
||||
|
||||
__host__ __device__ double arg(cucomp128 z);
|
||||
|
||||
__host__ __device__ double real(cucomp128 z);
|
||||
__host__ __device__ double imag(cucomp128 z);
|
||||
__host__ __device__ cucomp128 sin(cucomp128 z);
|
||||
__host__ __device__ cucomp128 cos(cucomp128 z);
|
||||
__host__ __device__ cucomp128 tan(cucomp128 z);
|
||||
__host__ __device__ cucomp128 exp(cucomp128 z);
|
||||
__host__ __device__ cucomp128 log(cucomp128 z);
|
||||
__host__ __device__ double abs(cucomp128 z);
|
||||
__host__ __device__ cucomp128 conj(cucomp128 z);
|
||||
__host__ __device__ double arg(const cucomp128 &z);
|
||||
__host__ __device__ double real(const cucomp128 &z);
|
||||
__host__ __device__ double imag(const cucomp128 &z);
|
||||
__host__ __device__ cucomp128 sin(const cucomp128 &z);
|
||||
__host__ __device__ cucomp128 cos(const cucomp128 &z);
|
||||
__host__ __device__ cucomp128 tan(const cucomp128 &z);
|
||||
__host__ __device__ cucomp128 exp(const cucomp128 &z);
|
||||
__host__ __device__ cucomp128 log(const cucomp128 &z);
|
||||
__host__ __device__ double abs(const cucomp128 &z);
|
||||
__host__ __device__ cucomp128 conj(const cucomp128 &z);
|
||||
|
||||
// //need hyperbolic trig Functions
|
||||
__host__ __device__ cucomp128 cosh(cucomp128 z);
|
||||
__host__ __device__ cucomp128 sinh(cucomp128 z);
|
||||
__host__ __device__ cucomp128 tanh(cucomp128 z);
|
||||
__host__ __device__ cucomp128 cosh(const cucomp128 &z);
|
||||
__host__ __device__ cucomp128 sinh(const cucomp128 &z);
|
||||
__host__ __device__ cucomp128 tanh(const cucomp128 &z);
|
||||
|
||||
__host__ __device__ cucomp128 pow(cucomp128 z1, cucomp128 z2);
|
||||
__host__ __device__ cucomp128 pow(const cucomp128 &z1, const cucomp128 &z2);
|
||||
|
||||
// //returns "complex sign" of complex number - 0, or a unit number with same argument
|
||||
__host__ __device__ cucomp128 csgn(cucomp128 z);
|
||||
__host__ __device__ cucomp128 csgn(const cucomp128 &z);
|
||||
|
||||
void test_cucomp128_1();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user