Repository navigation
Description
This is a meta-ticket about piecewise functions.
Fractional part, modulo, ...:
- Make a symbolic mod function #9935: Make a symbolic mod function
- Fractional part function {x} #21232: Fractional part function {x}
- frac(x) immediate simplifications #21274: frac(x) immediate simplifications
- Standardize modulo operator % on real numbers (step 1) #21745: Standardize modulo operator % on real numbers (step 1)
- Standardize modulo operator % on real numbers (step 2) #21747: Standardize modulo operator % on real numbers (step 2)
- change the mod method of rationals #21748: change the mod method of rationals
Piecewise functions of 1 variable:
- piecewise functions and integration / arithmetic do not play well together #1773: piecewise functions and integration / arithmetic do not play well together
- Partial sums are off for Fourier series of piecewise functions #8603: Partial sums are off for Fourier series of piecewise functions
- improve piecewise plotting #11225: improve piecewise plotting
- Detect discontinuities when plotting the ceil function #6895: Detect discontinuities when plotting the ceil function
- Riemann sums, added trapezoid option #10597: Riemann sums, added trapezoid option
- Periodic piecewise functions #21215: Periodic piecewise functions
- Convert piecewise functions to SymPy #21412: Convert piecewise functions to SymPy
- plot in piecewise regression #21618: plot in piecewise regression (?)
- Categories for piecewise functions #21709: Categories for piecewise functions
- piecewise polynomial in one dimension #34456: piecewise polynomial in one dimension
RealSets, underlying the current implementation of piecewise:
- Unify the classes RealSet and UnionOfIntervals #16063: Unify the classes
RealSetandUnionOfIntervals - RealSets fail their TestSuite: _test_category, _test_pickling #21249:
RealSets fail theirTestSuite:_test_category,_test_pickling - sage_input for infinities and RealSet #21277:
sage_inputforRealSetandpiecewise - RealSet: add methods closure, interior, boundary, is_open, is_closed #21243:
RealSet: add methodsclosure,interior,boundary,is_open,is_closed - Make empty RealSet false #31941: Make empty
RealSetfalse - RealSet: Replace is_included_in, is_disjoint_from by is_subset, is_disjoint #31927:
RealSet: Replaceis_included_inbyis_subset/issubset - Replace UnionOfIntervals by RealSet #31930: Replace
UnionOfIntervalsbyRealSet - RealSet.contains: Handle symbolic argument #31914:
RealSet.contains: Handle symbolic argument - Refine category of RealSet #31877: Refine category of
RealSet - RealSet: Faster operations by scan-line (merging) techniques #32181:
RealSet: Faster operations by scan-line (merging) techniques - Meta-ticket: Families, posets, complexes of manifold subsets #31740: Meta-ticket: Families, posets, complexes of manifold subsets
- Allow initializing RealSet from RealInterval or RBF elements #21242: Allow initializing
RealSetfromRealIntervalorRBFelements (dup: allow RealSet construction from RealInterval #17791)
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.
- PolyhedralComplex #31748
PolyhedralComplex - Piecewise linear functions of several variables #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.
- PointConfiguration: Add plot method #20878:
PointConfiguration: Addplotmethod - Expose PPL's Not-Necessarily-Closed Polyhedra and Normaliz' Polyhedra with Open Facets using Sage Polyhedra #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.
- Meta-ticket: polymake #22710: Meta-ticket: polymake
- Interface to polymake's polyhedral complexes #24943: Interface to polymake's polyhedral complexes
- Update TOPCOM to 0.17.7, disable outdated libsoplex support #21151: Update TOPCOM to 0.17.7, disable outdated libsoplex support
- Implement the class CombinatorialPolyhedron #26887: Implement
CombinatorialPolyhedron - Transition of combinatorial computations of Polyhedron to Combinatorial Type #27063: Transition of combinatorial computations of Polyhedron to Combinatorial Type
- CombinatorialPolyhedralComplex #31842:
CombinatorialPolyhedralComplex - Add CGAL package #18197: Add CGAL package
General piecewise functions:
- Interface cases function with SymPy's piecewise #23923: Interface cases function with
SymPy's piecewise - implement SymPy Piecewise equivalent #20191: implement
SymPyPiecewiseequivalent - Convert piecewise functions to SymPy #21412: Convert piecewise functions to
SymPy
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
Activity
mkoeppe commentedon Jun 24, 2016
mkoeppe commentedon Jun 26, 2016
mkoeppe commentedon Jun 27, 2016
mkoeppe commentedon Jun 27, 2016
mkoeppe commentedon Jul 7, 2016
mkoeppe commentedon Jul 7, 2016
mkoeppe commentedon Aug 5, 2016
mkoeppe commentedon Aug 10, 2016
mkoeppe commentedon Aug 10, 2016
mkoeppe commentedon Aug 12, 2016
mkoeppe commentedon Aug 14, 2016
mkoeppe commentedon Aug 15, 2016
mkoeppe commentedon Aug 18, 2016
mkoeppe commentedon Aug 18, 2016
mkoeppe commentedon Aug 19, 2016
13 remaining items
mkoeppe commentedon Jun 7, 2021
mkoeppe commentedon Jun 8, 2021
mkoeppe commentedon Jun 9, 2021
xcaruso commentedon Mar 17, 2022
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 inQQbut 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 commentedon Mar 17, 2022
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 frameworkmkoeppe commentedon Mar 17, 2022
Also https://github.com/mkoeppe/cutgeneratingfunctionology/blob/master/cutgeneratingfunctionology/igp/move_semigroup.py
xcaruso commentedon Mar 23, 2022
Replying to @mkoeppe:
That's great! Do you plan to propose this code for integration in sage at some point or not?
yuan-zhou commentedon Mar 23, 2022
yuan-zhou commentedon Mar 23, 2022
Replying to @xcaruso:
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 commentedon Mar 23, 2022
Replying to @yuan-zhou:
Yes, that's an important task. Related: #32181
yuan-zhou commentedon Mar 23, 2022
Right, I notice that #32181 is related, and I added it into the description of this meta-ticket in comment:43.
Replying to @mkoeppe:
mkoeppe commentedon Mar 23, 2022
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#L1221There 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.functionsbecause 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.geometrywould make sense because of its close ties to https://doc.sagemath.org/html/en/reference/discrete_geometry/sage/geometry/polyhedral_complex.htmlAnother connection: both
indicator_functionandconvex_indicator_function(proposed to add in #32201) of polyhedra are, of course, piecewise linear functions.NicoleYueqiLi commentedon Aug 31, 2022