Opened 8 years ago
Closed 8 years ago
#17198 closed enhancement (fixed)
Accept several arguments in RealIntervalFieldElement.min and RealIntervalFieldElement.max
Reported by:  Clemens Heuberger  Owned by:  

Priority:  major  Milestone:  sage6.4 
Component:  numerical  Keywords:  RIF 
Cc:  Sara Kropf  Merged in:  
Authors:  Clemens Heuberger  Reviewers:  Daniel Krenn 
Report Upstream:  N/A  Work issues:  
Branch:  27080b5 (Commits, GitHub, GitLab)  Commit:  27080b5dc54b5b4183f4ebe947b21efd45416ebf 
Dependencies:  Stopgaps: 
Description (last modified by )
Python's min
and max
are not suitable for RealIntervalFieldElement
, as those are not linearly ordered; the existing methods RealIntervalFieldElement.min
and RealIntervalFieldElement.max
only compute the minimum or maximum of self
and other
.
This ticket rewrites the methods RealIntervalFieldElement.min
and RealIntervalFieldElement.max
to accept an arbitrary number of arguments.
Change History (9)
comment:1 Changed 8 years ago by
Branch:  → u/cheuberg/rings/RIFminmax 

comment:2 Changed 8 years ago by
Commit:  → c8f852352d100f04f6c1a489d8fc7ec185ca4dee 

Status:  new → needs_review 
comment:3 followup: 6 Changed 8 years ago by
I think it would be more useful to have these as methods on RIF
elements.
comment:4 Changed 8 years ago by
My reasoning for having it as a function as opposed to methods on RIF elements where:
 There are methods
.min
and.max
performing the operation for the minimum and maximum of two elements  I think that the functions as proposed here are easier to use, e.g., the infinity norm of a vector of real intervals could simply be written as
max_RIF(abs(r) for r in v)
.
Therefore, I felt that having those as functions in the module real_mpfi
(and not importing those in the global name space) is appropriate.
comment:5 Changed 8 years ago by
Commit:  c8f852352d100f04f6c1a489d8fc7ec185ca4dee → 27080b5dc54b5b4183f4ebe947b21efd45416ebf 

Branch pushed to git repo; I updated commit sha1. New commits:
27080b5  Trac #17198: Rewrote methods .min and .max to handle more than two elements

comment:6 Changed 8 years ago by
Description:  modified (diff) 

Summary:  New functions max_RIF and min_RIF → Accept several arguments in RealIntervalFieldElement.min and RealIntervalFieldElement.max 
Replying to jdemeyer:
I think it would be more useful to have these as methods on
RIF
elements.
I now rewrote the original methods of RealIntervalField
to achieve what I intended with the functions.
comment:7 Changed 8 years ago by
Reviewers:  → Daniel Krenn 

Looks good. Merges cleanly on 6.5.rc0. I'm still waiting for "make ptestlong" to finish...
comment:8 Changed 8 years ago by
Status:  needs_review → positive_review 

comment:9 Changed 8 years ago by
Branch:  u/cheuberg/rings/RIFminmax → 27080b5dc54b5b4183f4ebe947b21efd45416ebf 

Resolution:  → fixed 
Status:  positive_review → closed 
New commits:
Trac #17198: New functions max_RIF and min_RIF