Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-istl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
Core Modules
dune-istl
Commits
98f4131c
Commit
98f4131c
authored
9 months ago
by
Simon Praetorius
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix/bvectorPybind' into 'master'
fix bvector += bindings See merge request
!565
parents
f37f90ae
306c25e9
Loading
Loading
1 merge request
!565
fix bvector += bindings
Pipeline
#71362
passed
9 months ago
Stage: .pre
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/python/istl/bvector.hh
+2
-15
2 additions, 15 deletions
dune/python/istl/bvector.hh
dune/python/test/bcrsmatrix.py
+9
-0
9 additions, 0 deletions
dune/python/test/bcrsmatrix.py
with
11 additions
and
15 deletions
dune/python/istl/bvector.hh
+
2
−
15
View file @
98f4131c
...
...
@@ -156,24 +156,11 @@ namespace Dune
cls
.
def
(
"__len__"
,
[]
(
const
BlockVector
&
self
)
{
return
self
.
N
();
}
);
cls
.
def
(
pybind11
::
self
+=
pybind11
::
self
);
// silence a warning (false positive) emitted by clang
// https://bugs.llvm.org/show_bug.cgi?id=43124
#ifdef __clang__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wself-assign-overloaded"
#endif
cls
.
def
(
pybind11
::
self
-=
pybind11
::
self
);
#ifdef __clang__
#pragma GCC diagnostic pop
#endif
detail
::
registerOneTensorInterface
(
cls
);
detail
::
registerISTLIterators
(
cls
);
cls
.
def
(
"__iadd__"
,
[]
(
BlockVector
&
self
,
const
BlockVector
&
x
)
->
BlockVector
&
{
self
+=
x
;
return
self
;
}
);
cls
.
def
(
"__isub__"
,
[]
(
BlockVector
&
self
,
const
BlockVector
&
x
)
->
BlockVector
&
{
self
-=
x
;
return
self
;
}
);
cls
.
def
(
"__imul__"
,
[]
(
BlockVector
&
self
,
field_type
x
)
->
BlockVector
&
{
self
*=
x
;
return
self
;
}
);
cls
.
def
(
"__idiv__"
,
[]
(
BlockVector
&
self
,
field_type
x
)
->
BlockVector
&
{
self
/=
x
;
return
self
;
}
);
cls
.
def
(
"__itruediv__"
,
[]
(
BlockVector
&
self
,
field_type
x
)
->
BlockVector
&
{
self
/=
x
;
return
self
;
}
);
...
...
This diff is collapsed.
Click to expand it.
dune/python/test/bcrsmatrix.py
+
9
−
0
View file @
98f4131c
...
...
@@ -132,3 +132,12 @@ str_x = str_x +")"
if
str_x
!=
s
:
raise
Exception
(
str
(
x
)
+
"
= str(x) !=
"
+
s
)
q
=
x
.
copy
()
q
+=
q
for
i
in
range
(
0
,
5
):
assert
(
q
[
i
][
0
]
==
2
*
x
[
i
][
0
])
q
-=
x
for
i
in
range
(
0
,
5
):
assert
(
q
[
i
][
0
]
==
x
[
i
][
0
])
\ No newline at end of file
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