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
aeb20354
Commit
aeb20354
authored
18 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
remember fmtflags and reset them at the end of print functions.
[[Imported from SVN: r717]]
parent
a76a33fa
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/io.hh
+13
-7
13 additions, 7 deletions
istl/io.hh
with
13 additions
and
7 deletions
istl/io.hh
+
13
−
7
View file @
aeb20354
...
...
@@ -5,7 +5,7 @@
#include
<math.h>
#include
<complex>
#include
<ios
tream
>
#include
<ios>
#include
<iomanip>
#include
<fstream>
#include
<string>
...
...
@@ -71,6 +71,9 @@ namespace Dune {
// count the numbers printed to make columns
int
counter
=
0
;
// remember old flags
std
::
ios_base
::
fmtflags
oldflags
=
s
.
flags
();
// set the output format
s
.
setf
(
std
::
ios_base
::
scientific
,
std
::
ios_base
::
floatfield
);
int
oldprec
=
s
.
precision
();
...
...
@@ -87,8 +90,7 @@ namespace Dune {
s
<<
std
::
endl
;
// reset the output format
s
.
precision
(
oldprec
);
s
.
setf
(
std
::
ios_base
::
fixed
,
std
::
ios_base
::
floatfield
);
s
.
flags
(
oldflags
);
}
...
...
@@ -176,6 +178,10 @@ namespace Dune {
void
printmatrix
(
std
::
ostream
&
s
,
const
M
&
A
,
std
::
string
title
,
std
::
string
rowtext
,
int
width
=
10
,
int
precision
=
2
)
{
// remember old flags
std
::
ios_base
::
fmtflags
oldflags
=
s
.
flags
();
// set the output format
s
.
setf
(
std
::
ios_base
::
scientific
,
std
::
ios_base
::
floatfield
);
int
oldprec
=
s
.
precision
();
...
...
@@ -201,8 +207,7 @@ namespace Dune {
}
// reset the output format
s
.
precision
(
oldprec
);
s
.
setf
(
std
::
ios_base
::
fixed
,
std
::
ios_base
::
floatfield
);
s
.
flags
(
oldflags
);
}
/**
...
...
@@ -228,6 +233,8 @@ namespace Dune {
std
::
string
title
,
std
::
string
rowtext
,
int
width
=
3
,
int
precision
=
2
)
{
// remember old flags
std
::
ios_base
::
fmtflags
oldflags
=
s
.
flags
();
// set the output format
s
.
setf
(
std
::
ios_base
::
scientific
,
std
::
ios_base
::
floatfield
);
int
oldprec
=
s
.
precision
();
...
...
@@ -292,8 +299,7 @@ namespace Dune {
}
// reset the output format
s
.
precision
(
oldprec
);
s
.
setf
(
std
::
ios_base
::
fixed
,
std
::
ios_base
::
floatfield
);
s
.
flags
(
oldflags
);
}
/** \brief Helper method for the writeMatrixToMatlab routine.
...
...
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