mirror of https://github.com/CGAL/cgal
declare thread local, or const
This commit is contained in:
parent
4ee96e11c0
commit
9dd43b7d0a
|
|
@ -25,6 +25,7 @@
|
||||||
#include <CGAL/Interval_arithmetic.h>
|
#include <CGAL/Interval_arithmetic.h>
|
||||||
#include <CGAL/Homogeneous.h>
|
#include <CGAL/Homogeneous.h>
|
||||||
#include <CGAL/number_utils.h>
|
#include <CGAL/number_utils.h>
|
||||||
|
#include <CGAL/tss.h>
|
||||||
#undef CGAL_NEF_DEBUG
|
#undef CGAL_NEF_DEBUG
|
||||||
#define CGAL_NEF_DEBUG 5
|
#define CGAL_NEF_DEBUG 5
|
||||||
#include <CGAL/Nef_2/debug.h>
|
#include <CGAL/Nef_2/debug.h>
|
||||||
|
|
@ -93,14 +94,18 @@ public:
|
||||||
|
|
||||||
|
|
||||||
// only for visualization:
|
// only for visualization:
|
||||||
static void set_R(const RT& R) { R_ = R; }
|
|
||||||
|
static RT& R()
|
||||||
|
{
|
||||||
|
CGAL_STATIC_THREAD_LOCAL_VARIABLE(RT,R_,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void set_R(const RT& r) { R() = r; }
|
||||||
RT eval_at(const RT& r) const { return _m*r+_n; }
|
RT eval_at(const RT& r) const { return _m*r+_n; }
|
||||||
RT eval_at_R() const { return _m*R_+_n; }
|
RT eval_at_R() const { return _m*R()+_n; }
|
||||||
protected:
|
|
||||||
static RT R_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class RT> RT SPolynomial<RT>::R_;
|
|
||||||
|
|
||||||
template <typename RT>
|
template <typename RT>
|
||||||
int sign(const SPolynomial<RT>& p)
|
int sign(const SPolynomial<RT>& p)
|
||||||
|
|
@ -138,7 +143,7 @@ bool operator<(const SPolynomial<RT>& p1, int i)
|
||||||
|
|
||||||
template <class RT>
|
template <class RT>
|
||||||
inline double to_double(const SPolynomial<RT>& p)
|
inline double to_double(const SPolynomial<RT>& p)
|
||||||
{ return (CGAL::to_double(p.eval_at(SPolynomial<RT>::R_))); }
|
{ return (CGAL::to_double(p.eval_at(SPolynomial<RT>::R()))); }
|
||||||
|
|
||||||
template <class RT>
|
template <class RT>
|
||||||
std::ostream& operator<<(std::ostream& os, const SPolynomial<RT>& p)
|
std::ostream& operator<<(std::ostream& os, const SPolynomial<RT>& p)
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
#include <LEDA/graphics/color.h>
|
#include <LEDA/graphics/color.h>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
static int frame_default = 100;
|
static const int frame_default = 100;
|
||||||
|
|
||||||
template <typename CIRC>
|
template <typename CIRC>
|
||||||
leda_list<leda_point>
|
leda_list<leda_point>
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <CGAL/Kernel/mpl.h>
|
#include <CGAL/Kernel/mpl.h>
|
||||||
|
#include <CGAL/tss.h>
|
||||||
|
|
||||||
#include <boost/operators.hpp>
|
#include <boost/operators.hpp>
|
||||||
|
|
||||||
|
|
@ -70,7 +71,7 @@ class Nef_polynomial
|
||||||
const Base & polynomial() const { return static_cast<const Base&>(*this); }
|
const Base & polynomial() const { return static_cast<const Base&>(*this); }
|
||||||
|
|
||||||
static NT& infi_maximal_value() {
|
static NT& infi_maximal_value() {
|
||||||
static NT R_ = 1;
|
CGAL_STATIC_THREAD_LOCAL_VARIABLE(NT, R_, 1);
|
||||||
return R_;
|
return R_;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue