QUDA
1.0.0
Main Page
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Variables
a
b
c
d
e
f
g
i
k
l
m
n
o
p
q
r
s
t
u
v
Typedefs
Enumerations
+
Enumerator
a
b
c
d
e
h
i
k
m
n
p
q
r
+
Classes
Class List
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
c
f
g
i
n
r
s
t
v
Related Functions
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
d
m
q
t
+
Enumerations
i
q
+
Enumerator
e
q
t
x
y
z
+
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
w
x
y
z
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
tests
short.h
Go to the documentation of this file.
1
#ifndef _SHORT_H
2
#define _SHORT_H
3
4
#define SHORT_LENGTH 65536
5
#define SCALE_FLOAT ((SHORT_LENGTH-1) * 0.5)
6
#define SHIFT_FLOAT (-1.f / (SHORT_LENGTH-1))
7
8
template
<
typename
Float>
9
inline
short
FloatToShort
(Float a) {
10
//return (short)(a*MAX_SHORT);
11
short
rtn = (short)((a+
SHIFT_FLOAT
)*
SCALE_FLOAT
);
12
return
rtn;
13
}
14
15
template
<
typename
Float>
16
inline
Float
shortToFloat
(
short
a) {
17
Float rtn = (float)a/
SCALE_FLOAT
-
SHIFT_FLOAT
;
18
return
rtn;
19
}
20
21
#endif // _SHORT_H
SCALE_FLOAT
#define SCALE_FLOAT
Definition:
short.h:5
shortToFloat
Float shortToFloat(short a)
Definition:
short.h:16
SHIFT_FLOAT
#define SHIFT_FLOAT
Definition:
short.h:6
FloatToShort
short FloatToShort(Float a)
Definition:
short.h:9
Generated by
1.8.13