Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
23da62b9
Commit
23da62b9
authored
Mar 25, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add C++ declarations for std::complex type (proposed by Nick Foti)
parent
699c8113
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
101 additions
and
0 deletions
+101
-0
Cython/Includes/libcpp/complex.pxd
Cython/Includes/libcpp/complex.pxd
+101
-0
No files found.
Cython/Includes/libcpp/complex.pxd
0 → 100644
View file @
23da62b9
# Note: add integer versions of the functions?
cdef
extern
from
"<complex>"
namespace
"std"
nogil
:
cdef
cppclass
complex
[
T
]:
complex
()
except
+
complex
(
T
,
T
)
except
+
complex
(
complex
[
T
]
&
)
except
+
# How to make the converting constructor, i.e. convert complex[double]
# to complex[float]?
complex
[
T
]
operator
+
(
complex
[
T
]
&
)
complex
[
T
]
operator
-
(
complex
[
T
]
&
)
complex
[
T
]
operator
+
(
complex
[
T
]
&
,
complex
[
T
]
&
)
complex
[
T
]
operator
+
(
complex
[
T
]
&
,
T
&
)
complex
[
T
]
operator
+
(
T
&
,
complex
[
T
]
&
)
complex
[
T
]
operator
-
(
complex
[
T
]
&
,
complex
[
T
]
&
)
complex
[
T
]
operator
-
(
complex
[
T
]
&
,
T
&
)
complex
[
T
]
operator
-
(
T
&
,
complex
[
T
]
&
)
complex
[
T
]
operator
*
(
complex
[
T
]
&
,
complex
[
T
]
&
)
complex
[
T
]
operator
*
(
complex
[
T
]
&
,
T
&
)
complex
[
T
]
operator
*
(
T
&
,
complex
[
T
]
&
)
complex
[
T
]
operator
/
(
complex
[
T
]
&
,
complex
[
T
]
&
)
complex
[
T
]
operator
/
(
complex
[
T
]
&
,
T
&
)
complex
[
T
]
operator
/
(
T
&
,
complex
[
T
]
&
)
bint
operator
==
(
complex
[
T
]
&
,
complex
[
T
]
&
)
bint
operator
==
(
complex
[
T
]
&
,
T
&
)
bint
operator
==
(
T
&
,
complex
[
T
]
&
)
bint
operator
!=
(
complex
[
T
]
&
,
complex
[
T
]
&
)
bint
operator
!=
(
complex
[
T
]
&
,
T
&
)
bint
operator
!=
(
T
&
,
complex
[
T
]
&
)
# Access real part
T
real
()
void
real
(
T
)
# Access imaginary part
T
image
()
void
image
(
T
)
# Return real part
T
real
(
complex
[
T
]
&
)
long
double
real
(
long
double
)
double
real
(
double
)
float
real
(
float
)
# Return imaginary part
T
imag
(
complex
[
T
]
&
)
long
double
imag
(
long
double
)
double
imag
(
double
)
float
imag
(
float
)
T
abs
(
complex
[
T
]
&
)
T
arg
(
complex
[
T
]
&
)
long
double
arg
(
long
double
)
double
arg
(
double
)
float
arg
(
float
)
T
norm
(
complex
[
T
])
long
double
norm
(
long
double
)
double
norm
(
double
)
float
norm
(
float
)
complex
[
T
]
conj
(
complex
[
T
]
&
)
complex
[
long
double
]
conj
(
long
double
)
complex
[
double
]
conj
(
double
)
complex
[
float
]
conj
(
float
)
complex
[
T
]
proj
(
complex
[
T
])
complex
[
long
double
]
proj
(
long
double
)
complex
[
double
]
proj
(
double
)
complex
[
float
]
proj
(
float
)
complex
[
T
]
polar
(
T
&
,
T
&
)
complex
[
T
]
ploar
(
T
&
)
complex
[
T
]
exp
(
complex
[
T
]
&
)
complex
[
T
]
log
(
complex
[
T
]
&
)
complex
[
T
]
log10
(
complex
[
T
]
&
)
complex
[
T
]
pow
(
complex
[
T
]
&
,
complex
[
T
]
&
)
complex
[
T
]
pow
(
complex
[
T
]
&
,
T
&
)
complex
[
T
]
pow
(
T
&
,
complex
[
T
]
&
)
# There are some promotion versions too
complex
[
T
]
sqrt
(
complex
[
T
]
&
)
complex
[
T
]
sin
(
complex
[
T
]
&
)
complex
[
T
]
cos
(
complex
[
T
]
&
)
complex
[
T
]
tan
(
complex
[
T
]
&
)
complex
[
T
]
asin
(
complex
[
T
]
&
)
complex
[
T
]
acos
(
complex
[
T
]
&
)
complex
[
T
]
atan
(
complex
[
T
]
&
)
complex
[
T
]
sinh
(
complex
[
T
]
&
)
complex
[
T
]
cosh
(
complex
[
T
]
&
)
complex
[
T
]
tanh
(
complex
[
T
]
&
)
complex
[
T
]
asinh
(
complex
[
T
]
&
)
complex
[
T
]
acosh
(
complex
[
T
]
&
)
complex
[
T
]
atanh
(
complex
[
T
]
&
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment