Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept several arguments in RealIntervalFieldElement.min and RealIntervalFieldElement.max #17198

Closed
cheuberg opened this issue Oct 22, 2014 · 12 comments

Comments

@cheuberg
Copy link
Contributor

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.

CC: @sagetrac-skropf

Component: numerical

Keywords: RIF

Author: Clemens Heuberger

Branch/Commit: 27080b5

Reviewer: Daniel Krenn

Issue created by migration from https://trac.sagemath.org/ticket/17198

@cheuberg cheuberg added this to the sage-6.4 milestone Oct 22, 2014
@cheuberg
Copy link
Contributor Author

Branch: u/cheuberg/rings/RIF-min-max

@cheuberg
Copy link
Contributor Author

New commits:

c8f8523Trac #17198: New functions max_RIF and min_RIF

@cheuberg
Copy link
Contributor Author

Commit: c8f8523

@jdemeyer
Copy link

comment:3

I think it would be more useful to have these as methods on RIF elements.

@cheuberg
Copy link
Contributor Author

comment:4

My reasoning for having it as a function as opposed to methods on RIF elements where:

  1. There are methods .min and .max performing the operation for the minimum and maximum of two elements
  2. 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.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 21, 2014

Changed commit from c8f8523 to 27080b5

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 21, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

27080b5Trac #17198: Rewrote methods .min and .max to handle more than two elements

@cheuberg
Copy link
Contributor Author

comment:6

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.

@cheuberg

This comment has been minimized.

@cheuberg cheuberg changed the title New functions max_RIF and min_RIF Accept several arguments in RealIntervalFieldElement.min and RealIntervalFieldElement.max Nov 21, 2014
@dkrenn
Copy link
Contributor

dkrenn commented Feb 5, 2015

Reviewer: Daniel Krenn

@dkrenn
Copy link
Contributor

dkrenn commented Feb 5, 2015

comment:7

Looks good. Merges cleanly on 6.5.rc0. I'm still waiting for "make ptestlong" to finish...

@vbraun
Copy link
Member

vbraun commented Feb 17, 2015

Changed branch from u/cheuberg/rings/RIF-min-max to 27080b5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants