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
37effa1f
Commit
37effa1f
authored
19 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Added operator+=() and operator-=() for convenience.
[[Imported from SVN: r423]]
parent
0452484a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
istl/bcrsmatrix.hh
+39
-0
39 additions, 0 deletions
istl/bcrsmatrix.hh
with
39 additions
and
0 deletions
istl/bcrsmatrix.hh
+
39
−
0
View file @
37effa1f
...
...
@@ -991,6 +991,45 @@ namespace Dune {
}
/*! \brief Add the entries of another matrix to this one.
*
* \param b The matrix to add to this one. Its sparsity pattern
* has to be subset of the sparsity pattern of this matrix.
*/
BCRSMatrix
&
operator
+=
(
const
BCRSMatrix
&
b
)
{
#ifdef DUNE_ISTL_WITH_CHECKING
if
(
N
()
!=
b
.
N
()
||
M
()
!=
b
.
M
())
DUNE_THROW
(
RangeError
,
"Matrix sizes do not match!"
);
#endif
RowIterator
endi
=
end
();
ConstRowIterator
j
=
b
.
begin
();
for
(
RowIterator
i
=
begin
();
i
!=
endi
;
++
i
,
++
j
)
{
i
->
operator
+=
(
*
j
);
}
return
*
this
;
}
/*! \brief Substract the entries of another matrix to this one.
*
* \param b The matrix to add to this one. Its sparsity pattern
* has to be subset of the sparsity pattern of this matrix.
*/
BCRSMatrix
&
operator
-=
(
const
BCRSMatrix
&
b
)
{
#ifdef DUNE_ISTL_WITH_CHECKING
if
(
N
()
!=
b
.
N
()
||
M
()
!=
b
.
M
())
DUNE_THROW
(
RangeError
,
"Matrix sizes do not match!"
);
#endif
RowIterator
endi
=
end
();
ConstRowIterator
j
=
b
.
begin
();
for
(
RowIterator
i
=
begin
();
i
!=
endi
;
++
i
,
++
j
)
{
i
->
operator
-=
(
*
j
);
}
return
*
this
;
}
//===== linear maps
//! y += A x
...
...
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