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

piecewise polynomial in one dimension #34456

Open
NicoleYueqiLi mannequin opened this issue Aug 30, 2022 · 12 comments
Open

piecewise polynomial in one dimension #34456

NicoleYueqiLi mannequin opened this issue Aug 30, 2022 · 12 comments

Comments

@NicoleYueqiLi
Copy link
Mannequin

NicoleYueqiLi mannequin commented Aug 30, 2022

Implement real value piecewise polynomial function over the real set. For the polynomial function, we adopted code from the polynomial ring of SageMath. For piecewise function, we adopted code by Matthias Köppe et al., at https://github.com/mkoeppe/cutgeneratingfunctionology/blob/master/cutgeneratingfunctionology/igp/fast_piecewise.py and code by David Joyner et al. at SageMath piecewise function.

This code can do general piecewise add, subtraction, multiplication, divide the real number, equal, detect pieces with discontinuity, and compute limits at certain points. we are currently working on plotting piecewise functions.

Depends on #11225

CC: @yuan-zhou

Component: geometry

Keywords: piecewise

Author: Yueqi Li

Branch/Commit: u/gh-NicoleYueqiLi/piecewise_polynomial_in_one_dimension @ e185e1d

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

@NicoleYueqiLi NicoleYueqiLi mannequin added this to the sage-9.7 milestone Aug 30, 2022
@yuan-zhou
Copy link

@yuan-zhou
Copy link

New commits:

d26bb5dImplement piecewise polynomial
cca011arecommit
604de7drewrite
4d9ab5eimplement piecewise_polynomial
e185e1dimplement piecewise_polynomial

@yuan-zhou
Copy link

Commit: e185e1d

@yuan-zhou
Copy link

Changed author from Yueqi Li, Yuan Zhou to Yueqi Li

@mkoeppe
Copy link
Member

mkoeppe commented Aug 30, 2022

comment:3
+class Piecewise_Polynomial(ModuleElement):

This naming scheme does not follow our common usage.

It should be changed to one of these:

  • PiecewisePolynomial -- following the general Python convention for naming of classes
  • PiecewiseFunction_polynomial -- when the intention is that there is a public constructor PiecewiseFunction with several private implementation classes such as PiecewiseFunction_multi_polynomial, PiecewiseFunction_neural_network, ...

@mkoeppe
Copy link
Member

mkoeppe commented Aug 30, 2022

comment:4

Yes, I agree that this should be a ModuleElement.
Now to which module (vector space) should it belong?

@NicoleYueqiLi

This comment has been minimized.

@NicoleYueqiLi
Copy link
Mannequin Author

NicoleYueqiLi mannequin commented Aug 30, 2022

comment:6

Replying to @mkoeppe:

Yes, I agree that this should be a ModuleElement.
Now to which module (vector space) should it belong?

This code didn't use any properties from ModuleElement. I'm wondering if you know any sample codes or if there is any way would be helpful for me to learn how to adapt the ModuleElement into the current code. Thank you so much for any suggestions!

@mkoeppe
Copy link
Member

mkoeppe commented Aug 30, 2022

comment:7

Take a look at CombinatorialFreeModule (defined in sage.combinat.free_module) and the element class IndexedFreeModuleElement (defined in sage.modules.with_basis.indexed_element)

@NicoleYueqiLi
Copy link
Mannequin Author

NicoleYueqiLi mannequin commented Aug 31, 2022

comment:8

Replying to @mkoeppe:

Take a look at CombinatorialFreeModule (defined in sage.combinat.free_module) and the element class IndexedFreeModuleElement (defined in sage.modules.with_basis.indexed_element)

Thank you so much!

@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Aug 31, 2022
@NicoleYueqiLi
Copy link
Mannequin Author

NicoleYueqiLi mannequin commented Sep 6, 2022

Dependencies: #11225

@kcrisman
Copy link
Member

It's not clear in what sense this ticket depends on #11225 so I recommend removing that.

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

3 participants