Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-19 Thread Jeff Garland
On Mon, 18 Aug 2003 16:28:22 -0400, Beman Dawes wrote

> FWIW, I'm both a native-speaker and familiar with convex hulls. 
> Regardless, "span" sounds better to me for use in the context of a 
> Date-Time library.

Ok, span it is.  Updates checked into CVS

Jeff
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


RE: [boost] Re: Date iterators in Boost Date-Time

2003-08-18 Thread Paul A. Bristow
Thanks - it does now make sense, but since (mercifully!) time is only
1-dimensional, I find the span suggestion more intuitive.

Paul

PS This explanation could usefully be added to the interval library
documentation. I was puzzled why the word 'hull' was used.

| -Original Message-
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED] Behalf Of Guillaume Melquiond
| Sent: Monday, August 18, 2003 8:36 AM
| To: Boost mailing list
| Subject: RE: [boost] Re: Date iterators in Boost Date-Time
|
|
| En réponse à "Paul A. Bristow" <[EMAIL PROTECTED]>:
|
| > But as Michael Caine said "Not a lot of people know that" - so I trust
| > you will explain what it does too for the benefit of us mere
| non-mathematical
| > mortals!
| >
| > Paul
|
| I'm not sure to understand. Do you want me to explain what a convex hull is or
| to explain what the function of the date-time library is supposed to do? I
| suppose it's the first, since the second is what started this subthread.
|
| A connected set is a set for which each couple of points are
| connected by a path
| itself included in the set (all the points are reachable from all the
| points). A
| convex set is a connected set with linear paths (all the points can be reached
| from all the other points by following a segment). The convex hull of a set is
| the smallest convex superset of it. For example, given three points in the
| plane, the convex hull is the filled triangle defined by these points.
|
| In the case of a 1-dimension space, connected and convex set are equals: they
| are segments (or half-line or line or empty). Date manipulated by the
| date-time
| library are in a 1-dimension space (the real line) and periods are segments
| (non-empty bounded convex sets). So when you have two periods, the smallest
| period enclosing these two is also the convex hull of them. Hence the name I
| suggested.
|
| I hope it makes sense.
|
| Regards,
|
| Guillaume

|

___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-18 Thread Gabriel Dos Reis
Beman Dawes <[EMAIL PROTECTED]> writes:

| At 03:18 PM 8/18/2003, Victor A. Wagner, Jr. wrote:
| 
|  >At Monday 2003-08-18 11:39, you wrote:
|  >>"Victor A. Wagner, Jr." <[EMAIL PROTECTED]> writes:
|  >>
|  >>| how about  "span" ?
|  >>
|  >>when read as "the period of time spanned by these two", I can make
|  >>sense of it, even not as a mathematician :-)
|  >>
|  >>Well, I don't know how it sounds to native speakers.
| 
| FWIW, I'm both a native-speaker and familiar with convex
| hulls. Regardless, "span" sounds better to me for use in the context
| of a Date-Time library.

Great! We're in violent agreement.

-- Gaby
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-18 Thread Beman Dawes
At 03:18 PM 8/18/2003, Victor A. Wagner, Jr. wrote:

>At Monday 2003-08-18 11:39, you wrote:
>>"Victor A. Wagner, Jr." <[EMAIL PROTECTED]> writes:
>>
>>| how about  "span" ?
>>
>>when read as "the period of time spanned by these two", I can make
>>sense of it, even not as a mathematician :-)
>>
>>Well, I don't know how it sounds to native speakers.
FWIW, I'm both a native-speaker and familiar with convex hulls. Regardless, 
"span" sounds better to me for use in the context of a Date-Time library.

--Beman

___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-18 Thread John Fuller
On the other hand, "hull" encompasses the idea of
a "periodic hull" that can be used for periodic intervals of time...
On Monday, August 18, 2003, at 02:39 PM, John Fuller wrote:

It also has the advantage of being similar to the use of "makespan" as 
the time from
the start time of the first job to the completion time of the last job 
in job scheduling
problems.

On Monday, August 18, 2003, at 02:18 PM, Victor A. Wagner, Jr. wrote:

I suggested it because we write software for people who run multiple 
experiments with "rest periods" between the data collection sessions. 
 They seem to use the word span to specify the approximate duration 
of the series of tests.  "These experiments were conducted over a 
span of 3 weeks."  Then again, Americans are notorious for abuse of 
the language, but around University of Arizona's Neural Systems, 
Memory & Aging Lab it would certainly be understood.

At Monday 2003-08-18 11:39, you wrote:
"Victor A. Wagner, Jr." <[EMAIL PROTECTED]> writes:

| how about  "span" ?

when read as "the period of time spanned by these two", I can make
sense of it, even not as a mathematician :-)
Well, I don't know how it sounds to native speakers.

-- Gaby
___
Unsubscribe & other changes: 
http://lists.boost.org/mailman/listinfo.cgi/boost
Victor A. Wagner Jr.  http://rudbek.com
The five most dangerous words in the English language:
  "There oughta be a law"
___
Unsubscribe & other changes: 
http://lists.boost.org/mailman/listinfo.cgi/boost


___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-18 Thread John Fuller
It also has the advantage of being similar to the use of "makespan" as 
the time from
the start time of the first job to the completion time of the last job 
in job scheduling
problems.

On Monday, August 18, 2003, at 02:18 PM, Victor A. Wagner, Jr. wrote:

I suggested it because we write software for people who run multiple 
experiments with "rest periods" between the data collection sessions.  
They seem to use the word span to specify the approximate duration of 
the series of tests.  "These experiments were conducted over a span of 
3 weeks."  Then again, Americans are notorious for abuse of the 
language, but around University of Arizona's Neural Systems, Memory & 
Aging Lab it would certainly be understood.

At Monday 2003-08-18 11:39, you wrote:
"Victor A. Wagner, Jr." <[EMAIL PROTECTED]> writes:

| how about  "span" ?

when read as "the period of time spanned by these two", I can make
sense of it, even not as a mathematician :-)
Well, I don't know how it sounds to native speakers.

-- Gaby
___
Unsubscribe & other changes: 
http://lists.boost.org/mailman/listinfo.cgi/boost
Victor A. Wagner Jr.  http://rudbek.com
The five most dangerous words in the English language:
  "There oughta be a law"
___
Unsubscribe & other changes: 
http://lists.boost.org/mailman/listinfo.cgi/boost

___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-18 Thread Victor A. Wagner, Jr.
I suggested it because we write software for people who run multiple 
experiments with "rest periods" between the data collection sessions.  They 
seem to use the word span to specify the approximate duration of the series 
of tests.  "These experiments were conducted over a span of 3 weeks."  Then 
again, Americans are notorious for abuse of the language, but around 
University of Arizona's Neural Systems, Memory & Aging Lab it would 
certainly be understood.

At Monday 2003-08-18 11:39, you wrote:
"Victor A. Wagner, Jr." <[EMAIL PROTECTED]> writes:

| how about  "span" ?

when read as "the period of time spanned by these two", I can make
sense of it, even not as a mathematician :-)
Well, I don't know how it sounds to native speakers.

-- Gaby
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Victor A. Wagner Jr.  http://rudbek.com
The five most dangerous words in the English language:
  "There oughta be a law"
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-18 Thread Gabriel Dos Reis
"Victor A. Wagner, Jr." <[EMAIL PROTECTED]> writes:

| how about  "span" ?

when read as "the period of time spanned by these two", I can make
sense of it, even not as a mathematician :-)  

Well, I don't know how it sounds to native speakers.

-- Gaby
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-18 Thread Victor A. Wagner, Jr.
how about  "span" ?

At Monday 2003-08-18 02:43, you wrote:
Guillaume Melquiond <[EMAIL PROTECTED]> writes:

| In the case of a 1-dimension space, connected and convex set are
| equals: they are segments (or half-line or line or empty). Date
| manipulated by the date-time library are in a 1-dimension space (the
| real line) and periods are segments (non-empty bounded convex
| sets). So when you have two periods, the smallest period enclosing
| these two is also the convex hull of them. Hence the name I  suggested.
that is fine for some mathematically oriented mind.  However, it is a
terrible name.
-- Gaby
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Victor A. Wagner Jr.  http://rudbek.com
The five most dangerous words in the English language:
  "There oughta be a law"
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-18 Thread Gabriel Dos Reis
"Jeff Garland" <[EMAIL PROTECTED]> writes:

| On 18 Aug 2003 11:43:26 +0200, Gabriel Dos Reis wrote
| > Guillaume Melquiond <[EMAIL PROTECTED]> writes:
| > 
| > | In the case of a 1-dimension space, connected and convex set are
| > | equals: they are segments (or half-line or line or empty). Date
| > | manipulated by the date-time library are in a 1-dimension space 
| > (the | real line) and periods are segments (non-empty bounded convex 
| > | sets). So when you have two periods, the smallest period enclosing 
| > | these two is also the convex hull of them. Hence the name I  suggested.
| > 
| > that is fine for some mathematically oriented mind.  However, it is a
| > terrible name.
| 
| 
| Here is how I explain it:

Oh, I'm myself a Geometer and I understand the terminology and have a
good mental picture of it.  But if we were after accurate, descriptive
and mathematically oriented terminology, I can throw "geodesic arc"
for this particular case (and I may even attempt to justify it from
General Relativity point of view :-).

The point of my previous remark is that it is one thing to justify a
a name from a mathematically oriented point of view, it is another to
name a software entity designed for brother audience; and even for a
mathematical audiance I doubt it would be a good name in the case
under consideration.

-- Gaby
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-18 Thread Jeff Garland
On 18 Aug 2003 11:43:26 +0200, Gabriel Dos Reis wrote
> Guillaume Melquiond <[EMAIL PROTECTED]> writes:
> 
> | In the case of a 1-dimension space, connected and convex set are
> | equals: they are segments (or half-line or line or empty). Date
> | manipulated by the date-time library are in a 1-dimension space 
> (the | real line) and periods are segments (non-empty bounded convex 
> | sets). So when you have two periods, the smallest period enclosing 
> | these two is also the convex hull of them. Hence the name I  suggested.
> 
> that is fine for some mathematically oriented mind.  However, it is a
> terrible name.


Here is how I explain it:

   Combines two periods and any gap between them such that 
 start = min(p1.start, p2.start)
 end   = max(p1.end  , p2.end)

   Or graphically: 

   [---p1---)
  [---p2---)
result:
   [---p3--) 

Jeff

___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-18 Thread Jeff Garland
On Mon, 18 Aug 2003 06:34:35 -0500, John Fuller wrote
> HL7 v3, a health care application layer specification, uses the term 
> with time intervals as
> an operation on a totally ordered set that produces the smallest 
> interval that is a superset.
> For example, hull({[1,5], [7,10]}) == [1,10]
> The unabridged specification part II available on Dr. Schadow's page 
> http://aurora.regenstrief.org/v3dt/
> gives nice examples.

John -

Thanks for this pointer.  I've changed the name to hull in CVS so it will be
nice to have some examples.  This is one of the more interesting public
specifications of time related concepts I've seen -- matches up quite well
with many of the concepts in the library :-)

Jeff





___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-18 Thread John Fuller
HL7 v3, a health care application layer specification, uses the term with time intervals as
an operation on a totally ordered set that produces the smallest interval that is a superset.
For example, hull({[1,5], [7,10]}) == [1,10]
The unabridged specification part II available on Dr. Schadow's page http://aurora.regenstrief.org/v3dt/
gives nice examples.





On Sunday, August 17, 2003, at 05:13 PM, Paul A. Bristow wrote:

But as Michael Caine said "Not a lot of people know that" - so I trust you will
explain what it does too for the benefit of us mere non-mathematical mortals!

Paul



| -Original Message-
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED]
| Sent: Sunday, August 17, 2003 7:11 AM
| To: Boost mailing list
| Subject: Re: [boost] Re: Date iterators in Boost Date-Time
|
|
| En réponse à Jeff Garland <[EMAIL PROTECTED]>:
|

| I just wanted to mention that the interval library names this
| operation "hull".
| It is a mathematically defined term since the operation is indeed a
| convex hull.
|
| Just my two eurocents,
|
| Guillaume
|

___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost



Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-18 Thread Gabriel Dos Reis
Guillaume Melquiond <[EMAIL PROTECTED]> writes:

| In the case of a 1-dimension space, connected and convex set are
| equals: they are segments (or half-line or line or empty). Date
| manipulated by the date-time library are in a 1-dimension space (the
| real line) and periods are segments (non-empty bounded convex
| sets). So when you have two periods, the smallest period enclosing
| these two is also the convex hull of them. Hence the name I  suggested.

that is fine for some mathematically oriented mind.  However, it is a
terrible name.

-- Gaby
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


RE: [boost] Re: Date iterators in Boost Date-Time

2003-08-18 Thread Guillaume Melquiond
En réponse à "Paul A. Bristow" <[EMAIL PROTECTED]>:

> But as Michael Caine said "Not a lot of people know that" - so I trust
> you will explain what it does too for the benefit of us mere non-mathematical
> mortals!
> 
> Paul

I'm not sure to understand. Do you want me to explain what a convex hull is or
to explain what the function of the date-time library is supposed to do? I
suppose it's the first, since the second is what started this subthread.

A connected set is a set for which each couple of points are connected by a path
itself included in the set (all the points are reachable from all the points). A
convex set is a connected set with linear paths (all the points can be reached
from all the other points by following a segment). The convex hull of a set is
the smallest convex superset of it. For example, given three points in the
plane, the convex hull is the filled triangle defined by these points.

In the case of a 1-dimension space, connected and convex set are equals: they
are segments (or half-line or line or empty). Date manipulated by the date-time
library are in a 1-dimension space (the real line) and periods are segments
(non-empty bounded convex sets). So when you have two periods, the smallest
period enclosing these two is also the convex hull of them. Hence the name I
suggested.

I hope it makes sense.

Regards,

Guillaume
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


RE: [boost] Re: Date iterators in Boost Date-Time

2003-08-17 Thread Paul A. Bristow
But as Michael Caine said "Not a lot of people know that" - so I trust you will
explain what it does too for the benefit of us mere non-mathematical mortals!

Paul



| -Original Message-
| From: [EMAIL PROTECTED]
| [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED]
| Sent: Sunday, August 17, 2003 7:11 AM
| To: Boost mailing list
| Subject: Re: [boost] Re: Date iterators in Boost Date-Time
|
|
| En réponse à Jeff Garland <[EMAIL PROTECTED]>:
|

| I just wanted to mention that the interval library names this
| operation "hull".
| It is a mathematically defined term since the operation is indeed a
| convex hull.
|
| Just my two eurocents,
|
| Guillaume
|

___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-17 Thread Jeff Garland
On Sun, 17 Aug 2003 08:11:14 +0200 (CEST), gmelquio wrote
> I just wanted to mention that the interval library names this 
> operation "hull". It is a mathematically defined term since the 
> operation is indeed a convex hull.
> 
> Just my two eurocents,
> 
> Guillaume

Thanks, I like it.  Precise and short.  Hate to admit I didn't know that, but
whatever, my editor is firing up now :-)

Jeff



___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-16 Thread gmelquio
En réponse à Jeff Garland <[EMAIL PROTECTED]>:

> On Sat, 16 Aug 2003 23:31:05 -0400, Jeremy B. Maitin-Shepard wrote
> 
> > > Yes, of course, it is not really a union either. I think
> > > merge_inclusive is fine.
> > 
> > How about "maximize" or "maximize_duration" or just "max" or
> > "max_duration"?
> 
> Thx for the ideas, but...
> 
> I'm leary of these b/c this is an operation on a period not a duration.
> max is way too overloaded; and still not sure it explains the operation. I
> still haven't heard a name that really strikes me as really good.
> 
> Jeff

I just wanted to mention that the interval library names this operation "hull".
It is a mathematically defined term since the operation is indeed a convex hull.

Just my two eurocents,

Guillaume
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-16 Thread Jeff Garland
On Sat, 16 Aug 2003 23:31:05 -0400, Jeremy B. Maitin-Shepard wrote

> > Yes, of course, it is not really a union either. I think
> > merge_inclusive is fine.
> 
> How about "maximize" or "maximize_duration" or just "max" or
> "max_duration"?

Thx for the ideas, but...

I'm leary of these b/c this is an operation on a period not a duration. max is
way too overloaded; and still not sure it explains the operation. I still
haven't heard a name that really strikes me as really good.

Jeff


___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


[boost] Re: Date iterators in Boost Date-Time

2003-08-16 Thread Jeremy B. Maitin-Shepard
On Sat, 16 Aug 2003 12:28:57 +1000 "Chris Trengove"
<[EMAIL PROTECTED]> wrote:

> "Jeff Garland" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I don't think the it is technically a union because the result draws
> > in points in the time period that aren't part of either of the
> > initial
> periods.
> > Anyway I wrote the code as merge_inclusive so unless you have a
> > major objection I'll leave it that way pending a better idea...
> 
> Yes, of course, it is not really a union either. I think
> merge_inclusive is fine.

How about "maximize" or "maximize_duration" or just "max" or
"max_duration"?

-- 
Jeremy B. Maitin-Shepard
[EMAIL PROTECTED]
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Re: [boost] Re: Date iterators in Boost Date-Time

2003-08-14 Thread Jeff Garland
On Fri, 15 Aug 2003 12:36:52 +1000, Chris Trengove wrote

> I think the big issue in using random access iterators is whether 
> you want to support the difference concept. It is relatively 
> straightforward to implement, say
> 
> year_iterator i(date(2003,1,1));
> year_iterator j(date(2005,1,1));
> cout << j - i;// prints "2"

Right. 
 
> but how do you handle the case when the dates are not neatly aligned 
> on the places where the iterator would normally put them?

Ok.  But I suspect day_iterators and time_iterators would probably be ok.
month_iterators would be a problem...

 
> Your period concept supports the merge (ie. union) function, which returns
> an empty period if there is no intersection. I also have a need for a
> function returning the actual [earliest,latest) of the two periods,
> regardless of whether they intersect. Obviously, this is trival to 
> write, but it would be nice if the concept was included in the library.

Sure, can do. What would you call it: merge_inclusive, earliest_latest, rename
merge to union and call it merge, something else?

Jeff
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


[boost] Re: Date iterators in Boost Date-Time

2003-08-14 Thread Chris Trengove
"Jeff Garland" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Another user has submitted a change to me, that hasn't made it into
> the library, that performs the equivalent by modifying
adjust_functors.hpp.
> Looking back on the history of the number of requests on this it looks
like
> it should be a priority to officially support this option.  Or perhaps,
even
> better, to step up and support bi-directional or random access iterators.

I think the big issue in using random access iterators is whether you want
to support the difference concept. It is relatively straightforward to
implement, say

year_iterator i(date(2003,1,1));
year_iterator j(date(2005,1,1));
cout << j - i;// prints "2"

but how do you handle the case when the dates are not neatly aligned on the
places where the iterator would normally put them?

I have one more question/suggestion.

Your period concept supports the merge (ie. union) function, which returns
an empty period if there is no intersection. I also have a need for a
function returning the actual [earliest,latest) of the two periods,
regardless of whether they intersect. Obviously, this is trival to write,
but it would be nice if the concept was included in the library.

Chris



___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost