Skip to content

Commit e733699

Browse files
committed
Restore floating point rounding mode on Windows (fixes #45)
1 parent bd9e549 commit e733699

2 files changed

Lines changed: 13 additions & 41 deletions

File tree

changelog.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ Date: 2019-??-??
6868
[DESCRIPTION]
6969
Let's see.
7070

71+
[ENTRY]
72+
Module: float
73+
What: bug
74+
Rank: minor
75+
Thanks: Kurt Van Den Branden
76+
[DESCRIPTION]
77+
Restore floating point rounding mode under Windows.
78+
7179
[ENTRY]
7280
Module: kernel
7381
What: change

gecode/float.hh

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ namespace Gecode { namespace Float {
135135
*
136136
*/
137137
/// Rounding Base class (safe version)
138-
typedef gecode_boost::numeric::interval_lib::rounded_arith_std<FloatNum>
139-
RoundingBase;
138+
typedef gecode_boost::numeric::interval_lib::save_state< gecode_boost::numeric::interval_lib::rounded_arith_std<FloatNum> >
139+
RoundingBase;
140140

141141
#else
142142

@@ -1949,23 +1949,12 @@ namespace Gecode {
19491949
FloatVarValPrint vvp=nullptr);
19501950

19511951
/**
1952-
* \brief Assign all \a x with variable selection \a vars and value selection \a vals
1953-
*
1954-
* \ingroup TaskModelFloatBranch
1955-
*/
1956-
GECODE_FLOAT_EXPORT void
1957-
assign(Home home, const FloatVarArgs& x,
1958-
FloatVarBranch vars, FloatAssign vals,
1959-
FloatBranchFilter bf=nullptr,
1960-
FloatVarValPrint vvp=nullptr);
1961-
/**
1962-
* \brief Assign all \a x with tie-breaking variable selection \a vars and value selection \a vals
1952+
* \brief Assign all \a x with value selection \a vals
19631953
*
19641954
* \ingroup TaskModelFloatBranch
19651955
*/
19661956
GECODE_FLOAT_EXPORT void
1967-
assign(Home home, const FloatVarArgs& x,
1968-
TieBreak<FloatVarBranch> vars, FloatAssign vals,
1957+
assign(Home home, const FloatVarArgs& x, FloatAssign vals,
19691958
FloatBranchFilter bf=nullptr,
19701959
FloatVarValPrint vvp=nullptr);
19711960
/**
@@ -1976,35 +1965,10 @@ namespace Gecode {
19761965
GECODE_FLOAT_EXPORT void
19771966
assign(Home home, FloatVar x, FloatAssign vals,
19781967
FloatVarValPrint vvp=nullptr);
1968+
//@}
19791969

19801970
}
19811971

1982-
namespace Gecode {
1983-
1984-
/**
1985-
* \brief Branch over \a x with value selection \a vals
1986-
*
1987-
* \ingroup TaskModelFloatBranch
1988-
*/
1989-
void
1990-
branch(Home home, const FloatVarArgs& x, FloatValBranch vals,
1991-
FloatBranchFilter bf=nullptr,
1992-
FloatVarValPrint vvp=nullptr);
1993-
1994-
/**
1995-
* \brief Assign all \a x with value selection \a vals
1996-
*
1997-
* \ingroup TaskModelFloatBranch
1998-
*/
1999-
void
2000-
assign(Home home, const FloatVarArgs& x, FloatAssign vals,
2001-
FloatBranchFilter bf=nullptr,
2002-
FloatVarValPrint vvp=nullptr);
2003-
2004-
}
2005-
2006-
#include <gecode/float/branch.hpp>
2007-
20081972
namespace Gecode {
20091973

20101974
/*

0 commit comments

Comments
 (0)