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

Add method to trim trailing zeros from IntegerVector #34435

Closed
trevorkarn opened this issue Aug 25, 2022 · 17 comments
Closed

Add method to trim trailing zeros from IntegerVector #34435

trevorkarn opened this issue Aug 25, 2022 · 17 comments

Comments

@trevorkarn
Copy link
Contributor

Remove trailing zeroes from integer vectors using .trim

CC: @tscrim @trevorkarn @darijgr

Component: combinatorics

Keywords: gsoc2022 compositions integer-vector

Author: Trevor K. Karn

Branch/Commit: b537651

Reviewer: Travis Scrimshaw

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

@trevorkarn
Copy link
Contributor Author

Commit: 12f7909

@trevorkarn
Copy link
Contributor Author

Last 10 new commits:

e973f7dAssertion -> ValueError
a57b2d0Add tests and remove Stanley s.f.
28286daAdd methods to interact with polyominos/compositions
75ce24eChange to list
8c3cb4eAdd type-A algorithm
4a6b2f9Rewrite to pass to Permutations
9c2a107Initial commit of KeyPolynomial
5899abfFix divided difference
24098b5Fix expand
12f7909Add .trim method to compositions

@trevorkarn
Copy link
Contributor Author

Branch: u/tkarn/trim-34435

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 25, 2022

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

6c6300bAdd .trim method to compositions

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 25, 2022

Changed commit from 12f7909 to 6c6300b

@trevorkarn

This comment has been minimized.

@trevorkarn
Copy link
Contributor Author

Changed keywords from gsoc2022 compositions to gsoc2022 compositions integer-vector

@trevorkarn trevorkarn changed the title Add method to trim trailing zeros from Compositions Add method to trim trailing zeros from IntegerVector Aug 29, 2022
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 29, 2022

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

ab673bdAdd trim to integer vector

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 29, 2022

Changed commit from 6c6300b to ab673bd

@trevorkarn
Copy link
Contributor Author

comment:7

Moved from compositions to integer vectors because Sage Compositions should not have zero entries.

@tscrim
Copy link
Collaborator

tscrim commented Aug 30, 2022

comment:8

This will not quite work as the parent might require the integer vector to have a fixed length. You should simply return an element in all integer vectors. You can also more directly construct the elements by P.element_class(P, foo, check=False) (which will also make this faster) since you can assume you started with an integer vector.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 30, 2022

Changed commit from ab673bd to b537651

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 30, 2022

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

b537651Fix parent

@trevorkarn
Copy link
Contributor Author

comment:10

Replying to @tscrim:

This will not quite work as the parent might require the integer vector to have a fixed length. You should simply return an element in all integer vectors. You can also more directly construct the elements by P.element_class(P, foo, check=False) (which will also make this faster) since you can assume you started with an integer vector.

Makes senses, thanks!

@tscrim
Copy link
Collaborator

tscrim commented Aug 30, 2022

Reviewer: Travis Scrimshaw

@tscrim
Copy link
Collaborator

tscrim commented Aug 30, 2022

comment:11

Thanks. LGTM.

@vbraun
Copy link
Member

vbraun commented Sep 27, 2022

Changed branch from u/tkarn/trim-34435 to b537651

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