[system] / trunk / pg / lib / Value / Interval.pm Repository:
ViewVC logotype

Diff of /trunk/pg/lib/Value/Interval.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 5027 Revision 5042
154 154
155# 155#
156# Addition forms unions 156# Addition forms unions
157# 157#
158sub add { 158sub add {
159 my ($self,$l,$r) = Value::checkOpOrder(@_); 159 my ($self,$l,$r) = Value::checkOpOrderWithPromote(@_);
160 Value::Union::form($self->context,$l,$r); 160 Value::Union::form($self->context,$l,$r);
161} 161}
162sub dot {my $self = shift; $self->add(@_)} 162sub dot {my $self = shift; $self->add(@_)}
163 163
164# 164#
165# Subtraction can split into a union 165# Subtraction can split into a union
166# 166#
167sub sub { 167sub sub {
168 my ($self,$l,$r) = Value::checkOpOrder(@_); 168 my ($self,$l,$r) = Value::checkOpOrderWithPromote(@_);
169 Value::Union::form($self->context,subIntervalInterval($l,$r)); 169 Value::Union::form($self->context,subIntervalInterval($l,$r));
170} 170}
171 171
172# 172#
173# Subtract an interval from another 173# Subtract an interval from another
207# 207#
208# Lexicographic order, but with type of endpoint included 208# Lexicographic order, but with type of endpoint included
209# in the test. 209# in the test.
210# 210#
211sub compare { 211sub compare {
212 my ($self,$l,$r) = Value::checkOpOrder(@_); 212 my ($self,$l,$r) = Value::checkOpOrderWithPromote(@_);
213 my ($la,$lb) = $l->value; my ($ra,$rb) = $r->value; 213 my ($la,$lb) = $l->value; my ($ra,$rb) = $r->value;
214 my $cmp = $la <=> $ra; return $cmp if $cmp; 214 my $cmp = $la <=> $ra; return $cmp if $cmp;
215 my $ignoreEndpointTypes = $l->getFlag('ignoreEndpointTypes'); 215 my $ignoreEndpointTypes = $l->getFlag('ignoreEndpointTypes');
216 $cmp = $l->{open} cmp $r->{open}; return $cmp if $cmp && !$ignoreEndpointTypes; 216 $cmp = $l->{open} cmp $r->{open}; return $cmp if $cmp && !$ignoreEndpointTypes;
217 $cmp = $lb <=> $rb; return $cmp if $cmp || $ignoreEndpointTypes; 217 $cmp = $lb <=> $rb; return $cmp if $cmp || $ignoreEndpointTypes;

Legend:
Removed from v.5027  
changed lines
  Added in v.5042

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9