Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
9734bb0c
There was an error fetching the commit references. Please try again later.
Commit
9734bb0c
authored
5 years ago
by
Jakub Klinkovský
Browse files
Options
Downloads
Patches
Plain Diff
Updated vector expressions in Python bindings
parent
5640cc0f
No related branches found
No related tags found
1 merge request
!36
Fixed expression templates
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Python/pytnl/tnl/StaticVector.h
+9
-1
9 additions, 1 deletion
src/Python/pytnl/tnl/StaticVector.h
src/Python/pytnl/tnl/Vector.h
+19
-14
19 additions, 14 deletions
src/Python/pytnl/tnl/Vector.h
with
28 additions
and
15 deletions
src/Python/pytnl/tnl/StaticVector.h
+
9
−
1
View file @
9734bb0c
...
...
@@ -28,12 +28,20 @@ void export_StaticVector( Scope & scope, const char* name )
// .def(py::self_ns::str(py::self))
.
def
(
py
::
self
+=
py
::
self
)
.
def
(
py
::
self
-=
py
::
self
)
.
def
(
py
::
self
*=
py
::
self
)
.
def
(
py
::
self
/=
py
::
self
)
.
def
(
py
::
self
+=
RealType
())
.
def
(
py
::
self
-=
RealType
())
.
def
(
py
::
self
*=
RealType
())
.
def
(
py
::
self
/=
RealType
())
.
def
(
py
::
self
+
py
::
self
)
.
def
(
py
::
self
-
py
::
self
)
.
def
(
py
::
self
*
RealType
())
.
def
(
py
::
self
*
py
::
self
)
.
def
(
py
::
self
/
py
::
self
)
.
def
(
py
::
self
+
RealType
())
.
def
(
py
::
self
-
RealType
())
.
def
(
py
::
self
*
RealType
())
.
def
(
py
::
self
/
RealType
())
.
def
(
py
::
self
<
py
::
self
)
.
def
(
py
::
self
>
py
::
self
)
.
def
(
py
::
self
<=
py
::
self
)
...
...
This diff is collapsed.
Click to expand it.
src/Python/pytnl/tnl/Vector.h
+
19
−
14
View file @
9734bb0c
...
...
@@ -9,14 +9,7 @@ namespace py = pybind11;
template
<
typename
ArrayType
,
typename
VectorType
>
void
export_Vector
(
py
::
module
&
m
,
const
char
*
name
)
{
// function pointers for overloaded methods
void
(
VectorType
::*
_addElement1
)(
const
typename
VectorType
::
IndexType
,
const
typename
VectorType
::
RealType
&
)
=
&
VectorType
::
addElement
;
void
(
VectorType
::*
_addElement2
)(
const
typename
VectorType
::
IndexType
,
const
typename
VectorType
::
RealType
&
,
const
typename
VectorType
::
RealType
&
)
=
&
VectorType
::
addElement
;
using
RealType
=
typename
VectorType
::
RealType
;
py
::
class_
<
VectorType
,
ArrayType
>
(
m
,
name
)
.
def
(
py
::
init
<>
())
...
...
@@ -25,15 +18,27 @@ void export_Vector(py::module & m, const char* name)
.
def
(
"getTypeVirtual"
,
&
VectorType
::
getTypeVirtual
)
.
def_static
(
"getSerializationType"
,
&
VectorType
::
getSerializationType
)
.
def
(
"getSerializationTypeVirtual"
,
&
VectorType
::
getSerializationTypeVirtual
)
.
def
(
"addElement"
,
_addElement1
)
.
def
(
"addElement"
,
_addElement2
)
.
def
(
py
::
self
==
py
::
self
)
.
def
(
py
::
self
!=
py
::
self
)
.
def
(
py
::
self
+=
py
::
self
)
.
def
(
py
::
self
-=
py
::
self
)
.
def
(
py
::
self
*=
typename
VectorType
::
RealType
())
.
def
(
py
::
self
/=
typename
VectorType
::
RealType
())
.
def
(
"addVector"
,
&
VectorType
::
template
addVector
<
VectorType
,
double
,
double
>)
.
def
(
"addVectors"
,
&
VectorType
::
template
addVectors
<
VectorType
,
VectorType
,
double
,
double
,
double
>)
.
def
(
py
::
self
*=
py
::
self
)
.
def
(
py
::
self
/=
py
::
self
)
.
def
(
py
::
self
+=
RealType
())
.
def
(
py
::
self
-=
RealType
())
.
def
(
py
::
self
*=
RealType
())
.
def
(
py
::
self
/=
RealType
())
.
def
(
py
::
self
+
py
::
self
)
.
def
(
py
::
self
-
py
::
self
)
.
def
(
py
::
self
*
py
::
self
)
.
def
(
py
::
self
/
py
::
self
)
.
def
(
py
::
self
+
RealType
())
.
def
(
py
::
self
-
RealType
())
.
def
(
py
::
self
*
RealType
())
.
def
(
py
::
self
/
RealType
())
.
def
(
py
::
self
<
py
::
self
)
.
def
(
py
::
self
>
py
::
self
)
.
def
(
py
::
self
<=
py
::
self
)
.
def
(
py
::
self
>=
py
::
self
)
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment