Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
8c111ee7
"docs/git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "ed66a209708ad4c0f442ddb21d0678c013b35f89"
Commit
8c111ee7
authored
Aug 08, 2013
by
Davis King
Browse files
Improved sparse vector python docs
parent
bc9bf360
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
tools/python/src/basic.cpp
tools/python/src/basic.cpp
+15
-1
No files found.
tools/python/src/basic.cpp
View file @
8c111ee7
...
@@ -210,7 +210,21 @@ void bind_basic_types()
...
@@ -210,7 +210,21 @@ void bind_basic_types()
.
def
(
"__repr__"
,
pair__repr__
)
.
def
(
"__repr__"
,
pair__repr__
)
.
def_pickle
(
serialize_pickle
<
pair_type
>
());
.
def_pickle
(
serialize_pickle
<
pair_type
>
());
class_
<
std
::
vector
<
pair_type
>
>
(
"sparse_vector"
,
"This object represents the mathematical idea of a column vector."
)
class_
<
std
::
vector
<
pair_type
>
>
(
"sparse_vector"
,
"This object represents the mathematical idea of a sparse column vector. It is
\n
\
simply an array of dlib.pair objects, each representing an index/value pair in
\n
\
the vector. Any elements of the vector which are missing are implicitly set to
\n
\
zero.
\n
\
\n
\
Unless otherwise noted, any routines taking a sparse_vector assume the sparse
\n
\
vector is sorted and has unique elements. That is, the index values of the
\n
\
pairs in a sparse_vector should be listed in increasing order and there should
\n
\
not be duplicates. However, some functions work with
\"
unsorted
\"
sparse
\n
\
vectors. These are dlib.sparse_vector objects that have either duplicate
\n
\
entries or non-sorted index values. Note further that you can convert an
\n
\
\"
unsorted
\"
sparse_vector into a properly sorted sparse vector by calling
\n
\
dlib.make_sparse_vector() on it. "
)
.
def
(
vector_indexing_suite
<
std
::
vector
<
pair_type
>
>
())
.
def
(
vector_indexing_suite
<
std
::
vector
<
pair_type
>
>
())
.
def
(
"__str__"
,
sparse_vector__str__
)
.
def
(
"__str__"
,
sparse_vector__str__
)
.
def
(
"__repr__"
,
sparse_vector__repr__
)
.
def
(
"__repr__"
,
sparse_vector__repr__
)
...
...
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