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
2619e3a8
Commit
2619e3a8
authored
18 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
bugfixes
[[Imported from SVN: r680]]
parent
737aed14
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/test/matrixtest.cc
+14
-8
14 additions, 8 deletions
istl/test/matrixtest.cc
with
14 additions
and
8 deletions
istl/test/matrixtest.cc
+
14
−
8
View file @
2619e3a8
...
...
@@ -77,8 +77,8 @@ void testMatrix(MatrixType& matrix)
for
(;
constRowIt
!=
constRowEndIt
;
++
constRowIt
)
{
typename
MatrixType
::
ConstColIterator
constColIt
=
r
owIt
->
begin
();
typename
MatrixType
::
ConstColIterator
constColEndIt
=
r
owIt
->
end
();
typename
MatrixType
::
ConstColIterator
constColIt
=
constR
owIt
->
begin
();
typename
MatrixType
::
ConstColIterator
constColEndIt
=
constR
owIt
->
end
();
for
(;
constColIt
!=
constColEndIt
;
++
constColIt
)
numEntries
++
;
...
...
@@ -87,6 +87,8 @@ void testMatrix(MatrixType& matrix)
}
assert
(
numRows
==
matrix
.
N
());
// ////////////////////////////////////////////////////////
// Count number of rows, columns, and nonzero entries
// This time we're counting backwards
...
...
@@ -98,12 +100,12 @@ void testMatrix(MatrixType& matrix)
numRows
=
0
;
numEntries
=
0
;
for
(;
rowIt
!=
rowEndIt
;
++
rowIt
)
{
for
(;
rowIt
!=
rowEndIt
;
--
rowIt
)
{
typename
MatrixType
::
ColIterator
colIt
=
rowIt
->
rbegin
();
typename
MatrixType
::
ColIterator
colEndIt
=
rowIt
->
rend
();
for
(;
colIt
!=
colEndIt
;
++
colIt
)
{
for
(;
colIt
!=
colEndIt
;
--
colIt
)
{
assert
(
matrix
.
exists
(
rowIt
.
index
(),
colIt
.
index
()));
numEntries
++
;
}
...
...
@@ -112,6 +114,8 @@ void testMatrix(MatrixType& matrix)
}
assert
(
numRows
==
matrix
.
N
());
// ///////////////////////////////////////////////////////////////
// Count number of rows, columns, and nonzero entries again.
// This time use the const iterators and count backwards.
...
...
@@ -123,18 +127,20 @@ void testMatrix(MatrixType& matrix)
numRows
=
0
;
numEntries
=
0
;
for
(;
constRowIt
!=
constRowEndIt
;
++
constRowIt
)
{
for
(;
constRowIt
!=
constRowEndIt
;
--
constRowIt
)
{
typename
MatrixType
::
ConstColIterator
constColIt
=
r
owIt
->
rbegin
();
typename
MatrixType
::
ConstColIterator
constColEndIt
=
r
owIt
->
rend
();
typename
MatrixType
::
ConstColIterator
constColIt
=
constR
owIt
->
rbegin
();
typename
MatrixType
::
ConstColIterator
constColEndIt
=
constR
owIt
->
rend
();
for
(;
constColIt
!=
constColEndIt
;
++
constColIt
)
for
(;
constColIt
!=
constColEndIt
;
--
constColIt
)
numEntries
++
;
numRows
++
;
}
assert
(
numRows
==
matrix
.
N
());
// ///////////////////////////////////////////////////////
// More dimension stuff
// ///////////////////////////////////////////////////////
...
...
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