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
7e3ff044
Commit
7e3ff044
authored
11 years ago
by
Steffen Müthing
Browse files
Options
Downloads
Patches
Plain Diff
[BCRSMatrix] Adjust existing build stage checks to new enum values and semantics
parent
907bb8f1
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
+26
-15
26 additions, 15 deletions
dune/istl/bcrsmatrix.hh
with
26 additions
and
15 deletions
dune/istl/bcrsmatrix.hh
+
26
−
15
View file @
7e3ff044
...
...
@@ -923,22 +923,21 @@ namespace Dune {
CreateIterator
(
BCRSMatrix
&
_Mat
,
size_type
_i
)
:
Mat
(
_Mat
),
i
(
_i
),
nnz
(
0
),
current_row
(
Mat
.
a
,
Mat
.
j
.
get
(),
0
)
{
if
(
i
==
0
&&
Mat
.
ready
)
if
(
Mat
.
build_mode
==
unknown
&&
Mat
.
ready
==
building
)
{
Mat
.
build_mode
=
row_wise
;
}
if
(
i
==
0
&&
Mat
.
ready
!=
building
)
DUNE_THROW
(
BCRSMatrixError
,
"creation only allowed for uninitialized matrix"
);
if
(
Mat
.
build_mode
!=
row_wise
)
{
if
(
Mat
.
build_mode
==
unknown
)
Mat
.
build_mode
=
row_wise
;
else
DUNE_THROW
(
BCRSMatrixError
,
"creation only allowed if row wise allocation was requested in the constructor"
);
}
DUNE_THROW
(
BCRSMatrixError
,
"creation only allowed if row wise allocation was requested in the constructor"
);
}
//! prefix increment
CreateIterator
&
operator
++
()
{
// this should only be called if matrix is in creation
if
(
Mat
.
ready
)
if
(
Mat
.
ready
!=
building
)
DUNE_THROW
(
BCRSMatrixError
,
"matrix already built up"
);
// row i is defined through the pattern
...
...
@@ -1079,7 +1078,7 @@ namespace Dune {
{
if
(
build_mode
!=
random
)
DUNE_THROW
(
BCRSMatrixError
,
"requires random build mode"
);
if
(
ready
)
if
(
ready
!=
building
)
DUNE_THROW
(
BCRSMatrixError
,
"matrix row sizes already built up"
);
r
[
i
].
setsize
(
s
);
...
...
@@ -1100,7 +1099,7 @@ namespace Dune {
{
if
(
build_mode
!=
random
)
DUNE_THROW
(
BCRSMatrixError
,
"requires random build mode"
);
if
(
ready
)
if
(
ready
!=
building
)
DUNE_THROW
(
BCRSMatrixError
,
"matrix row sizes already built up"
);
r
[
i
].
setsize
(
r
[
i
].
getsize
()
+
s
);
...
...
@@ -1111,7 +1110,7 @@ namespace Dune {
{
if
(
build_mode
!=
random
)
DUNE_THROW
(
BCRSMatrixError
,
"requires random build mode"
);
if
(
ready
)
if
(
ready
!=
building
)
DUNE_THROW
(
BCRSMatrixError
,
"matrix row sizes already built up"
);
// compute total size, check positivity
...
...
@@ -1155,8 +1154,10 @@ namespace Dune {
DUNE_THROW
(
BCRSMatrixError
,
"requires random build mode"
);
if
(
ready
==
built
)
DUNE_THROW
(
BCRSMatrixError
,
"matrix already built up"
);
if
(
ready
==
not
buil
t
)
if
(
ready
==
buil
ding
)
DUNE_THROW
(
BCRSMatrixError
,
"matrix row sizes not built up yet"
);
if
(
ready
==
notAllocated
)
DUNE_THROW
(
BCRSMatrixError
,
"matrix size not set and no memory allocated yet"
);
if
(
col
>=
m
)
DUNE_THROW
(
BCRSMatrixError
,
"column index exceeds matrix size"
);
...
...
@@ -1189,8 +1190,10 @@ namespace Dune {
DUNE_THROW
(
BCRSMatrixError
,
"requires random build mode"
);
if
(
ready
==
built
)
DUNE_THROW
(
BCRSMatrixError
,
"matrix already built up"
);
if
(
ready
==
not
buil
t
)
if
(
ready
==
buil
ding
)
DUNE_THROW
(
BCRSMatrixError
,
"row sizes are not built up yet"
);
if
(
ready
==
notAllocated
)
DUNE_THROW
(
BCRSMatrixError
,
"matrix size not set and no memory allocated yet"
);
// check if there are undefined indices
RowIterator
endi
=
end
();
...
...
@@ -1232,6 +1235,10 @@ namespace Dune {
DUNE_THROW
(
BCRSMatrixError
,
"requires implicit build mode"
);
if
(
ready
==
built
)
DUNE_THROW
(
BCRSMatrixError
,
"matrix already built up, use operator[] for entry access now"
);
if
(
ready
==
notAllocated
)
DUNE_THROW
(
BCRSMatrixError
,
"matrix size not set and no memory allocated yet"
);
if
(
ready
!=
building
)
DUNE_THROW
(
InvalidStateException
,
"You may only use entry() during the 'building' stage"
);
if
(
row
>=
n
)
DUNE_THROW
(
BCRSMatrixError
,
"row index exceeds matrix size"
);
...
...
@@ -1291,6 +1298,10 @@ namespace Dune {
DUNE_THROW
(
BCRSMatrixError
,
"requires implicit build mode"
);
if
(
ready
==
built
)
DUNE_THROW
(
BCRSMatrixError
,
"matrix already built up, no more need for compression"
);
if
(
ready
==
notAllocated
)
DUNE_THROW
(
BCRSMatrixError
,
"matrix size not set and no memory allocated yet"
);
if
(
ready
!=
building
)
DUNE_THROW
(
InvalidStateException
,
"You may only call compress() at the end of the 'building' stage"
);
//calculate statistics
CompressionStatistics
stats
;
...
...
@@ -1957,7 +1968,7 @@ namespace Dune {
}
// Mark matrix as not built at all.
ready
=
not
built
;
ready
=
not
Allocated
;
}
...
...
@@ -2027,7 +2038,7 @@ namespace Dune {
}
// Mark the matrix as not built.
ready
=
not
buil
t
;
ready
=
buil
ding
;
}
/** @brief organizes allocation implicit mode
...
...
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