sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.44k stars 481 forks source link

Meta-ticket: Piecewise functions, polyhedral complexes, piecewise functions of several variables, periodic piecewise functions #20877

Open mkoeppe opened 8 years ago

mkoeppe commented 8 years ago

This is a meta-ticket about piecewise functions.

Fractional part, modulo, ...:

Piecewise functions of 1 variable:

RealSets, underlying the current implementation of piecewise:

As a generalization, this meta-ticket will implement piecewise functions of several real variables. The pieces are polyhedral complexes (not necessarily triangulations) or more generally polyhedral dissections (i.e., not necessarily face-to-face). In my application, the functions will be piecewise linear, possibly discontinuous; but the implementation should be general enough for splines.

Discussion welcome, in particular in regard to how this code should interact with the existing classes for abstract complexes (CW complexes) and PointConfiguration.

General piecewise functions:

CC: @tscrim @rwst @vbraun @videlec @jhpalmieri @kcrisman @paulmasson @sagetrac-tmonteil @mo271 @jplab @yuan-zhou

Component: geometry

Keywords: piecewise

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

mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -1,6 +1,9 @@
 This meta-ticket will implement piecewise functions of several real variables. 
-The pieces are polyhedral complexes (not necessarily triangulations).
+The pieces are polyhedral complexes (not necessarily triangulations) or more generally polyhedral dissections (i.e., not necessarily face-to-face).
 In my application, the functions will be piecewise linear, possibly discontinuous; but the implementation should be general enough for splines.

 Discussion welcome, in particular in regard to how this code should interact with the existing classes for abstract complexes (CW complexes) and `PointConfiguration`.

+- #20878: PointConfiguration: Add plot method
+- #20879: Expose PPL's Not-Necessarily-Closed Polyhedra using Sage Polyhedra
+
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -4,6 +4,6 @@

 Discussion welcome, in particular in regard to how this code should interact with the existing classes for abstract complexes (CW complexes) and `PointConfiguration`.

-- #20878: PointConfiguration: Add plot method
-- #20879: Expose PPL's Not-Necessarily-Closed Polyhedra using Sage Polyhedra
+- #20878: `PointConfiguration`: Add `plot` method
+- #20879: Expose PPL's Not-Necessarily-Closed Polyhedra using Sage Polyhedra -- could play the same role as half-open intervals do in the context of the new piecewise functions.
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -7,3 +7,8 @@
 - #20878: `PointConfiguration`: Add `plot` method
 - #20879: Expose PPL's Not-Necessarily-Closed Polyhedra using Sage Polyhedra -- could play the same role as half-open intervals do in the context of the new piecewise functions.

+Piecewise functions of 1 variable and `RealSet`s:
+- #1773: piecewise functions and integration / arithmetic do not play well together
+- #8603: Partial sums are off for Fourier series of piecewise functions
+- #11225: improve piecewise plotting
+ 
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -11,4 +11,4 @@
 - #1773: piecewise functions and integration / arithmetic do not play well together
 - #8603: Partial sums are off for Fourier series of piecewise functions
 - #11225: improve piecewise plotting
- 
+- #16063: Unify the classes `RealSet` and `UnionOfIntervals`
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -6,9 +6,11 @@

 - #20878: `PointConfiguration`: Add `plot` method
 - #20879: Expose PPL's Not-Necessarily-Closed Polyhedra using Sage Polyhedra -- could play the same role as half-open intervals do in the context of the new piecewise functions.
+- #20892: package polymake 3.0

 Piecewise functions of 1 variable and `RealSet`s:
 - #1773: piecewise functions and integration / arithmetic do not play well together
 - #8603: Partial sums are off for Fourier series of piecewise functions
 - #11225: improve piecewise plotting
 - #16063: Unify the classes `RealSet` and `UnionOfIntervals`
+- #6895: Detect discontinuities when plotting the ceil function
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -14,3 +14,4 @@
 - #11225: improve piecewise plotting
 - #16063: Unify the classes `RealSet` and `UnionOfIntervals`
 - #6895: Detect discontinuities when plotting the ceil function
+- #10597: Riemann sums, added trapezoid option
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -7,6 +7,7 @@
 - #20878: `PointConfiguration`: Add `plot` method
 - #20879: Expose PPL's Not-Necessarily-Closed Polyhedra using Sage Polyhedra -- could play the same role as half-open intervals do in the context of the new piecewise functions.
 - #20892: package polymake 3.0
+- #21151: Update TOPCOM to 0.17.7, disable outdated libsoplex support

 Piecewise functions of 1 variable and `RealSet`s:
 - #1773: piecewise functions and integration / arithmetic do not play well together
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -16,3 +16,4 @@
 - #16063: Unify the classes `RealSet` and `UnionOfIntervals`
 - #6895: Detect discontinuities when plotting the ceil function
 - #10597: Riemann sums, added trapezoid option
+- #9935: Make a symbolic mod function
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -17,3 +17,4 @@
 - #6895: Detect discontinuities when plotting the ceil function
 - #10597: Riemann sums, added trapezoid option
 - #9935: Make a symbolic mod function
+- #21215: Periodic piecewise functions
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -17,4 +17,5 @@
 - #6895: Detect discontinuities when plotting the ceil function
 - #10597: Riemann sums, added trapezoid option
 - #9935: Make a symbolic mod function
+- #21232: Fractional part function {x}
 - #21215: Periodic piecewise functions
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -9,11 +9,16 @@
 - #20892: package polymake 3.0
 - #21151: Update TOPCOM to 0.17.7, disable outdated libsoplex support

-Piecewise functions of 1 variable and `RealSet`s:
+`RealSet`s:
+- #16063: Unify the classes `RealSet` and `UnionOfIntervals`
+- #21249: RealSets fail their TestSuite: _test_category, _test_pickling
+- #21242: Allow initializing RealSet from RealInterval or RBF elements
+- #21243: RealSet: add closure and interior methods
+
+Piecewise functions of 1 variable:
 - #1773: piecewise functions and integration / arithmetic do not play well together
 - #8603: Partial sums are off for Fourier series of piecewise functions
 - #11225: improve piecewise plotting
-- #16063: Unify the classes `RealSet` and `UnionOfIntervals`
 - #6895: Detect discontinuities when plotting the ceil function
 - #10597: Riemann sums, added trapezoid option
 - #9935: Make a symbolic mod function
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -8,6 +8,7 @@
 - #20879: Expose PPL's Not-Necessarily-Closed Polyhedra using Sage Polyhedra -- could play the same role as half-open intervals do in the context of the new piecewise functions.
 - #20892: package polymake 3.0
 - #21151: Update TOPCOM to 0.17.7, disable outdated libsoplex support
+- #10777: Implement CombinatorialPolyhedron

 `RealSet`s:
 - #16063: Unify the classes `RealSet` and `UnionOfIntervals`
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -24,4 +24,5 @@
 - #10597: Riemann sums, added trapezoid option
 - #9935: Make a symbolic mod function
 - #21232: Fractional part function {x}
+- #21274: frac(x) immediate simplifications
 - #21215: Periodic piecewise functions
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -8,13 +8,14 @@
 - #20879: Expose PPL's Not-Necessarily-Closed Polyhedra using Sage Polyhedra -- could play the same role as half-open intervals do in the context of the new piecewise functions.
 - #20892: package polymake 3.0
 - #21151: Update TOPCOM to 0.17.7, disable outdated libsoplex support
-- #10777: Implement CombinatorialPolyhedron
+- #10777: Implement `CombinatorialPolyhedron`

 `RealSet`s:
 - #16063: Unify the classes `RealSet` and `UnionOfIntervals`
-- #21249: RealSets fail their TestSuite: _test_category, _test_pickling
-- #21242: Allow initializing RealSet from RealInterval or RBF elements
-- #21243: RealSet: add closure and interior methods
+- #21249: `RealSet`s fail their `TestSuite`: `_test_category`, `_test_pickling`
+- #21242: Allow initializing `RealSet` from `RealInterval` or `RBF` elements
+- #21243: `RealSet`: add `closure` and `interior` methods
+- #21277: `sage_input` for `RealSet` and `piecewise`

 Piecewise functions of 1 variable:
 - #1773: piecewise functions and integration / arithmetic do not play well together
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -13,7 +13,7 @@
 `RealSet`s:
 - #16063: Unify the classes `RealSet` and `UnionOfIntervals`
 - #21249: `RealSet`s fail their `TestSuite`: `_test_category`, `_test_pickling`
-- #21242: Allow initializing `RealSet` from `RealInterval` or `RBF` elements
+- #21242: Allow initializing `RealSet` from `RealInterval` or `RBF` elements (dup: #17791)
 - #21243: `RealSet`: add `closure` and `interior` methods
 - #21277: `sage_input` for `RealSet` and `piecewise`
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -9,6 +9,7 @@
 - #20892: package polymake 3.0
 - #21151: Update TOPCOM to 0.17.7, disable outdated libsoplex support
 - #10777: Implement `CombinatorialPolyhedron`
+- #18197: Add CGAL package

 `RealSet`s:
 - #16063: Unify the classes `RealSet` and `UnionOfIntervals`
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -28,3 +28,4 @@
 - #21232: Fractional part function {x}
 - #21274: frac(x) immediate simplifications
 - #21215: Periodic piecewise functions
+- #21412: Convert piecewise functions to SymPy
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -1,4 +1,26 @@
-This meta-ticket will implement piecewise functions of several real variables. 
+This is a meta-ticket about piecewise functions.
+
+Piecewise functions of 1 variable:
+- #1773: piecewise functions and integration / arithmetic do not play well together
+- #8603: Partial sums are off for Fourier series of piecewise functions
+- #11225: improve piecewise plotting
+- #6895: Detect discontinuities when plotting the ceil function
+- #10597: Riemann sums, added trapezoid option
+- #9935: Make a symbolic mod function
+- #21232: Fractional part function {x}
+- #21274: frac(x) immediate simplifications
+- #21215: Periodic piecewise functions
+- #21412: Convert piecewise functions to SymPy
+- #21618: plot in piecewise regression (?)
+
+`RealSet`s, underlying the current implementation of `piecewise`:
+- #16063: Unify the classes `RealSet` and `UnionOfIntervals`
+- #21249: `RealSet`s fail their `TestSuite`: `_test_category`, `_test_pickling`
+- #21242: Allow initializing `RealSet` from `RealInterval` or `RBF` elements (dup: #17791)
+- #21243: `RealSet`: add `closure` and `interior` methods
+- #21277: `sage_input` for `RealSet` and `piecewise`
+
+As a generalization, this meta-ticket will implement piecewise functions of several real variables. 
 The pieces are polyhedral complexes (not necessarily triangulations) or more generally polyhedral dissections (i.e., not necessarily face-to-face).
 In my application, the functions will be piecewise linear, possibly discontinuous; but the implementation should be general enough for splines.

@@ -11,21 +33,4 @@
 - #10777: Implement `CombinatorialPolyhedron`
 - #18197: Add CGAL package

-`RealSet`s:
-- #16063: Unify the classes `RealSet` and `UnionOfIntervals`
-- #21249: `RealSet`s fail their `TestSuite`: `_test_category`, `_test_pickling`
-- #21242: Allow initializing `RealSet` from `RealInterval` or `RBF` elements (dup: #17791)
-- #21243: `RealSet`: add `closure` and `interior` methods
-- #21277: `sage_input` for `RealSet` and `piecewise`

-Piecewise functions of 1 variable:
-- #1773: piecewise functions and integration / arithmetic do not play well together
-- #8603: Partial sums are off for Fourier series of piecewise functions
-- #11225: improve piecewise plotting
-- #6895: Detect discontinuities when plotting the ceil function
-- #10597: Riemann sums, added trapezoid option
-- #9935: Make a symbolic mod function
-- #21232: Fractional part function {x}
-- #21274: frac(x) immediate simplifications
-- #21215: Periodic piecewise functions
-- #21412: Convert piecewise functions to SymPy
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -12,6 +12,7 @@
 - #21215: Periodic piecewise functions
 - #21412: Convert piecewise functions to SymPy
 - #21618: plot in piecewise regression (?)
+- #21709: Categories for piecewise functions

 `RealSet`s, underlying the current implementation of `piecewise`:
 - #16063: Unify the classes `RealSet` and `UnionOfIntervals`
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -1,4 +1,11 @@
 This is a meta-ticket about piecewise functions.
+
+Fractional part, modulo, ...:
+- #9935: Make a symbolic mod function
+- #21232: Fractional part function {x}
+- #21274: frac(x) immediate simplifications
+- #21745: Standardize modulo operator % on real numbers (step 1)
+- #21747: Standardize modulo operator % on real numbers (step 2)

 Piecewise functions of 1 variable:
 - #1773: piecewise functions and integration / arithmetic do not play well together
@@ -6,9 +13,6 @@
 - #11225: improve piecewise plotting
 - #6895: Detect discontinuities when plotting the ceil function
 - #10597: Riemann sums, added trapezoid option
-- #9935: Make a symbolic mod function
-- #21232: Fractional part function {x}
-- #21274: frac(x) immediate simplifications
 - #21215: Periodic piecewise functions
 - #21412: Convert piecewise functions to SymPy
 - #21618: plot in piecewise regression (?)
mkoeppe commented 8 years ago

Description changed:

--- 
+++ 
@@ -6,6 +6,7 @@
 - #21274: frac(x) immediate simplifications
 - #21745: Standardize modulo operator % on real numbers (step 1)
 - #21747: Standardize modulo operator % on real numbers (step 2)
+- #21748: change the mod method of rationals

 Piecewise functions of 1 variable:
 - #1773: piecewise functions and integration / arithmetic do not play well together
mkoeppe commented 6 years ago

Description changed:

--- 
+++ 
@@ -34,7 +34,8 @@

 - #20878: `PointConfiguration`: Add `plot` method
 - #20879: Expose PPL's Not-Necessarily-Closed Polyhedra using Sage Polyhedra -- could play the same role as half-open intervals do in the context of the new piecewise functions.
-- #20892: package polymake 3.0
+- #22710: Meta-ticket: polymake
+- #24943: Interface to polymake's polyhedral complexes
 - #21151: Update TOPCOM to 0.17.7, disable outdated libsoplex support
 - #10777: Implement `CombinatorialPolyhedron`
 - #18197: Add CGAL package
mkoeppe commented 6 years ago

Description changed:

--- 
+++ 
@@ -40,4 +40,10 @@
 - #10777: Implement `CombinatorialPolyhedron`
 - #18197: Add CGAL package

+General piecewise functions:
+- #23923: Interface cases function with `SymPy`'s piecewise
+- #20191: implement `SymPy` `Piecewise` equivalent
+- #21412: Convert piecewise functions to `SymPy`
+ 

+
mkoeppe commented 6 years ago

Description changed:

--- 
+++ 
@@ -30,6 +30,8 @@
 The pieces are polyhedral complexes (not necessarily triangulations) or more generally polyhedral dissections (i.e., not necessarily face-to-face).
 In my application, the functions will be piecewise linear, possibly discontinuous; but the implementation should be general enough for splines.

+- #26512 Piecewise linear functions of several variables
+
 Discussion welcome, in particular in regard to how this code should interact with the existing classes for abstract complexes (CW complexes) and `PointConfiguration`.

 - #20878: `PointConfiguration`: Add `plot` method
mkoeppe commented 4 years ago

Description changed:

--- 
+++ 
@@ -25,6 +25,7 @@
 - #21242: Allow initializing `RealSet` from `RealInterval` or `RBF` elements (dup: #17791)
 - #21243: `RealSet`: add `closure` and `interior` methods
 - #21277: `sage_input` for `RealSet` and `piecewise`
+- #30832: Connect `RealSet` to `sage.manifolds`

 As a generalization, this meta-ticket will implement piecewise functions of several real variables. 
 The pieces are polyhedral complexes (not necessarily triangulations) or more generally polyhedral dissections (i.e., not necessarily face-to-face).
mkoeppe commented 3 years ago
comment:29

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.

yuan-zhou commented 3 years ago

Description changed:

--- 
+++ 
@@ -31,6 +31,7 @@
 The pieces are polyhedral complexes (not necessarily triangulations) or more generally polyhedral dissections (i.e., not necessarily face-to-face).
 In my application, the functions will be piecewise linear, possibly discontinuous; but the implementation should be general enough for splines.

+- #31748 PolyhedralComplex
 - #26512 Piecewise linear functions of several variables

 Discussion welcome, in particular in regard to how this code should interact with the existing classes for abstract complexes (CW complexes) and `PointConfiguration`.
mkoeppe commented 3 years ago

Description changed:

--- 
+++ 
@@ -26,6 +26,7 @@
 - #21243: `RealSet`: add `closure` and `interior` methods
 - #21277: `sage_input` for `RealSet` and `piecewise`
 - #30832: Connect `RealSet` to `sage.manifolds`
+- #31740: Meta-ticket: Families, posets, complexes of manifold subsets

 As a generalization, this meta-ticket will implement piecewise functions of several real variables. 
 The pieces are polyhedral complexes (not necessarily triangulations) or more generally polyhedral dissections (i.e., not necessarily face-to-face).
mkoeppe commented 3 years ago

Description changed:

--- 
+++ 
@@ -22,17 +22,19 @@
 `RealSet`s, underlying the current implementation of `piecewise`:
 - #16063: Unify the classes `RealSet` and `UnionOfIntervals`
 - #21249: `RealSet`s fail their `TestSuite`: `_test_category`, `_test_pickling`
+- #21277: `sage_input` for `RealSet` and `piecewise`
+- #21243: `RealSet`: add methods `closure`, `interior`, `boundary`, `is_open`, `is_closed`
+- #31927: `RealSet`: Replace `is_included_in` by `is_subset` / `issubset`
+- #31914: `RealSet.contains`: Handle symbolic argument
+- #31877: Refine category of `RealSet`
+- **#31740: Meta-ticket: Families, posets, complexes of manifold subsets**
 - #21242: Allow initializing `RealSet` from `RealInterval` or `RBF` elements (dup: #17791)
-- #21243: `RealSet`: add `closure` and `interior` methods
-- #21277: `sage_input` for `RealSet` and `piecewise`
-- #30832: Connect `RealSet` to `sage.manifolds`
-- #31740: Meta-ticket: Families, posets, complexes of manifold subsets

 As a generalization, this meta-ticket will implement piecewise functions of several real variables. 
 The pieces are polyhedral complexes (not necessarily triangulations) or more generally polyhedral dissections (i.e., not necessarily face-to-face).
 In my application, the functions will be piecewise linear, possibly discontinuous; but the implementation should be general enough for splines.

-- #31748 PolyhedralComplex
+- #31748 `PolyhedralComplex`
 - #26512 Piecewise linear functions of several variables

 Discussion welcome, in particular in regard to how this code should interact with the existing classes for abstract complexes (CW complexes) and `PointConfiguration`.
mkoeppe commented 3 years ago

Description changed:

--- 
+++ 
@@ -25,6 +25,7 @@
 - #21277: `sage_input` for `RealSet` and `piecewise`
 - #21243: `RealSet`: add methods `closure`, `interior`, `boundary`, `is_open`, `is_closed`
 - #31927: `RealSet`: Replace `is_included_in` by `is_subset` / `issubset`
+- #31930: Replace `UnionOfIntervals` by `RealSet`
 - #31914: `RealSet.contains`: Handle symbolic argument
 - #31877: Refine category of `RealSet`
 - **#31740: Meta-ticket: Families, posets, complexes of manifold subsets**
mkoeppe commented 3 years ago

Description changed:

--- 
+++ 
@@ -24,6 +24,7 @@
 - #21249: `RealSet`s fail their `TestSuite`: `_test_category`, `_test_pickling`
 - #21277: `sage_input` for `RealSet` and `piecewise`
 - #21243: `RealSet`: add methods `closure`, `interior`, `boundary`, `is_open`, `is_closed`
+- #31941: Make empty `RealSet` false
 - #31927: `RealSet`: Replace `is_included_in` by `is_subset` / `issubset`
 - #31930: Replace `UnionOfIntervals` by `RealSet`
 - #31914: `RealSet.contains`: Handle symbolic argument
xcaruso commented 2 years ago
comment:38

I'm interested in implementing piecewise affine functions in one variable with specific methods that are easier to implement in this setting (e.g. compose, is_bijective, inverse, is_convex, convex_hull, laplace_transform, etc.) Mostly, I'm interested in the case where the coefficients of the affine parts are in QQ but I might also want to consider the case where they are in a fixed number field.

I'm wondering whether I should derive from the class sage.functions.piecewise.PiecewiseFunction (which is mostly concerned with symbolic expressions) or if it is okay if I rewrite my own class from scratch.

mkoeppe commented 2 years ago
comment:39

I have code in https://github.com/mkoeppe/cutgeneratingfunctionology/blob/master/cutgeneratingfunctionology/igp/fast_piecewise.py, based on the old Sage implementation of piecewise, which may be a starting point. It is not tied to symbolics and uses the parent-element framework

mkoeppe commented 2 years ago
comment:40

Also https://github.com/mkoeppe/cutgeneratingfunctionology/blob/master/cutgeneratingfunctionology/igp/move_semigroup.py

xcaruso commented 2 years ago
comment:42

Replying to @mkoeppe:

I have code in https://github.com/mkoeppe/cutgeneratingfunctionology/blob/master/cutgeneratingfunctionology/igp/fast_piecewise.py, based on the old Sage implementation of piecewise, which may be a starting point. It is not tied to symbolics and uses the parent-element framework

That's great! Do you plan to propose this code for integration in sage at some point or not?

yuan-zhou commented 2 years ago

Description changed:

--- 
+++ 
@@ -29,6 +29,7 @@
 - #31930: Replace `UnionOfIntervals` by `RealSet`
 - #31914: `RealSet.contains`: Handle symbolic argument
 - #31877: Refine category of `RealSet`
+- #32181: `RealSet`: Faster operations by scan-line (merging) techniques
 - **#31740: Meta-ticket: Families, posets, complexes of manifold subsets**
 - #21242: Allow initializing `RealSet` from `RealInterval` or `RBF` elements (dup: #17791)

@@ -46,7 +47,9 @@
 - #22710: Meta-ticket: polymake
 - #24943: Interface to polymake's polyhedral complexes
 - #21151: Update TOPCOM to 0.17.7, disable outdated libsoplex support
-- #10777: Implement `CombinatorialPolyhedron`
+- #26887: Implement `CombinatorialPolyhedron`
+- #27063: Transition of combinatorial computations of Polyhedron to Combinatorial Type
+- #31842: `CombinatorialPolyhedralComplex`
 - #18197: Add CGAL package

 General piecewise functions:
yuan-zhou commented 2 years ago
comment:44

Replying to @xcaruso:

Replying to @mkoeppe:

I have code in https://github.com/mkoeppe/cutgeneratingfunctionology/blob/master/cutgeneratingfunctionology/igp/fast_piecewise.py, based on the old Sage implementation of piecewise, which may be a starting point. It is not tied to symbolics and uses the parent-element framework

That's great! Do you plan to propose this code for integration in sage at some point or not?

I'm familiar with the piecewise linear function code in the above github folder, and I'd love to have that integrated into sage. This has been on my wishlist for a few years, but the integration has never happened, partially because I don't have a clear view on where this new class should be derived from and what methods are useful to general users.

Besides the class hierarchy, I think that the main modification concerns changing the use of close or open or half-open intervals defined in https://github.com/mkoeppe/cutgeneratingfunctionology/blob/master/cutgeneratingfunctionology/igp/intervals.py to RealSet.

mkoeppe commented 2 years ago
comment:45

Replying to @yuan-zhou:

Besides the class hierarchy, I think that the main modification concerns changing the use of close or open or half-open intervals defined in https://github.com/mkoeppe/cutgeneratingfunctionology/blob/master/cutgeneratingfunctionology/igp/intervals.py to RealSet.

Yes, that's an important task. Related: #32181

yuan-zhou commented 2 years ago
comment:46

Right, I notice that #32181 is related, and I added it into the description of this meta-ticket in comment:43. Replying to @mkoeppe:

Replying to @yuan-zhou:

Besides the class hierarchy, I think that the main modification concerns changing the use of close or open or half-open intervals defined in https://github.com/mkoeppe/cutgeneratingfunctionology/blob/master/cutgeneratingfunctionology/igp/intervals.py to RealSet.

Yes, that's an important task. Related: #32181

mkoeppe commented 2 years ago
comment:47

Regarding the class hierarchy, class PiecewiseLinearFunction_1d (ModuleElement) https://github.com/mkoeppe/cutgeneratingfunctionology/blob/master/cutgeneratingfunctionology/igp/fast_piecewise.py#L17 for the element is already good, I think. The corresponding parent is https://github.com/mkoeppe/cutgeneratingfunctionology/blob/master/cutgeneratingfunctionology/igp/fast_piecewise.py#L1221

There are many details so that it works correctly with all operations provided by the category.

If this is added to Sage, it would be best to put it somewhere that's not sage.functions because this package concerns symbolic functions.

If the scope remains piecewise linear functions (or even piecewise polynomial functions where the pieces are polyhedra such as box splines or simplex splines), then somewhere in sage.geometry would make sense because of its close ties to https://doc.sagemath.org/html/en/reference/discrete_geometry/sage/geometry/polyhedral_complex.html

Another connection: both indicator_function and convex_indicator_function (proposed to add in #32201) of polyhedra are, of course, piecewise linear functions.

c8e94d3a-9db0-4530-9b60-81397324e6ee commented 2 years ago

Description changed:

--- 
+++ 
@@ -18,6 +18,8 @@
 - #21412: Convert piecewise functions to SymPy
 - #21618: plot in piecewise regression (?)
 - #21709: Categories for piecewise functions
+- #34456: piecewise polynomial in one dimension
+

 `RealSet`s, underlying the current implementation of `piecewise`:
 - #16063: Unify the classes `RealSet` and `UnionOfIntervals`