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
4f2f565c
"...text-generation-inference.git" did not exist on "db2ebe3947c4cb018e1504ae417f3efb9a517d89"
Commit
4f2f565c
authored
May 28, 2018
by
Davis King
Browse files
Added more operators for dpoint and point in the Pyhton API.
parent
81d57e72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
tools/python/src/vector.cpp
tools/python/src/vector.cpp
+6
-0
No files found.
tools/python/src/vector.cpp
View file @
4f2f565c
...
...
@@ -407,6 +407,9 @@ void bind_vector(py::module& m)
.
def
(
"__str__"
,
&
point__str__
)
.
def
(
py
::
self
+
py
::
self
)
.
def
(
py
::
self
-
py
::
self
)
.
def
(
py
::
self
/
double
())
.
def
(
py
::
self
*
double
())
.
def
(
double
()
*
py
::
self
)
.
def
(
"normalize"
,
&
type
::
normalize
,
"Returns a unit normalized copy of this vector."
)
.
def_property
(
"x"
,
&
point_x
,
[](
point
&
p
,
long
x
){
p
.
x
()
=
x
;},
"The x-coordinate of the point."
)
.
def_property
(
"y"
,
&
point_y
,
[](
point
&
p
,
long
y
){
p
.
x
()
=
y
;},
"The y-coordinate of the point."
)
...
...
@@ -436,6 +439,9 @@ void bind_vector(py::module& m)
.
def_property
(
"y"
,
&
dpoint_y
,
[](
dpoint
&
p
,
double
y
){
p
.
x
()
=
y
;},
"The y-coordinate of the dpoint."
)
.
def
(
py
::
self
+
py
::
self
)
.
def
(
py
::
self
-
py
::
self
)
.
def
(
py
::
self
/
double
())
.
def
(
py
::
self
*
double
())
.
def
(
double
()
*
py
::
self
)
.
def
(
py
::
pickle
(
&
getstate
<
type
>
,
&
setstate
<
type
>
));
}
{
...
...
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