WSL/SLF GitLab Repository

Commit 11c561ab authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Pleasing CLang version 7.3.0...

parent 30910f87
......@@ -191,7 +191,7 @@ namespace Optim {
#endif
//see http://metamerist.com/cbrt/cbrt.htm
template <int n> inline float nth_rootf(float x) {
const bool sgn = (x<0.)? true : false;
const bool sgn = (x<0.f)? true : false;
if (sgn) x = -x;
const int ebits = 8;
const int fbits = 23;
......
......@@ -35,7 +35,7 @@ namespace mio {
* Initialize internal variables. It does NOT start timing.
*/
Timer::Timer()
: start_point(0.), elapsed(0.), isRunning(false) {}
: start_point(0.L), elapsed(0.), isRunning(false) {}
/**
* @brief Start the timer.
......@@ -106,7 +106,7 @@ long double Timer::getCurrentTime() const {
long double Timer::getCurrentTime() const {
timeval tp;
gettimeofday(&tp,NULL);
const long double t = static_cast<long double>(tp.tv_sec) + static_cast<long double>(tp.tv_usec)*1.e-6;
const long double t = static_cast<long double>(tp.tv_sec) + static_cast<long double>(tp.tv_usec)*1.e-6L;
return t;
}
......@@ -177,12 +177,12 @@ void UsageTimer::getElapsedTimes()
getrusage(UsageTimer::who, &current_usage);
//calculate start point
const long double start_user_time = static_cast<long double>(start_usage.ru_utime.tv_sec) + static_cast<long double>(start_usage.ru_utime.tv_usec)*1e-6;
const long double start_sys_time = static_cast<long double>(start_usage.ru_stime.tv_sec) + static_cast<long double>(start_usage.ru_stime.tv_usec)*1e-6;
const long double start_user_time = static_cast<long double>(start_usage.ru_utime.tv_sec) + static_cast<long double>(start_usage.ru_utime.tv_usec)*1e-6L;
const long double start_sys_time = static_cast<long double>(start_usage.ru_stime.tv_sec) + static_cast<long double>(start_usage.ru_stime.tv_usec)*1e-6L;
//calculate end point
const long double end_user_time = static_cast<long double>(current_usage.ru_utime.tv_sec) + static_cast<long double>(current_usage.ru_utime.tv_usec)*1e-6;
const long double end_sys_time = static_cast<long double>(current_usage.ru_stime.tv_sec) + static_cast<long double>(current_usage.ru_stime.tv_usec)*1e-6;
const long double end_user_time = static_cast<long double>(current_usage.ru_utime.tv_sec) + static_cast<long double>(current_usage.ru_utime.tv_usec)*1e-6L;
const long double end_sys_time = static_cast<long double>(current_usage.ru_stime.tv_sec) + static_cast<long double>(current_usage.ru_stime.tv_usec)*1e-6L;
//calculate different elapsed times
user_time = static_cast<double>( end_user_time - start_user_time );
......
......@@ -47,11 +47,11 @@ namespace mio {
const int Date::daysLeapYear[12] = {31,29,31,30,31,30,31,31,30,31,30,31};
const int Date::daysNonLeapYear[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
const double Date::DST_shift = 1.0; //in hours
const float Date::MJD_offset = 2400000.5; ///<offset between julian date and modified julian date
const float Date::Unix_offset = 2440587.5; ///<offset between julian date and Unix Epoch time
const float Date::RFC868_offset = 2415020.5; ///< offset between julian date and RFC868 time (ref is 1900-01-01T00:00 GMT)
const float Date::Excel_offset = 2415018.5; ///<offset between julian date and Excel dates (note that excel invented some days...)
const float Date::Matlab_offset = 1721058.5; ///<offset between julian date and Matlab dates
const double Date::MJD_offset = 2400000.5; ///<offset between julian date and modified julian date
const double Date::Unix_offset = 2440587.5; ///<offset between julian date and Unix Epoch time
const double Date::RFC868_offset = 2415020.5; ///< offset between julian date and RFC868 time (ref is 1900-01-01T00:00 GMT)
const double Date::Excel_offset = 2415018.5; ///<offset between julian date and Excel dates (note that excel invented some days...)
const double Date::Matlab_offset = 1721058.5; ///<offset between julian date and Matlab dates
const double Date::epsilon=1./(24.*3600.025); ///< minimum difference between two dates. 1 second in units of days. 3600.025 is intentional
//NOTE: For the comparison operators, we assume that dates are positive so we can bypass a call to abs()
......
......@@ -77,11 +77,11 @@ class Date {
static const int daysLeapYear[];
static const int daysNonLeapYear[];
static const double DST_shift;
static const float MJD_offset;
static const float RFC868_offset;
static const float Unix_offset;
static const float Excel_offset;
static const float Matlab_offset;
static const double MJD_offset;
static const double RFC868_offset;
static const double Unix_offset;
static const double Excel_offset;
static const double Matlab_offset;
Date();
Date(const double& julian_in, const double& in_timezone, const bool& in_dst=false);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment