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
40da8bf7
"tools/python/vscode:/vscode.git/clone" did not exist on "4b6087f748eb0fafcac6f1af0e06aec99d6cc5c1"
Commit
40da8bf7
authored
May 20, 2018
by
Davis King
Browse files
Added length() for point and dpoint in the Python API.
parent
52e7ab68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
tools/python/src/vector.cpp
tools/python/src/vector.cpp
+5
-0
No files found.
tools/python/src/vector.cpp
View file @
40da8bf7
...
...
@@ -216,4 +216,9 @@ void bind_vector(py::module& m)
.
def
(
"extend"
,
extend_vector_with_python_list
<
dpoint
>
)
.
def
(
py
::
pickle
(
&
getstate
<
type
>
,
&
setstate
<
type
>
));
}
m
.
def
(
"length"
,
[](
const
point
&
p
){
return
length
(
p
);
},
"returns the distance from p to the origin, i.e. the L2 norm of p."
,
py
::
arg
(
"p"
));
m
.
def
(
"length"
,
[](
const
dpoint
&
p
){
return
length
(
p
);
},
"returns the distance from p to the origin, i.e. the L2 norm of p."
,
py
::
arg
(
"p"
));
}
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