- XBT_DEBUG("Total integral %f, last_time %f ",
- total_, lastTime_);
-}
-
-/**
- * \brief Binary search in array.
- * It returns the first point of the interval in which "a" is.
- * \param array Array
- * \param a Value to search
- * \param low Low bound to search in array
- * \param high Upper bound to search in array
- * \return Index of point
-*/
-int CpuTiTrace::binarySearch(double *array, double a, int low, int high)
-{
- xbt_assert(low < high, "Wrong parameters: low (%d) should be smaller than"
- " high (%d)", low, high);
-
- int mid;
- do {
- mid = low + (high - low) / 2;
- XBT_DEBUG("a %f low %d high %d mid %d value %f", a, low, high, mid,
- array[mid]);
-
- if (array[mid] > a)
- high = mid;
- else
- low = mid;
- }
- while (low < high - 1);
+ profile_.reset(new CpuTiProfile(speed_profile));
+ last_time_ = total_time;
+ total_ = profile_->integrate_simple(0, total_time);