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
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
Patrick Jaap
dune-istl
Commits
d01614e9
Commit
d01614e9
authored
20 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
added default constructor and resize method
[[Imported from SVN: r141]]
parent
f571dc8e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
istl/matrixindexset.hh
+14
-3
14 additions, 3 deletions
istl/matrixindexset.hh
with
14 additions
and
3 deletions
istl/matrixindexset.hh
+
14
−
3
View file @
d01614e9
...
...
@@ -12,11 +12,22 @@ namespace Dune {
public:
/** \brief Default constructor */
MatrixIndexSet
()
:
rows_
(
0
),
cols_
(
0
)
{}
/** \brief Constructor setting the matrix size */
MatrixIndexSet
(
int
rows
,
int
cols
)
:
rows_
(
rows
),
cols_
(
cols
)
{
indices
.
resize
(
rows_
);
}
/** \brief Reset the size of an index set */
void
resize
(
int
rows
,
int
cols
)
{
rows_
=
rows
;
cols_
=
cols
;
indices
.
resize
(
rows_
);
}
/** \brief Add an index to the index set */
void
add
(
int
i
,
int
j
)
{
...
...
@@ -45,7 +56,7 @@ namespace Dune {
* \tparam MatrixType Needs to be BCRSMatrix<...>
*/
template
<
class
MatrixType
>
int
import
(
const
MatrixType
&
m
,
int
rowOffset
=
0
,
int
colOffset
=
0
)
{
void
import
(
const
MatrixType
&
m
,
int
rowOffset
=
0
,
int
colOffset
=
0
)
{
typedef
typename
MatrixType
::
row_type
RowType
;
typedef
typename
RowType
::
ConstIterator
ColumnIterator
;
...
...
@@ -96,7 +107,7 @@ namespace Dune {
/** \todo Doesn't use the fact that the array is sorted! */
bool
containsSorted
(
const
std
::
vector
<
int
>&
nb
,
int
idx
)
{
for
(
int
i
=
0
;
i
<
nb
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
nb
.
size
();
i
++
)
if
(
nb
[
i
]
==
idx
)
return
true
;
...
...
@@ -105,7 +116,7 @@ namespace Dune {
void
insertSorted
(
std
::
vector
<
int
>&
nb
,
int
idx
)
{
int
i
;
unsigned
int
i
;
// Find correct slot for insertion
for
(
i
=
0
;
i
<
nb
.
size
();
i
++
)
if
(
nb
[
i
]
>=
idx
)
...
...
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