-/* Copyright (c) 2007-2010, 2012-2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/********************************** Storage *************************************/
typedef xbt_dictelm_t smx_storage_t;
-typedef struct s_smx_storage_priv *smx_storage_priv_t;
/* ****************************** Process *********************************** */
bool isUsed() { return true; }
};
+static inline bool doubleEq(double d1, double d2)
+{
+ return std::abs(d1 - d2) < 0.0001;
+}
class Evt {
public:
double date;
double value;
explicit Evt(double d, double v) : date(d), value(v) {}
- bool operator==(Evt e2) { return (date == e2.date) && (value == e2.value); }
- bool operator!=(Evt e2) { return (date != e2.date) || (value != e2.value); }
+ bool operator==(Evt e2) { return (doubleEq(date, e2.date)) && (doubleEq(value, e2.value)); }
+ bool operator!=(Evt e2) { return !(*this == e2); }
};
static std::ostream& operator<<(std::ostream& out, const Evt& e)
{