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
04a42801
Commit
04a42801
authored
11 years ago
by
Steffen Müthing
Browse files
Options
Downloads
Patches
Plain Diff
[Release][BCRSMatrix] Add a more efficient interface for setting all column indices of a row
parent
f5ed9b9a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/istl/bcrsmatrix.hh
+23
-0
23 additions, 0 deletions
dune/istl/bcrsmatrix.hh
with
23 additions
and
0 deletions
dune/istl/bcrsmatrix.hh
+
23
−
0
View file @
04a42801
...
...
@@ -1181,7 +1181,30 @@ namespace Dune {
// insert new column index at correct position
std
::
copy_backward
(
pos
,
end
,
end
+
1
);
*
pos
=
col
;
}
//! Set all column indices for row from the given iterator range.
/**
* The iterator range has to be of the same length as the previously set row size.
* The entries in the iterator range do not have to be in any particular order, but
* must not contain duplicate values.
*
* Calling this method overwrites any previously set column indices!
*/
template
<
typename
It
>
void
setIndices
(
size_type
row
,
It
begin
,
It
end
)
{
size_type
cols
=
0
;
size_type
*
col_it
=
r
[
row
].
getindexptr
();
for
(;
begin
!=
end
;
++
begin
,
++
col_it
,
++
cols
)
{
*
col_it
=
*
begin
;
}
if
(
cols
!=
r
[
row
].
size
())
DUNE_THROW
(
BCRSMatrixError
,
"Given size of row "
<<
row
<<
" ("
<<
r
[
row
].
size
()
<<
") does not match number of passed entries ("
<<
cols
<<
")"
);
std
::
sort
(
r
[
row
].
getindexptr
(),
r
[
row
].
getindexptr
()
+
cols
);
}
//! indicate that all indices are defined, check consistency
...
...
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