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

is_exact for asymptotic ring #19981

Closed
behackl opened this issue Jan 28, 2016 · 25 comments
Closed

is_exact for asymptotic ring #19981

behackl opened this issue Jan 28, 2016 · 25 comments

Comments

@behackl
Copy link
Member

behackl commented Jan 28, 2016

This ticket shall implement a method that returns wheter all terms of some asymptotic expansion are exact terms.

CC: @cheuberg @dkrenn

Component: asymptotic expansions

Author: Benjamin Hackl

Branch/Commit: da853f8

Reviewer: Daniel Krenn, Clemens Heuberger

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

@behackl
Copy link
Member Author

behackl commented Jan 29, 2016

Commit: 550e717

@behackl
Copy link
Member Author

behackl commented Jan 29, 2016

Branch: u/behackl/asy/misc-improvements

@behackl
Copy link
Member Author

behackl commented Jan 29, 2016

New commits:

cc0137dimplement is_exact
550e717implement _latex_

@behackl
Copy link
Member Author

behackl commented Jan 29, 2016

comment:2

Note: this is on top of 7.1.beta1.

Any more suggestions for practical improvements?

@cheuberg
Copy link
Contributor

comment:3

Replying to @behackl:

Note: this is on top of 7.1.beta1.

Any more suggestions for practical improvements?

no; they could go into a separate ticket anyway.

@dkrenn
Copy link
Contributor

dkrenn commented Jan 29, 2016

comment:4

Replying to @cheuberg:

they could go into a separate ticket anyway.

+1 for separate tickets.

@dkrenn
Copy link
Contributor

dkrenn commented Jan 29, 2016

comment:5

I had a quick look at the code:

cc0137d implement is_exact

IMHO inefficient; has_same_summands should do better, since no new mutable posets have to be created.

550e717 implement _latex_

SR uses the commutativity of the multiplication sometimes, so LaTeX-output might differ from repr-output. I suggest to implement _latex_ for terms and growth groups as they know what to do.

@behackl
Copy link
Member Author

behackl commented Jan 29, 2016

comment:6

Replying to @dkrenn:

I had a quick look at the code:

cc0137d implement is_exact

IMHO inefficient; has_same_summands should do better, since no new mutable posets have to be created.

I'd even use _has_same_summands_, the parent is certainly the same so this is even more efficient. Will change later.

550e717 implement _latex_

SR uses the commutativity of the multiplication sometimes, so LaTeX-output might differ from repr-output. I suggest to implement _latex_ for terms and growth groups as they know what to do.

That was/is my original plan, and this is also the reason why I didn't set this to needs_review. ;-) However, I wanted to have nice (growth-ordered) latex-output quickly in order to check the output of the singularity analysis generator; and this was the simplest implementation I could think of. The code is just dumped here.

I'll also split this ticket into two.

@behackl

This comment has been minimized.

@behackl
Copy link
Member Author

behackl commented Jan 30, 2016

Changed branch from u/behackl/asy/misc-improvements to u/behackl/asy/is_exact

@behackl
Copy link
Member Author

behackl commented Jan 30, 2016

New commits:

09a3db2implement is_exact
26639e2improve performance of is_exact

@behackl
Copy link
Member Author

behackl commented Jan 30, 2016

Changed commit from 550e717 to 26639e2

@behackl behackl changed the title asymptotic expansions: minor improvements is_exact for asymptotic ring Jan 30, 2016
@dkrenn
Copy link
Contributor

dkrenn commented Jan 30, 2016

comment:8

Typo: "Nothin.", but you could remove the INPUT-block completely. Otherwise looks good. Still have to wait until I have a working 7.1.beta1.

PS: Author missing

@dkrenn
Copy link
Contributor

dkrenn commented Jan 30, 2016

Reviewer: Daniel Krenn

@cheuberg
Copy link
Contributor

Changed reviewer from Daniel Krenn to Daniel Krenn, Clemens Heuberger

@cheuberg
Copy link
Contributor

comment:9

Apart from that: while the routine is hardly efficiency critical, it is somewhat inefficient to construct exact_part and then comparing with the original just to check whether all summands are ExactTerms. If this is to ensure that future extensions of the term monoids won't introduce inconsistencies, then there could be a helper method is_exact.

@dkrenn
Copy link
Contributor

dkrenn commented Jan 30, 2016

comment:10

Replying to @cheuberg:

Apart from that: while the routine is hardly efficiency critical, it is somewhat inefficient to construct exact_part and then comparing with the original just to check whether all summands are ExactTerms. If this is to ensure that future extensions of the term monoids won't introduce inconsistencies, then there could be a helper method is_exact.

True. Maybe something like all(T.is_exact() for T in self.summands)...

@cheuberg
Copy link
Contributor

comment:12

Replying to @dkrenn:

True. Maybe something like all(T.is_exact() for T in self.summands)...

That's what I meant.

@behackl
Copy link
Member Author

behackl commented Jan 31, 2016

comment:13

I'm not a very big fan of having a method is_exact for terms, where this would just return isinstance(self, ExactTerm). I think that this would just add an unneccessary layer of function calls.

Are you against something like all(isinstance(T, ExactTerm) for T in self.summands)?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 2, 2016

Changed commit from 26639e2 to da853f8

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 2, 2016

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

9042dabimplement is_exact for terms
f5bdb8freplace isinstance(..., ExactTerm) with is_exact
f65bc42remove INPUT in docstring
da853f8implement expansion.is_exact() by using term.is_exact()

@behackl
Copy link
Member Author

behackl commented Feb 2, 2016

Author: Benjamin Hackl

@behackl
Copy link
Member Author

behackl commented Feb 2, 2016

comment:15

I've changed my mind: to keep our style of programming consistent, I have implemented an is_exact-method for terms and replaced all isinstance(term, ExactTerm)-statements by term.is_exact().

Back to needs_review.

@dkrenn
Copy link
Contributor

dkrenn commented Feb 2, 2016

comment:16

Seems to be fine now.

@vbraun
Copy link
Member

vbraun commented Feb 2, 2016

Changed branch from u/behackl/asy/is_exact to da853f8

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