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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
a0d13cb1
Commit
a0d13cb1
authored
Apr 17, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
346243fe
4e5f0365
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
82 additions
and
60 deletions
+82
-60
Cython/Includes/libcpp/deque.pxd
Cython/Includes/libcpp/deque.pxd
+4
-4
Cython/Includes/libcpp/list.pxd
Cython/Includes/libcpp/list.pxd
+8
-8
Cython/Includes/libcpp/map.pxd
Cython/Includes/libcpp/map.pxd
+6
-6
Cython/Includes/libcpp/set.pxd
Cython/Includes/libcpp/set.pxd
+11
-11
Cython/Includes/libcpp/unordered_map.pxd
Cython/Includes/libcpp/unordered_map.pxd
+11
-11
Cython/Includes/libcpp/unordered_set.pxd
Cython/Includes/libcpp/unordered_set.pxd
+11
-11
Cython/Includes/libcpp/vector.pxd
Cython/Includes/libcpp/vector.pxd
+9
-9
tests/run/libcpp_all.pyx
tests/run/libcpp_all.pyx
+22
-0
No files found.
Cython/Includes/libcpp/deque.pxd
View file @
a0d13cb1
...
...
@@ -12,8 +12,8 @@ cdef extern from "<deque>" namespace "std" nogil:
iterator
operator
--
()
bint
operator
==
(
reverse_iterator
)
bint
operator
!=
(
reverse_iterator
)
#
cppclass const_iterator(iterator):
#
pass
cppclass
const_iterator
(
iterator
):
pass
#cppclass const_reverse_iterator(reverse_iterator):
# pass
deque
()
except
+
...
...
@@ -34,11 +34,11 @@ cdef extern from "<deque>" namespace "std" nogil:
T
&
at
(
size_t
)
T
&
back
()
iterator
begin
()
#const_iterator begin
()
const_iterator
const_begin
"begin"
()
void
clear
()
bint
empty
()
iterator
end
()
#const_iterator end
()
const_iterator
const_end
"end"
()
iterator
erase
(
iterator
)
iterator
erase
(
iterator
,
iterator
)
T
&
front
()
...
...
Cython/Includes/libcpp/list.pxd
View file @
a0d13cb1
...
...
@@ -16,10 +16,10 @@ cdef extern from "<list>" namespace "std" nogil:
reverse_iterator
operator
--
()
bint
operator
==
(
reverse_iterator
)
bint
operator
!=
(
reverse_iterator
)
#
cppclass const_iterator(iterator):
#
pass
#
cppclass const_reverse_iterator(reverse_iterator):
#
pass
cppclass
const_iterator
(
iterator
):
pass
cppclass
const_reverse_iterator
(
reverse_iterator
):
pass
list
()
except
+
list
(
list
&
)
except
+
list
(
size_t
,
T
&
)
except
+
...
...
@@ -33,11 +33,11 @@ cdef extern from "<list>" namespace "std" nogil:
void
assign
(
size_t
,
T
&
)
T
&
back
()
iterator
begin
()
#const_iterator begin
()
const_iterator
const_begin
"begin"
()
void
clear
()
bint
empty
()
iterator
end
()
#const_iterator end
()
const_iterator
const_end
"end"
()
iterator
erase
(
iterator
)
iterator
erase
(
iterator
,
iterator
)
T
&
front
()
...
...
@@ -51,11 +51,11 @@ cdef extern from "<list>" namespace "std" nogil:
void
push_back
(
T
&
)
void
push_front
(
T
&
)
reverse_iterator
rbegin
()
#const_reverse_iterator rbegin
()
const_reverse_iterator
const_rbegin
"rbegin"
()
void
remove
(
T
&
)
#void remove_if(UnPred)
reverse_iterator
rend
()
#const_reverse_iterator rend
()
const_reverse_iterator
const_rend
"rend"
()
void
resize
(
size_t
,
T
&
)
void
reverse
()
size_t
size
()
...
...
Cython/Includes/libcpp/map.pxd
View file @
a0d13cb1
...
...
@@ -20,8 +20,8 @@ cdef extern from "<map>" namespace "std" nogil:
iterator
operator
--
()
bint
operator
==
(
reverse_iterator
)
bint
operator
!=
(
reverse_iterator
)
#
cppclass const_reverse_iterator(reverse_iterator):
#
pass
cppclass
const_reverse_iterator
(
reverse_iterator
):
pass
map
()
except
+
map
(
map
&
)
except
+
#map(key_compare&)
...
...
@@ -53,14 +53,14 @@ cdef extern from "<map>" namespace "std" nogil:
#void insert(input_iterator, input_iterator)
#key_compare key_comp()
iterator
lower_bound
(
const
T
&
)
#const_iterator lower_bound(const key_type
&)
const_iterator
const_lower_bound
"lower_bound"
(
const
T
&
)
size_t
max_size
()
reverse_iterator
rbegin
()
#const_reverse_iterator rbegin
()
const_reverse_iterator
const_rbegin
"rbegin"
()
reverse_iterator
rend
()
#const_reverse_iterator rend
()
const_reverse_iterator
const_rend
"rend"
()
size_t
size
()
void
swap
(
map
&
)
iterator
upper_bound
(
const
T
&
)
#const_iterator upper_bound(const key_type
&)
const_iterator
const_upper_bound
"upper_bound"
(
const
T
&
)
#value_compare value_comp()
Cython/Includes/libcpp/set.pxd
View file @
a0d13cb1
...
...
@@ -14,10 +14,10 @@ cdef extern from "<set>" namespace "std" nogil:
iterator
operator
--
()
bint
operator
==
(
reverse_iterator
)
bint
operator
!=
(
reverse_iterator
)
#
cppclass const_iterator(iterator):
#
pass
#
cppclass const_reverse_iterator(reverse_iterator):
#
pass
cppclass
const_iterator
(
iterator
):
pass
cppclass
const_reverse_iterator
(
reverse_iterator
):
pass
set
()
except
+
set
(
set
&
)
except
+
#set(key_compare&)
...
...
@@ -29,32 +29,32 @@ cdef extern from "<set>" namespace "std" nogil:
bint
operator
<=
(
set
&
,
set
&
)
bint
operator
>=
(
set
&
,
set
&
)
iterator
begin
()
#const_iterator begin
()
const_iterator
const_begin
"begin"
()
void
clear
()
size_t
count
(
const
T
&
)
bint
empty
()
iterator
end
()
#const_iterator end
()
const_iterator
const_end
"end"
()
pair
[
iterator
,
iterator
]
equal_range
(
const
T
&
)
#pair[const_iterator, const_iterator] equal_range(T&)
void
erase
(
iterator
)
void
erase
(
iterator
,
iterator
)
size_t
erase
(
T
&
)
iterator
find
(
T
&
)
#const_iterator find
(T&)
const_iterator
const_find
"find"
(
T
&
)
pair
[
iterator
,
bint
]
insert
(
const
T
&
)
except
+
iterator
insert
(
iterator
,
const
T
&
)
except
+
#void insert(input_iterator, input_iterator)
#key_compare key_comp()
iterator
lower_bound
(
T
&
)
#const_iterator lower_bound
(T&)
const_iterator
const_lower_bound
"lower_bound"
(
T
&
)
size_t
max_size
()
reverse_iterator
rbegin
()
#const_reverse_iterator rbegin
()
const_reverse_iterator
const_rbegin
"rbegin"
()
reverse_iterator
rend
()
#const_reverse_iterator rend
()
const_reverse_iterator
const_rend
"rend"
()
size_t
size
()
void
swap
(
set
&
)
iterator
upper_bound
(
const
T
&
)
#const_iterator upper_bound
(const T&)
const_iterator
const_upper_bound
"upper_bound"
(
const
T
&
)
#value_compare value_comp()
Cython/Includes/libcpp/unordered_map.pxd
View file @
a0d13cb1
...
...
@@ -14,10 +14,10 @@ cdef extern from "<unordered_map>" namespace "std" nogil:
iterator
operator
--
()
bint
operator
==
(
reverse_iterator
)
bint
operator
!=
(
reverse_iterator
)
#
cppclass const_iterator(iterator):
#
pass
#
cppclass const_reverse_iterator(reverse_iterator):
#
pass
cppclass
const_iterator
(
iterator
):
pass
cppclass
const_reverse_iterator
(
reverse_iterator
):
pass
unordered_map
()
except
+
unordered_map
(
unordered_map
&
)
except
+
#unordered_map(key_compare&)
...
...
@@ -31,34 +31,34 @@ cdef extern from "<unordered_map>" namespace "std" nogil:
bint
operator
>=
(
unordered_map
&
,
unordered_map
&
)
U
&
at
(
T
&
)
iterator
begin
()
#const_iterator begin
()
const_iterator
const_begin
"begin"
()
void
clear
()
size_t
count
(
T
&
)
bint
empty
()
iterator
end
()
#const_iterator end
()
const_iterator
const_end
"end"
()
pair
[
iterator
,
iterator
]
equal_range
(
T
&
)
#pair[const_iterator, const_iterator] equal_range(key_type&)
void
erase
(
iterator
)
void
erase
(
iterator
,
iterator
)
size_t
erase
(
T
&
)
iterator
find
(
T
&
)
#const_iterator find(key_type
&)
const_iterator
const_find
"find"
(
T
&
)
pair
[
iterator
,
bint
]
insert
(
pair
[
T
,
U
])
# XXX pair[T,U]&
iterator
insert
(
iterator
,
pair
[
T
,
U
])
# XXX pair[T,U]&
#void insert(input_iterator, input_iterator)
#key_compare key_comp()
iterator
lower_bound
(
T
&
)
#const_iterator lower_bound(key_type
&)
const_iterator
const_lower_bound
"lower_bound"
(
T
&
)
size_t
max_size
()
reverse_iterator
rbegin
()
#const_reverse_iterator rbegin
()
const_reverse_iterator
const_rbegin
"rbegin"
()
reverse_iterator
rend
()
#const_reverse_iterator rend
()
const_reverse_iterator
const_rend
"rend"
()
size_t
size
()
void
swap
(
unordered_map
&
)
iterator
upper_bound
(
T
&
)
#const_iterator upper_bound(key_type
&)
const_iterator
const_upper_bound
"upper_bound"
(
T
&
)
#value_compare value_comp()
void
max_load_factor
(
float
)
float
max_load_factor
()
Cython/Includes/libcpp/unordered_set.pxd
View file @
a0d13cb1
...
...
@@ -14,10 +14,10 @@ cdef extern from "<unordered_set>" namespace "std" nogil:
iterator
operator
--
()
bint
operator
==
(
reverse_iterator
)
bint
operator
!=
(
reverse_iterator
)
#
cppclass const_iterator(iterator):
#
pass
#
cppclass const_reverse_iterator(reverse_iterator):
#
pass
cppclass
const_iterator
(
iterator
):
pass
cppclass
const_reverse_iterator
(
reverse_iterator
):
pass
unordered_set
()
except
+
unordered_set
(
unordered_set
&
)
except
+
#unordered_set(key_compare&)
...
...
@@ -29,32 +29,32 @@ cdef extern from "<unordered_set>" namespace "std" nogil:
bint
operator
<=
(
unordered_set
&
,
unordered_set
&
)
bint
operator
>=
(
unordered_set
&
,
unordered_set
&
)
iterator
begin
()
#const_iterator begin
()
const_iterator
const_begin
"begin"
()
void
clear
()
size_t
count
(
T
&
)
bint
empty
()
iterator
end
()
#const_iterator end
()
const_iterator
const_end
"end"
()
pair
[
iterator
,
iterator
]
equal_range
(
T
&
)
#pair[const_iterator, const_iterator] equal_range(T&)
void
erase
(
iterator
)
void
erase
(
iterator
,
iterator
)
size_t
erase
(
T
&
)
iterator
find
(
T
&
)
#const_iterator find
(T&)
const_iterator
const_find
"find"
(
T
&
)
pair
[
iterator
,
bint
]
insert
(
T
&
)
iterator
insert
(
iterator
,
T
&
)
#void insert(input_iterator, input_iterator)
#key_compare key_comp()
iterator
lower_bound
(
T
&
)
#const_iterator lower_bound
(T&)
const_iterator
const_lower_bound
"lower_bound"
(
T
&
)
size_t
max_size
()
reverse_iterator
rbegin
()
#const_reverse_iterator rbegin
()
const_reverse_iterator
const_rbegin
"rbegin"
()
reverse_iterator
rend
()
#const_reverse_iterator rend
()
const_reverse_iterator
const_rend
"rend"
()
size_t
size
()
void
swap
(
unordered_set
&
)
iterator
upper_bound
(
T
&
)
#const_iterator upper_bound
(T&)
const_iterator
const_upper_bound
"upper_bound"
(
T
&
)
#value_compare value_comp()
Cython/Includes/libcpp/vector.pxd
View file @
a0d13cb1
...
...
@@ -24,10 +24,10 @@ cdef extern from "<vector>" namespace "std" nogil:
bint
operator
>
(
reverse_iterator
)
bint
operator
<=
(
reverse_iterator
)
bint
operator
>=
(
reverse_iterator
)
#
cppclass const_iterator(iterator):
#
pass
#
cppclass const_reverse_iterator(reverse_iterator):
#
pass
cppclass
const_iterator
(
iterator
):
pass
cppclass
const_reverse_iterator
(
reverse_iterator
):
pass
vector
()
except
+
vector
(
vector
&
)
except
+
vector
(
size_t
)
except
+
...
...
@@ -46,12 +46,12 @@ cdef extern from "<vector>" namespace "std" nogil:
T
&
at
(
size_t
)
except
+
T
&
back
()
iterator
begin
()
#const_iterator begin
()
const_iterator
const_begin
"begin"
()
size_t
capacity
()
void
clear
()
bint
empty
()
iterator
end
()
#const_iterator end
()
const_iterator
const_end
"end"
()
iterator
erase
(
iterator
)
iterator
erase
(
iterator
,
iterator
)
T
&
front
()
...
...
@@ -62,15 +62,15 @@ cdef extern from "<vector>" namespace "std" nogil:
void
pop_back
()
void
push_back
(
T
&
)
except
+
reverse_iterator
rbegin
()
#const_reverse_iterator rbegin
()
const_reverse_iterator
const_rbegin
"rbegin"
()
reverse_iterator
rend
()
#const_reverse_iterator rend
()
const_reverse_iterator
const_rend
"rend"
()
void
reserve
(
size_t
)
void
resize
(
size_t
)
except
+
void
resize
(
size_t
,
T
&
)
except
+
size_t
size
()
void
swap
(
vector
&
)
# C++11 methods
T
*
data
()
void
shrink_to_fit
()
tests/run/libcpp_all.pyx
View file @
a0d13cb1
# tag: cpp
import
cython
cimport
libcpp
cimport
libcpp.deque
...
...
@@ -67,3 +69,23 @@ def test_vector_coercion(*args):
for
a
in
args
:
v
.
push_back
(
a
)
return
[
v
[
0
][
i
]
for
i
in
range
(
v
.
size
())]
def
test_const_vector
(
*
args
):
"""
>>> test_const_vector(1.75)
[1.75]
>>> test_const_vector(1, 10, 100)
[1.0, 10.0, 100.0]
"""
cdef
vector
[
double
]
v
for
a
in
args
:
v
.
push_back
(
a
)
return
const_vector_to_list
(
v
)
cdef
const_vector_to_list
(
const
vector
[
double
]
&
cv
):
cdef
vector
[
double
].
const_iterator
iter
=
cv
.
const_begin
()
cdef
lst
=
[]
while
iter
!=
cv
.
const_end
():
lst
.
append
(
cython
.
operator
.
dereference
(
iter
))
cython
.
operator
.
preincrement
(
iter
)
return
lst
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