Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Dmitri Naumov
ogs
Commits
36bde610
Commit
36bde610
authored
6 years ago
by
wenqing
Browse files
Options
Downloads
Patches
Plain Diff
[Time] Added a class for a time interval
parent
1287fe07
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
NumLib/TimeStepping/TimeInterval.h
+41
-0
41 additions, 0 deletions
NumLib/TimeStepping/TimeInterval.h
with
41 additions
and
0 deletions
NumLib/TimeStepping/TimeInterval.h
0 → 100644
+
41
−
0
View file @
36bde610
/**
*
* \copyright
* Copyright (c) 2012-2018, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
* File: TimeInterval.h
*
* Created on November 26, 2018, 4:44 PM
*/
#pragma once
namespace
NumLib
{
/*!
* Class for a time interval, which has a member to check whether the given time
* is in this time interval.
*/
class
TimeInterval
{
public:
TimeInterval
(
const
double
start_time
,
const
double
end_time
)
:
_start_time
(
start_time
),
_end_time
(
end_time
)
{
}
bool
isInThisTimeInterval
(
const
double
current_time
)
const
{
return
(
current_time
>=
_start_time
&&
current_time
<=
_end_time
)
?
true
:
false
;
}
private
:
const
double
_start_time
;
const
double
_end_time
;
};
}
// end of namespace
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