Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computing
cbmroot
Commits
7e110f6f
Commit
7e110f6f
authored
3 years ago
by
Shreya Roy
Committed by
Volker Friese
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix event time boundaries
parent
4fe0c0a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!658
fix event time boundaries
Pipeline
#15198
passed
3 years ago
Stage: documentation
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
algo/evbuild/EventBuilder.h
+5
-3
5 additions, 3 deletions
algo/evbuild/EventBuilder.h
with
5 additions
and
3 deletions
algo/evbuild/EventBuilder.h
+
5
−
3
View file @
7e110f6f
...
@@ -101,9 +101,11 @@ namespace cbm
...
@@ -101,9 +101,11 @@ namespace cbm
template
<
typename
Data
>
template
<
typename
Data
>
static
typename
std
::
vector
<
Data
>
CopyRange
(
const
std
::
vector
<
Data
>&
source
,
double
tMin
,
double
tMax
)
static
typename
std
::
vector
<
Data
>
CopyRange
(
const
std
::
vector
<
Data
>&
source
,
double
tMin
,
double
tMax
)
{
{
auto
comp
=
[](
const
Data
&
obj
,
double
value
)
{
return
obj
.
GetTime
()
<
value
;
};
//auto comp = [](const Data& obj, double value) { return obj.GetTime() < value; };
auto
lower
=
std
::
lower_bound
(
source
.
begin
(),
source
.
end
(),
tMin
,
comp
);
auto
comp1
=
[](
const
Data
&
obj
,
double
value
)
{
return
obj
.
GetTime
()
<
value
;
};
auto
upper
=
std
::
lower_bound
(
lower
,
source
.
end
(),
tMax
,
comp
);
auto
comp2
=
[](
double
value
,
const
Data
&
obj
)
{
return
value
<
obj
.
GetTime
();
};
auto
lower
=
std
::
lower_bound
(
source
.
begin
(),
source
.
end
(),
tMin
,
comp1
);
auto
upper
=
std
::
upper_bound
(
lower
,
source
.
end
(),
tMax
,
comp2
);
return
std
::
vector
<
Data
>
(
lower
,
upper
);
return
std
::
vector
<
Data
>
(
lower
,
upper
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment