-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBaseTypes.h
154 lines (132 loc) · 4.74 KB
/
BaseTypes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#pragma once
#ifndef BASETYPE_H
#define BASETYPE_H
typedef struct {
double real;
double imag;
void Complex64()
{
real = 0;
imag = 0;
}
}Complex64;
typedef struct {
float real;
float imag;
void Complex32()
{
real = 0;
imag = 0;
}
}Complex32;
typedef struct {
long long real;
long long imag;
void ComplexLong()
{
real = 0;
imag = 0;
}
}ComplexLong;
typedef struct {
int real;
int imag;
void ComplexInt()
{
real = 0;
imag = 0;
}
}ComplexInt;
typedef struct {
short real;
short imag;
void ComplexShort()
{
real = 0;
imag = 0;
}
}ComplexShort;
typedef struct {
char real;
char imag;
void ComplexChar()
{
real = 0;
imag = 0;
}
}ComplexChar;
typedef struct{
double real;
double imag;
void TMyComplex()
{
real = 0;
imag = 0;
}
}TMyComplex;
Complex64 operator * (const Complex64 &left, const Complex64 &right);
Complex64 operator * (const Complex64 &left, const ComplexShort &right);
Complex64 operator * (const Complex64 &left, const double &right);
Complex64 operator / (const Complex64 &left, const double &right);
Complex64 operator / (const Complex64 &left, const Complex64 &right);
Complex64 operator + (const Complex64 &left, const Complex64 &right);
Complex64 operator - (const Complex64 &left, const Complex64 &right);
Complex64 operator + (const Complex64 &left, const double &right);
Complex64 operator - (const Complex64 &left, const double &right);
Complex32 operator * (const Complex32 &left, const Complex32 &right);
Complex32 operator * (const Complex32 &left, const ComplexShort &right);
Complex32 operator * (const Complex32 &left, const float &right);
Complex32 operator / (const Complex32 &left, const float &right);
Complex32 operator / (const Complex32 &left, const Complex32 &right);
Complex32 operator + (const Complex32 &left, const Complex32 &right);
Complex32 operator - (const Complex32 &left, const Complex32 &right);
Complex32 operator + (const Complex32 &left, const float &right);
Complex32 operator - (const Complex32 &left, const float &right);
ComplexLong operator * (const ComplexLong &left, const ComplexLong &right);
ComplexLong operator * (const ComplexLong &left, const int &right);
ComplexLong operator / (const ComplexLong &left, const int &right);
ComplexLong operator / (const ComplexLong &left, const ComplexLong &right);
ComplexLong operator + (const ComplexLong &left, const ComplexLong &right);
ComplexLong operator - (const ComplexLong &left, const ComplexLong &right);
ComplexLong operator + (const ComplexLong &left, const int &right);
ComplexLong operator - (const ComplexLong &left, const int &right);
ComplexInt operator * (const ComplexInt &left, const ComplexInt &right);
ComplexInt operator * (const ComplexInt &left, const int &right);
ComplexInt operator / (const ComplexInt &left, const int &right);
ComplexInt operator / (const ComplexInt &left, const ComplexInt &right);
ComplexInt operator + (const ComplexInt &left, const ComplexInt &right);
ComplexInt operator - (const ComplexInt &left, const ComplexInt &right);
ComplexInt operator + (const ComplexInt &left, const int &right);
ComplexInt operator - (const ComplexInt &left, const int &right);
ComplexShort operator * (const ComplexShort &left, const ComplexShort &right);
ComplexShort operator * (const ComplexShort &left, const short &right);
ComplexShort operator / (const ComplexShort &left, const short &right);
ComplexShort operator / (const ComplexShort &left, const int &right);
ComplexShort operator / (const ComplexShort &left, const ComplexShort &right);
ComplexShort operator + (const ComplexShort &left, const ComplexShort &right);
ComplexShort operator - (const ComplexShort &left, const ComplexShort &right);
ComplexShort operator + (const ComplexShort &left, const short &right);
ComplexShort operator - (const ComplexShort &left, const short &right);
ComplexChar operator * (const ComplexChar &left, const ComplexChar &right);
ComplexChar operator * (const ComplexChar &left, const char &right);
ComplexChar operator / (const ComplexChar &left, const char &right);
ComplexChar operator / (const ComplexChar &left, const short &right);
ComplexChar operator / (const ComplexChar &left, const int &right);
ComplexChar operator / (const ComplexChar &left, const ComplexChar &right);
ComplexChar operator + (const ComplexChar &left, const ComplexChar &right);
ComplexChar operator - (const ComplexChar &left, const ComplexChar &right);
ComplexChar operator + (const ComplexChar &left, const char &right);
ComplexChar operator - (const ComplexChar &left, const char &right);
enum HostISA
{
SSE=0,
SSE2=1,
SSE3=2,
SSSE3=3,
SSE4_1=4,
SSE4_2=5,
AVX=6,
AVX2=7,
AVX512=8
};
#endif