|
From: <got...@us...> - 2010-02-13 21:48:32
|
Revision: 590
http://scstudio.svn.sourceforge.net/scstudio/?rev=590&view=rev
Author: gotthardp
Date: 2010-02-13 21:48:22 +0000 (Sat, 13 Feb 2010)
Log Message:
-----------
Fix Linux build errors.
Modified Paths:
--------------
trunk/CMakeLists.txt
trunk/src/data/time.h
trunk/src/montecarlo/CMakeLists.txt
trunk/src/montecarlo/montecarlo.cpp
trunk/src/montecarlo/montecarlo.h
Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt 2010-02-13 20:48:22 UTC (rev 589)
+++ trunk/CMakeLists.txt 2010-02-13 21:48:22 UTC (rev 590)
@@ -38,6 +38,8 @@
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS")
ENDIF(MSVC)
+FIND_PACKAGE(Threads)
+
SET(Boost_USE_STATIC_LIBS ON)
SET(Boost_USE_MULTITHREADED ON)
FIND_PACKAGE(Boost COMPONENTS date_time thread REQUIRED)
Modified: trunk/src/data/time.h
===================================================================
--- trunk/src/data/time.h 2010-02-13 20:48:22 UTC (rev 589)
+++ trunk/src/data/time.h 2010-02-13 21:48:22 UTC (rev 590)
@@ -360,7 +360,7 @@
return MscIntervalCouple(m_closed&&right.m_closed,m_value-right.m_value);
}
- const MscIntervalCouple operator+(const T& value) const
+ const MscIntervalCouple operator+(const T& value) const
{
return MscIntervalCouple(m_closed,m_value+value);
}
@@ -490,27 +490,27 @@
};
template<>
-bool MscIntervalCouple<double>::operator==(const double& right) const
+inline bool MscIntervalCouple<double>::operator==(const double& right) const
{ return m_closed && fcmp(m_value, right) == 0; }
template<>
-bool MscIntervalCouple<double>::operator!=(const double& right) const
+inline bool MscIntervalCouple<double>::operator!=(const double& right) const
{ return !m_closed || fcmp(m_value, right) != 0; }
template<>
-bool MscIntervalCouple<double>::operator<(const double& right) const
+inline bool MscIntervalCouple<double>::operator<(const double& right) const
{ return fcmp(m_value, right) < 0; }
template<>
-bool MscIntervalCouple<double>::operator<=(const double& right) const
+inline bool MscIntervalCouple<double>::operator<=(const double& right) const
{ return (m_closed && fcmp(m_value, right) <= 0) || fcmp(m_value, right) < 0; }
template<>
-bool MscIntervalCouple<double>::operator>(const double& right) const
+inline bool MscIntervalCouple<double>::operator>(const double& right) const
{ return fcmp(m_value, right) > 0; }
template<>
-bool MscIntervalCouple<double>::operator>=(const double& right) const
+inline bool MscIntervalCouple<double>::operator>=(const double& right) const
{ return (m_closed && fcmp(m_value, right) >= 0) || fcmp(m_value, right) > 0; }
// end of MscIntervalCouple class
@@ -1250,7 +1250,7 @@
bool includes(const T& value) const
{
- for(IntervalList::const_iterator it = m_set.begin();
+ for(typename IntervalList::const_iterator it = m_set.begin();
it != m_set.end(); it++)
{
// if included in at least one of the intervals in the union
Modified: trunk/src/montecarlo/CMakeLists.txt
===================================================================
--- trunk/src/montecarlo/CMakeLists.txt 2010-02-13 20:48:22 UTC (rev 589)
+++ trunk/src/montecarlo/CMakeLists.txt 2010-02-13 21:48:22 UTC (rev 590)
@@ -8,6 +8,7 @@
TARGET_LINK_LIBRARIES(scmontecarlo
scmsc
${Boost_LIBRARIES}
+ ${CMAKE_THREAD_LIBS_INIT}
)
INSTALL(TARGETS scmontecarlo
Modified: trunk/src/montecarlo/montecarlo.cpp
===================================================================
--- trunk/src/montecarlo/montecarlo.cpp 2010-02-13 20:48:22 UTC (rev 589)
+++ trunk/src/montecarlo/montecarlo.cpp 2010-02-13 21:48:22 UTC (rev 590)
@@ -231,9 +231,9 @@
std::vector<boost::shared_ptr<boost::thread> > threads;
m_stoprequested = false;
- boost::variate_generator<boost::mt19937&, boost::uniform_int<> > seed(
+ boost::variate_generator<boost::mt19937, boost::uniform_int<> > seed(
boost::mt19937((boost::int32_t)time(NULL)),
- boost::uniform_int<>(0, MAXINT));
+ boost::uniform_int<>(0, INT_MAX));
if(m_process_count > 1)
{
@@ -256,7 +256,7 @@
return m_measurements;
}
-void MonteCarlo::thread_main(boost::int32_t seed, const MscPtr& msc)
+void MonteCarlo::thread_main(unsigned int seed, const MscPtr& msc)
{
// pseudo-random number generators should not be initialized frequently
// to assure reentrance, we have one generator per thread
Modified: trunk/src/montecarlo/montecarlo.h
===================================================================
--- trunk/src/montecarlo/montecarlo.h 2010-02-13 20:48:22 UTC (rev 589)
+++ trunk/src/montecarlo/montecarlo.h 2010-02-13 21:48:22 UTC (rev 590)
@@ -65,7 +65,7 @@
typedef std::map<std::string, double> MeasurementsMap;
const MeasurementsMap& run(const MscPtr& msc);
- void thread_main(boost::int32_t seed, const MscPtr& msc);
+ void thread_main(unsigned int seed, const MscPtr& msc);
private:
int m_process_count;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|