Closed Anirban166 closed 4 years ago
expect_time_complexity
, which will take care of all expected complexity testing cases, example:
expect_time_complexity("quadratic", PeakSegDP::cDPA(rpois(data.sizes, 1), rep(1, length(rpois(data.sizes, 1))), 3L), data.sizes = 10^seq(1, 4, by = 0.5))
[1] quadratic
expect_x_time
functions (x = complexity class) to call expect_time_complexity
internally, with the only requirement as a parameter being the ones passed onto asymptoticTimings
(no need to pass it, and complexity class will be defined by x) Example usage:
expect_quadratic_time(PeakSegDP::cDPA(rpois(data.sizes, 1), rep(1, length(rpois(data.sizes, 1))), 3L), data.sizes = 10^seq(1, 4, by = 0.5))
[1] quadratic
Added simple testing functions for the three main complexity classes (linear, log-linear, quadratic) following whats written here:
Added testthat files such as one for constrained changepoint model algorithms (more functions will be added later) with initial test cases of
PeakSegOptimal::PeakSegPDPA
andPeakSegDP::cDPA
made with the help of the above functions (syntax similar to testthat) and placed the optional packages in suggests as mentioned here@tdhock are these changes okay? Also are the testing functions in the form you expected them to be? please review once