Docs: Consistent use of maathematical interval symbols

This commit is contained in:
Paul Beckingham 2016-04-17 12:05:17 -04:00
parent 30e7a8ca3f
commit 0810cdeca6
5 changed files with 77 additions and 77 deletions

View file

@ -9,9 +9,9 @@ provided by the user representing ongoing work.
An exclusion is also a block of time but represents untrackable time, and acts
as a mask for the inclusions. Here is a visual example:
Inclusion: |-----------------------------------| tag1
Exclusion: |---| lunch
Exclusion |---| dinner
Inclusion: [-----------------------------------) tag1
Exclusion: [---) lunch
Exclusion [---) dinner
Timeline: ..:...:...:...:...:...:...:...:...:...:...:...:...:...
7 8 9 10 11 12 1 2 3 4 5 6 7

View file

@ -209,9 +209,9 @@ scripts. To run un quiet mode, add the ':quiet' hint to the command line:
- Given this scenario:
Exclusion: ------|
Exclusion: |----------
Inclusion: |-|
Exclusion: ------)
Exclusion: [----------
Inclusion: [-)
Now: |
Timeline: >--o---o---o---o---o---o---o---o---o---o---o---o---o-->
7 8 9 10 11 12 1 2 3 4 5 6 7

View file

@ -37,14 +37,14 @@
//
// Inputs:
//
// |------------------------------------------------------| Timeline
// |-------------------------------------| Inclusion
// |--------| |--------| |--------| Exclusion
// [------------------------------------------------------) Timeline
// [-------------------------------------) Inclusion
// [--------) [--------) [--------) Exclusion
//
// Derived:
//
// |-----------| |----------------| Tracked
// |-------| |-----| Gaps
// [-----------) [----------------) Tracked
// [-------) [-----) Gaps
//
////////////////////////////////////////////////////////////////////////////////

View file

@ -287,12 +287,12 @@ Interval createIntervalFromFilter (const Filter& filter)
//
// timeline.start timeline.end
// | |
// A [--------] | |
// B [----|----] |
// C | [------------] |
// D | [----|----]
// E | | [--------]
// F [----|-------------------|----]
// A [--------) | |
// B [----|----) |
// C | [------------) |
// D | [----|----)
// E | | [--------)
// F [----|-------------------|----)
// | |
//
// We really only need to eliminate A and F.

View file

@ -49,16 +49,16 @@ int main (int, char**)
t.is (i1.isStarted (), true, "Daterange(start=now,end=now).isStarted -> true");
t.is (i1.isEnded (), true, "Daterange(start=now,end=now).isEnded -> true");
// this |--------|
// A |--------|
// B |--------|
// C |----|
// D |--------|
// E |--------|
// F |-------------|
// G |...
// H |...
// I |...
// this [--------)
// A [--------)
// B [--------)
// C [----|
// D [--------)
// E [--------)
// F [-------------)
// G [...
// H [...
// I [...
Daterange refClosed;
refClosed.start (Datetime (6, 1, 2016));
refClosed.end (Datetime (6, 30, 2016));
@ -83,16 +83,16 @@ int main (int, char**)
t.ok (refClosed.overlap (testH), "Daterange: refClosed.overlap(testH)");
t.notok (refClosed.overlap (testI), "Daterange: ! refClosed.overlap(testI)");
// this |...
// A |--------|
// B |--------|
// C |----|
// D |--------|
// E |--------|
// F |-------------|
// G |...
// H |...
// I |...
// this [...
// A [--------)
// B [--------)
// C [----)
// D [--------)
// E [--------)
// F [-------------)
// G [...
// H [...
// I [...
Daterange refOpen;
refOpen.start (Datetime (6, 1, 2016));
@ -106,16 +106,16 @@ int main (int, char**)
t.ok (refOpen.overlap (testH), "Daterange: refOpen.overlap(testH)");
t.ok (refOpen.overlap (testI), "Daterange: refOpen.overlap(testI)");
// this |--------|
// A |--------|
// B |--------|
// C |----|
// D |--------|
// E |--------|
// F |-------------|
// G |...
// H |...
// I |...
// this [--------)
// A [--------)
// B [--------)
// C [----)
// D [--------)
// E [--------)
// F [-------------)
// G [...
// H [...
// I [...
Daterange empty;
t.ok (refClosed.intersect (testA) == empty, "Daterange: refClosed.intersect(testA) == empty");
t.ok (refClosed.intersect (testB) == Daterange (refClosed.start (), testB.end ()), "Daterange: refClosed.intersect(testB) == Daterange(refClosed.start(), testB.end())");
@ -127,16 +127,16 @@ int main (int, char**)
t.ok (refClosed.intersect (testH) == Daterange (testH.start (), refClosed.end ()), "Daterange: refClosed.intersect(testH) == Daterange(testH.start(), refClosed.end())");
t.ok (refClosed.intersect (testI) == empty, "Daterange: refClosed.intersect(testI) == empty");
// this |...
// A |--------|
// B |--------|
// C |----|
// D |--------|
// E |--------|
// F |-------------|
// G |...
// H |...
// I |...
// this [...
// A [--------)
// B [--------)
// C [----)
// D [--------)
// E [--------)
// F [-------------)
// G [...
// H [...
// I [...
t.ok (refOpen.intersect (testA) == empty, "Daterange: refOpen.intersect(testA) == empty");
t.ok (refOpen.intersect (testB) == Daterange (refOpen.start (), testB.end ()), "Daterange: refOpen.intersect(testB) == Daterange(refOpen.start(), testB.end())");
t.ok (refOpen.intersect (testC) == testC, "Daterange: refOpen.intersect(testC) == testC");
@ -147,16 +147,16 @@ int main (int, char**)
t.ok (refOpen.intersect (testH) == testH, "Daterange: refOpen.intersect(testH) == testH");
t.ok (refOpen.intersect (testI) == testI, "Daterange: refOpen.intersect(testI) == testI");
// this |--------|
// A |--------|
// B |--------|
// C |----|
// D |--------|
// E |--------|
// F |-------------|
// G |...
// H |...
// I |...
// this [--------)
// A [--------)
// B [--------)
// C [----)
// D [--------)
// E [--------)
// F [-------------)
// G [...
// H [...
// I [...
std::vector <Daterange> closedSubtractA {refClosed};
std::vector <Daterange> closedSubtractB {Daterange (testB.end (), refClosed.end ())};
std::vector <Daterange> closedSubtractC {Daterange (refClosed.start (), testC.start ()), Daterange (testC.end (), refClosed.end ())};
@ -178,16 +178,16 @@ int main (int, char**)
t.ok (refClosed.subtract (testH) == closedSubtractH, "Daterange: refClosed.subtract(testH) == {refClosed.start(), testH.start()}");
t.ok (refClosed.subtract (testI) == closedSubtractI, "Daterange: refClosed.subtract(testI) == {refClosed}");
// this |...
// A |--------|
// B |--------|
// C |----|
// D |--------|
// E |--------|
// F |-------------|
// G |...
// H |...
// I |...
// this [...
// A [--------)
// B [--------)
// C [----)
// D [--------)
// E [--------)
// F [-------------)
// G [...
// H [...
// I [...
std::vector <Daterange> openSubtractA {refOpen};
std::vector <Daterange> openSubtractB {Daterange (testB.end (), refOpen.end ())};
std::vector <Daterange> openSubtractC {Daterange (refOpen.start (), testC.start ()), Daterange (testC.end (), refOpen.end ())};