dlinear
0.0.1
Delta-complete SMT solver for linear programming
Loading...
Searching...
No Matches
RoundingModeGuard.hpp
1
8
#pragma once
9
10
#include <cfenv>
11
12
namespace
dlinear
{
13
14
class
RoundingModeGuard
{
15
public
:
17
explicit
RoundingModeGuard
(
int
new_round) :
round_mode_
{fegetround()} { fesetround(new_round); }
18
19
RoundingModeGuard
(
const
RoundingModeGuard
&) =
delete
;
20
RoundingModeGuard
(
RoundingModeGuard
&&) =
delete
;
21
RoundingModeGuard
&operator=(
const
RoundingModeGuard
&) =
delete
;
22
RoundingModeGuard
&operator=(
RoundingModeGuard
&&) =
delete
;
23
25
~RoundingModeGuard
() { fesetround(
round_mode_
); }
26
27
private
:
28
const
int
round_mode_
{};
29
};
30
31
}
// namespace dlinear
dlinear::RoundingModeGuard
Definition
RoundingModeGuard.hpp:14
dlinear::RoundingModeGuard::RoundingModeGuard
RoundingModeGuard(int new_round)
Save the current rounding-mode and switch to new_round.
Definition
RoundingModeGuard.hpp:17
dlinear::RoundingModeGuard::round_mode_
const int round_mode_
Saved rounding-mode stored at construction time, to be restored at destruction time.
Definition
RoundingModeGuard.hpp:28
dlinear::RoundingModeGuard::~RoundingModeGuard
~RoundingModeGuard()
Destructor.
Definition
RoundingModeGuard.hpp:25
dlinear
Global namespace for the dlinear library.
dlinear
util
RoundingModeGuard.hpp
Generated by
1.11.0