Skip to content
Snippets Groups Projects
Commit 0551746e authored by jgatt's avatar jgatt
Browse files

Now DMwindows_list is explicitly assumed to be sorted and disjoint + small...

Now DMwindows_list is explicitly assumed to be sorted and disjoint + small optimization in index_in_dm_window assuming that
parent fde56e7d
Branches
Tags
1 merge request!16Merge request multibehavior
Pipeline #5533 passed
......@@ -18,6 +18,9 @@ bool DMWindow_list::date_in_dm_window(double date){
std::vector<DMWindow_list>::size_type DMWindow_list::index_in_dm_window(double date){
for ( std::vector<DMWindow>::size_type i=0; i < content.size();i++){
DMWindow dm_window = content[i];
if(dm_window.inf > date){
return content.size();
}
if(dm_window.date_in_dm_window(date)){
return i;
}
......
......@@ -10,7 +10,9 @@
* @brief list of date interval
* @details DMWindow_list is a struct that contains a list of DMwindow and
* provide function to check whether or not we are
* in one of these windows.
* in one of these windows. The interval in the list are assumed to be disjoint
* (i.e the intersection between one interval and another is empty) and sorted
* (i.e lexicographic order on the boundaries)
*/
struct DMWindow_list
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment