Ocean
Loading...
Searching...
No Matches
Timestamp.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_BASE_TIMESTAMP_H
9#define META_OCEAN_BASE_TIMESTAMP_H
10
11#include "ocean/base/Base.h"
12#include "ocean/base/Lock.h"
13
14#include <atomic>
15#include <cfloat>
16#include <limits>
17
18#if !defined(OCEAN_PLATFORM_BUILD_WINDOWS) && defined(CLOCK_BOOTTIME)
19 #define OCEAN_BASE_TIMESTAMP_BOOTTIME_AVAILABLE
20#endif
21
22#if defined(OCEAN_PLATFORM_BUILD_APPLE) && defined(CLOCK_UPTIME_RAW)
23 #define OCEAN_BASE_TIMESTAMP_UPTIMERAW_AVAILABLE
24#endif
25
26namespace Ocean
27{
28
29// Forward declaration.
30class Timestamp;
31
32/**
33 * Definition of a vector holding Timestamp objects.
34 * @see Timestamp
35 * @ingroup base
36 */
37using Timestamps = std::vector<Timestamp>;
38
39/**
40 * This class implements a timestamp.
41 * The timestamp is specified by the number of seconds since 01.01.1970 00:00:00 in UTC time.<br>
42 * Depending on the underlying hardware the accuracy (update rate) of the timestamps can vary.<br>
43 * The timestamp class wraps a floating value with 64 bit precision.
44 * @ingroup base
45 */
46class OCEAN_BASE_EXPORT Timestamp
47{
48 public:
49
50 /**
51 * This class is a helper class allowing to converter timestamps defined in a specific time domain to unix timestamps.
52 */
53 class OCEAN_BASE_EXPORT TimestampConverter
54 {
55 public:
56
57 /**
58 * Definition of individual time domains.
59 */
60 enum TimeDomain : uint32_t
61 {
62 /// An invalid time domain.
63 TD_INVALID = 0u,
64 /// The monotonically increasing time domain defined in nanoseconds, not increasing during system sleep.
66
67#ifdef OCEAN_BASE_TIMESTAMP_BOOTTIME_AVAILABLE
68 /// The monotonically increasing time domain defined in nanoseconds, increasing during system sleep, not available on Windows.
70#endif
71
72#ifdef OCEAN_BASE_TIMESTAMP_UPTIMERAW_AVAILABLE
73 /// The monotonically increasing time domain defined in nanoseconds, the time the system has been awake since the last time it was restarted.
75#endif
76 };
77
78 /**
79 * Definition of an invalid value.
80 */
81 static constexpr int64_t invalidValue_ = std::numeric_limits<int64_t>::lowest();
82
83 public:
84
85 /**
86 * Creates an invalid converter object.
87 * @see isValid().
88 */
89 TimestampConverter() = default;
90
91 /**
92 * Creates a new converter object for a specific time domain.
93 * @param timeDomain The time domain for which the converter will be created
94 * @param necessaryMeasurements The number of measurements necessary to determine the offset between the domain time and the unix time, with range [1, infinity)
95 */
96 explicit TimestampConverter(const TimeDomain timeDomain, const size_t necessaryMeasurements = 100);
97
98 /**
99 * Move constructor.
100 * @param converter The converter to be moved
101 */
102 inline TimestampConverter(TimestampConverter&& converter);
103
104 /**
105 * Converts a timestamp defined in the converter's time domain to a unix timestamp.
106 * @param domainTimestampNs The timestamp in the converter's time domain, in nanoseconds, with range (-infinity, infinity)
107 * @return The converted unix timestamp
108 */
109 Timestamp toUnix(const int64_t domainTimestampNs);
110
111 /**
112 * Converts a timestamp defined in the converter's time domain to a unix timestamp.
113 * @param domainTimestampSeconds The timestamp in the converter's time domain, in seconds, with range (-infinity, infinity)
114 * @return The converted unix timestamp
115 */
116 Timestamp toUnix(const double domainTimestampSeconds);
117
118 /**
119 * Returns whether a given domain timestamp is within a specified range of the current domain timestamp.
120 * @param domainTimestampNs The domain timestamp to check, in nanoseconds, with range (-infinity, infinity)
121 * @param maxDistance The maximal distance between the domain timestamp and the current domain timestamp, in seconds, with range [0, infinity)
122 * @param distance Optional resulting distance between the domain timestamp and the current domain timestamp, in seconds, with range (-infinity, infinity)
123 * @return True, if so
124 */
125 bool isWithinRange(const int64_t domainTimestampNs, const double maxDistance = 1.0, double* distance = nullptr);
126
127 /**
128 * Returns the time domain of this converter.
129 * @return The converter's time domain
130 */
131 inline TimeDomain timeDomain() const;
132
133 /**
134 * Returns the offset between the domain time and the unix time, in nanoseconds.
135 * Unix time = domain time + domainToUnixOffset
136 * @return The offset between the domain time and the unix time, in nanoseconds, with range (-infinity, infinity)
137 */
139
140 /**
141 * Returns whether this converter has been initialized with a valid time domain.
142 * @return True, if so
143 */
144 inline bool isValid() const;
145
146 /**
147 * Returns whether this converter is valid.
148 * @return True, if so
149 */
150 inline operator bool() const;
151
152 /**
153 * Move operator.
154 * @param converter The converter to be moved
155 * @return Reference to this object
156 */
158
159 /**
160 * Returns the current timestamp in a specified time domain.
161 * @param timeDomain The time domain for which the current timestamp will be returned
162 * @return The current timestamp in the specified time domain, in nanoseconds
163 */
164 static int64_t currentTimestampNs(const TimeDomain timeDomain);
165
166#ifndef OCEAN_PLATFORM_BUILD_WINDOWS
167
168 /**
169 * Return the current timestamp in a specified POSIX clock id.
170 * @param posixClockId The POSIX clock id for which the current timestamp will be returned
171 * @return The current timestamp in the specified POSIX clock id, in nanoseconds
172 */
173 static int64_t currentTimestampNs(const int posixClockId);
174
175 protected:
176
177 /**
178 * Returns the POSIX clock id associated with a time domain.
179 * @param timeDomain The time domain for which the associated POSIX clock id will be returned
180 * @return The POSIX clock id associated with the specified time domain, -1 if no associated POSIX clock id exists
181 */
182 static int posixClockId(const TimeDomain timeDomain);
183
184#endif // OCEAN_PLATFORM_BUILD_WINDOWS
185
186 protected:
187
188 /// The time domain of this converter.
189 TimeDomain timeDomain_ = TD_INVALID;
190
191 /// The offset between the domain time and the unix time, in nanoseconds.
192 std::atomic_int64_t domainToUnixOffsetNs_ = invalidValue_;
193
194 /// The initial domain timestamp, in nanoseconds.
195 int64_t initialDomainNs_ = invalidValue_;
196
197 /// The initial unix timestamp, in nanoseconds.
198 int64_t initialUnixNs_ = invalidValue_;
199
200 /// The measured sum of the domain to unix offsets, in nanoseconds.
201 int64_t sumDomainToUnixOffsetNs_ = 0;
202
203 /// The number of measurements.
204 size_t measurements_ = 0;
205
206 /// The number of necessary measurements before the converter keeps the determined offset fixed.
207 size_t necessaryMeasurements_ = 0;
208
209 /// The converter's lock.
211
212#ifndef OCEAN_PLATFORM_BUILD_WINDOWS
213 /// The POSIX clock id associated with the time domain.
214 int domainPosixClockId_ = -1;
215#endif
216 };
217
218 public:
219
220 /**
221 * Creates a new timestamp with invalid time.
222 */
223 Timestamp() = default;
224
225 /**
226 * Creates a new timestamp.
227 * @param toNow Determines whether the timestamp holds the seconds since 01.01.1970 00:00:00 in UTC time, otherwise the timestamp will be initialized as invalid
228 */
229 explicit Timestamp(const bool toNow);
230
231 /**
232 * Creates a new timestamp with a given value.
233 * @param timestamp Timestamp value
234 */
235 inline explicit Timestamp(const double timestamp);
236
237 /**
238 * Sets the timestamp to the current time.
239 * The timestamp holds the seconds since 01.01.1970 00:00:00 in UTC time.
240 * @return Reference to this object
241 */
243
244 /**
245 * Sets the timestamp to invalid.
246 * @return Reference to this object
247 */
248 inline Timestamp& toInvalid();
249
250 /**
251 * Returns this timestamp in nanoseconds.
252 * @return The timestamp in nanoseconds, with range (-infinity, infinity)
253 */
254 inline int64_t nanoseconds() const;
255
256 /**
257 * Returns whether a specified amount of time has passed since this timestamp.
258 * This function returns 'thisTimestamp + seconds <= currentTimestamp'.
259 * @param seconds The number of seconds defining the time to check, with range [0, infinity)
260 * @param currentTimestamp The current timestamp to use for comparison
261 * @return True, if the time has passed or if this timestamp is invalid
262 */
263 inline bool hasTimePassed(const double seconds, const Timestamp& currentTimestamp = Timestamp(true)) const;
264
265 /**
266 * Returns whether the timestamp holds a valid time.
267 * @return True, if so
268 */
269 inline bool isValid() const;
270
271 /**
272 * Returns whether the timestamp holds an invalid time.
273 * @return True, if so
274 */
275 inline bool isInvalid() const;
276
277 /**
278 * Assign a new value.
279 * @param timestamp Value to assign
280 * @return Reference to this timestamp
281 */
282 inline Timestamp& operator=(const double timestamp);
283
284 /**
285 * Adds two timestamps.
286 * @param right The right timestamp
287 * @return New timestamp
288 */
289 inline Timestamp operator+(const Timestamp& right) const;
290
291 /**
292 * Adds and assigns two timestamps.
293 * @param right The right timestamp
294 * @return Reference to this timestamp
295 */
296 inline Timestamp& operator+=(const Timestamp& right);
297
298 /**
299 * Adds seconds to this timestamps.
300 * @param seconds The number of seconds to add, with range (-infinity, infinity)
301 * @return New timestamp
302 */
303 inline Timestamp operator+(const double seconds) const;
304
305 /**
306 * Adds and assigns seconds to this timestamps.
307 * @param seconds The number of seconds to add, with range (-infinity, infinity)
308 * @return Reference to this timestamp
309 */
310 inline Timestamp& operator+=(const double seconds);
311
312 /**
313 * Subtracts two timestamps.
314 * @param right The right timestamp
315 * @return New timestamp
316 */
317 inline Timestamp operator-(const Timestamp& right) const;
318
319 /**
320 * Subtracts and assigns two timestamps.
321 * @param right The right timestamp
322 * @return Reference to this timestamp
323 */
324 inline Timestamp& operator-=(const Timestamp& right);
325
326 /**
327 * Subtracts seconds from this timestamp.
328 * @param seconds The number of seconds to subtract, with range (-infinity, infinity)
329 * @return New timestamp
330 */
331 inline Timestamp operator-(const double seconds) const;
332
333 /**
334 * Subtracts and assigns seconds from this timestamp.
335 * @param seconds The number of seconds to subtract, with range (-infinity, infinity)
336 * @return Reference to this timestamp
337 */
338 inline Timestamp& operator-=(const double seconds);
339
340 /**
341 * Returns whether the this timestamp is lesser than the right one.
342 * @param right The right timestamp
343 * @return True, if so
344 */
345 inline bool operator<(const Timestamp& right) const;
346
347 /**
348 * Returns whether the this timestamp is lesser or equal to the right one.
349 * @param right The right timestamp
350 * @return True, if so
351 */
352 inline bool operator<=(const Timestamp& right) const;
353
354 /**
355 * Returns whether the this timestamp is greater than the right one.
356 * @param right The right timestamp
357 * @return True, if so
358 */
359 inline bool operator>(const Timestamp& right) const;
360
361 /**
362 * Returns whether the this timestamp is greater or equal to the right one.
363 * @param right The right timestamp
364 * @return True, if so
365 */
366 inline bool operator>=(const Timestamp& right) const;
367
368 /**
369 * Returns whether two timestamps are identical.
370 * @param right The right timestamp
371 * @return True, if so
372 */
373 inline bool operator==(const Timestamp& right) const;
374
375 /**
376 * Returns whether two timestamps are not identical.
377 * @param right The right timestamp
378 * @return True, if so
379 */
380 inline bool operator!=(const Timestamp& right) const;
381
382 /**
383 * Cast operator for the timestamp value.
384 * @return Timestamp
385 */
386 explicit inline operator double() const;
387
388 /**
389 * Hash function.
390 * @param timestamp The timestamp for which the hash value will be determined
391 * @return The resulting hash value
392 */
393 inline size_t operator()(const Timestamp& timestamp) const;
394
395 /**
396 * Converts seconds to milliseconds.
397 * @param seconds The seconds to convert, with range (-infinity, infinity)
398 * @return The resulting milliseconds
399 */
400 static constexpr int64_t seconds2milliseconds(const double seconds);
401
402 /**
403 * Converts seconds to microseconds.
404 * @param seconds The seconds to convert, with range (-infinity, infinity)
405 * @return The resulting microseconds
406 */
407 static constexpr int64_t seconds2microseconds(const double seconds);
408
409 /**
410 * Converts seconds to nanoseconds.
411 * @param seconds The seconds to convert, with range (-infinity, infinity)
412 * @return The resulting nanoseconds
413 */
414 static constexpr int64_t seconds2nanoseconds(const double seconds);
415
416 /**
417 * Converts milliseconds to seconds.
418 * @param milliseconds The milliseconds to convert, with range (-infinity, infinity)
419 * @return The resulting seconds
420 */
421 static constexpr double milliseconds2seconds(const int64_t milliseconds);
422
423 /**
424 * Converts microseconds to seconds.
425 * @param microseconds The microseconds to convert, with range (-infinity, infinity)
426 * @return The resulting seconds
427 */
428 static constexpr double microseconds2seconds(const int64_t microseconds);
429
430 /**
431 * Converts nanoseconds to seconds.
432 * @param nanoseconds The nanoseconds to convert, with range (-infinity, infinity)
433 * @return The resulting seconds
434 */
435 static constexpr double nanoseconds2seconds(const int64_t nanoseconds);
436
437 protected:
438
439 /**
440 * Returns the of an invalid timestamp.
441 * @return Invalid timestamp value
442 */
443 static constexpr double invalidTimestampValue();
444
445 protected:
446
447 /// Timestamp value.
448 double value_ = invalidTimestampValue();
449};
450
452{
453 *this = std::move(converter);
454}
455
460
462{
463 return timeDomain_ != TD_INVALID && necessaryMeasurements_ != 0;
464}
465
466inline Timestamp::TimestampConverter::operator bool() const
467{
468 return isValid();
469}
470
471inline Timestamp::Timestamp(const double timestamp) :
472 value_(timestamp)
473{
474 // nothing to do here
475}
476
478{
480
481 return *this;
482}
483
484inline int64_t Timestamp::nanoseconds() const
485{
486 ocean_assert(isValid());
487
489}
490
491inline bool Timestamp::hasTimePassed(const double seconds, const Timestamp& currentTimestamp) const
492{
493 ocean_assert(seconds >= 0.0);
494 ocean_assert(currentTimestamp.isValid());
495
496 if (!isValid())
497 {
498 return true;
499 }
500
501 return double(*this) + seconds <= double(currentTimestamp);
502}
503
504inline bool Timestamp::isValid() const
505{
506 return value_ != invalidTimestampValue();
507}
508
509inline bool Timestamp::isInvalid() const
510{
511 return value_ == invalidTimestampValue();
512}
513
514inline Timestamp& Timestamp::operator=(const double timestamp)
515{
516 value_ = timestamp;
517
518 return *this;
519}
520
521inline Timestamp Timestamp::operator+(const Timestamp& right) const
522{
523 return Timestamp(value_ + right.value_);
524}
525
527{
528 value_ += right.value_;
529
530 return *this;
531}
532
533inline Timestamp Timestamp::operator+(const double seconds) const
534{
535 return Timestamp(value_ + seconds);
536}
537
538inline Timestamp& Timestamp::operator+=(const double seconds)
539{
540 value_ += seconds;
541
542 return *this;
543}
544
545inline Timestamp Timestamp::operator-(const Timestamp& right) const
546{
547 return Timestamp(value_ - right.value_);
548}
549
551{
552 value_ -= right.value_;
553
554 return *this;
555}
556
557inline Timestamp Timestamp::operator-(const double seconds) const
558{
559 return Timestamp(value_ - seconds);
560}
561
562inline Timestamp& Timestamp::operator-=(const double seconds)
563{
564 value_ -= seconds;
565
566 return *this;
567}
568
569inline bool Timestamp::operator<(const Timestamp& right) const
570{
571 return value_ < right.value_;
572}
573
574inline bool Timestamp::operator<=(const Timestamp& right) const
575{
576 return value_ <= right.value_;
577}
578
579inline bool Timestamp::operator>(const Timestamp& right) const
580{
581 return value_ > right.value_;
582}
583
584inline bool Timestamp::operator>=(const Timestamp& right) const
585{
586 return value_ >= right.value_;
587}
588
589inline bool Timestamp::operator==(const Timestamp& right) const
590{
591 return value_ == right.value_;
592}
593
594inline bool Timestamp::operator!=(const Timestamp& right) const
595{
596 return value_ != right.value_;
597}
598
599inline Timestamp::operator double() const
600{
601 return value_;
602}
603
604inline size_t Timestamp::operator()(const Timestamp& timestamp) const
605{
606 return std::hash<double>{}(double(timestamp));
607}
608
609constexpr int64_t Timestamp::seconds2milliseconds(const double seconds)
610{
611 // 1000 milliseconds = 1 second
612
613 if (seconds >= 0.0)
614 {
615 return int64_t(seconds * 1.0e3 + 0.5);
616 }
617 else
618 {
619 return int64_t(seconds * 1.0e3 - 0.5);
620 }
621}
622
623constexpr int64_t Timestamp::seconds2microseconds(const double seconds)
624{
625 // 1000 milliseconds = 1 second
626 // 1000 microseconds = 1 milliseconds
627
628 if (seconds >= 0.0)
629 {
630 return int64_t(seconds * 1.0e6 + 0.5);
631 }
632 else
633 {
634 return int64_t(seconds * 1.0e6 - 0.5);
635 }
636}
637
638constexpr int64_t Timestamp::seconds2nanoseconds(const double seconds)
639{
640 // 1000 milliseconds = 1 second
641 // 1000 microseconds = 1 milliseconds
642 // 1000 nanoseconds = 1 microseconds
643
644 if (seconds >= 0.0)
645 {
646 return int64_t(seconds * 1.0e9 + 0.5);
647 }
648 else
649 {
650 return int64_t(seconds * 1.0e9 - 0.5);
651 }
652}
653
654constexpr double Timestamp::milliseconds2seconds(const int64_t milliseconds)
655{
656 return double(milliseconds) / 1.0e3;
657}
658
659constexpr double Timestamp::microseconds2seconds(const int64_t microseconds)
660{
661 return double(microseconds) / 1.0e6;
662}
663
664constexpr double Timestamp::nanoseconds2seconds(const int64_t nanoseconds)
665{
666 return double(nanoseconds) / 1.0e9;
667}
668
670{
671 return -DBL_MAX;
672}
673
674}
675
676#endif // META_OCEAN_BASE_TIMESTAMP_H
This class implements a recursive lock object.
Definition Lock.h:31
This class is a helper class allowing to converter timestamps defined in a specific time domain to un...
Definition Timestamp.h:54
int64_t domainToUnixOffset()
Returns the offset between the domain time and the unix time, in nanoseconds.
TimeDomain timeDomain() const
Returns the time domain of this converter.
Definition Timestamp.h:456
TimeDomain
Definition of individual time domains.
Definition Timestamp.h:61
@ TD_MONOTONIC
The monotonically increasing time domain defined in nanoseconds, not increasing during system sleep.
Definition Timestamp.h:65
@ TD_UPTIME_RAW
The monotonically increasing time domain defined in nanoseconds, the time the system has been awake s...
Definition Timestamp.h:74
@ TD_BOOTTIME
The monotonically increasing time domain defined in nanoseconds, increasing during system sleep,...
Definition Timestamp.h:69
static int64_t currentTimestampNs(const TimeDomain timeDomain)
Returns the current timestamp in a specified time domain.
bool isWithinRange(const int64_t domainTimestampNs, const double maxDistance=1.0, double *distance=nullptr)
Returns whether a given domain timestamp is within a specified range of the current domain timestamp.
bool isValid() const
Returns whether this converter has been initialized with a valid time domain.
Definition Timestamp.h:461
Timestamp toUnix(const double domainTimestampSeconds)
Converts a timestamp defined in the converter's time domain to a unix timestamp.
static int posixClockId(const TimeDomain timeDomain)
Returns the POSIX clock id associated with a time domain.
Timestamp toUnix(const int64_t domainTimestampNs)
Converts a timestamp defined in the converter's time domain to a unix timestamp.
Lock lock_
The converter's lock.
Definition Timestamp.h:210
TimestampConverter()=default
Creates an invalid converter object.
static int64_t currentTimestampNs(const int posixClockId)
Return the current timestamp in a specified POSIX clock id.
TimestampConverter(const TimeDomain timeDomain, const size_t necessaryMeasurements=100)
Creates a new converter object for a specific time domain.
TimestampConverter & operator=(TimestampConverter &&converter)
Move operator.
This class implements a timestamp.
Definition Timestamp.h:47
bool operator>=(const Timestamp &right) const
Returns whether the this timestamp is greater or equal to the right one.
Definition Timestamp.h:584
static constexpr int64_t seconds2milliseconds(const double seconds)
Converts seconds to milliseconds.
Definition Timestamp.h:609
bool isValid() const
Returns whether the timestamp holds a valid time.
Definition Timestamp.h:504
size_t operator()(const Timestamp &timestamp) const
Hash function.
Definition Timestamp.h:604
static constexpr double nanoseconds2seconds(const int64_t nanoseconds)
Converts nanoseconds to seconds.
Definition Timestamp.h:664
bool operator!=(const Timestamp &right) const
Returns whether two timestamps are not identical.
Definition Timestamp.h:594
Timestamp(const bool toNow)
Creates a new timestamp.
static constexpr int64_t seconds2microseconds(const double seconds)
Converts seconds to microseconds.
Definition Timestamp.h:623
static constexpr double microseconds2seconds(const int64_t microseconds)
Converts microseconds to seconds.
Definition Timestamp.h:659
bool hasTimePassed(const double seconds, const Timestamp &currentTimestamp=Timestamp(true)) const
Returns whether a specified amount of time has passed since this timestamp.
Definition Timestamp.h:491
Timestamp & toInvalid()
Sets the timestamp to invalid.
Definition Timestamp.h:477
bool operator<=(const Timestamp &right) const
Returns whether the this timestamp is lesser or equal to the right one.
Definition Timestamp.h:574
bool operator==(const Timestamp &right) const
Returns whether two timestamps are identical.
Definition Timestamp.h:589
double value_
Timestamp value.
Definition Timestamp.h:448
int64_t nanoseconds() const
Returns this timestamp in nanoseconds.
Definition Timestamp.h:484
bool operator>(const Timestamp &right) const
Returns whether the this timestamp is greater than the right one.
Definition Timestamp.h:579
bool operator<(const Timestamp &right) const
Returns whether the this timestamp is lesser than the right one.
Definition Timestamp.h:569
Timestamp operator-(const Timestamp &right) const
Subtracts two timestamps.
Definition Timestamp.h:545
Timestamp operator+(const Timestamp &right) const
Adds two timestamps.
Definition Timestamp.h:521
Timestamp & operator+=(const Timestamp &right)
Adds and assigns two timestamps.
Definition Timestamp.h:526
static constexpr int64_t seconds2nanoseconds(const double seconds)
Converts seconds to nanoseconds.
Definition Timestamp.h:638
bool isInvalid() const
Returns whether the timestamp holds an invalid time.
Definition Timestamp.h:509
Timestamp()=default
Creates a new timestamp with invalid time.
static constexpr double invalidTimestampValue()
Returns the of an invalid timestamp.
Definition Timestamp.h:669
Timestamp & toNow()
Sets the timestamp to the current time.
static constexpr double milliseconds2seconds(const int64_t milliseconds)
Converts milliseconds to seconds.
Definition Timestamp.h:654
Timestamp & operator=(const double timestamp)
Assign a new value.
Definition Timestamp.h:514
Timestamp & operator-=(const Timestamp &right)
Subtracts and assigns two timestamps.
Definition Timestamp.h:550
std::vector< Timestamp > Timestamps
Definition of a vector holding Timestamp objects.
Definition Timestamp.h:37
The namespace covering the entire Ocean framework.
Definition Accessor.h:15
AutomaticDifferentiationT< T1, TNumeric1 > operator+(const T2 &left, const AutomaticDifferentiationT< T1, TNumeric1 > &right)
Definition AutomaticDifferentiation.h:418
AutomaticDifferentiationT< T1, TNumeric1 > operator-(const T2 &left, const AutomaticDifferentiationT< T1, TNumeric1 > &right)
Definition AutomaticDifferentiation.h:484