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
Implement zero_pattern_matrix
#29839
Comments
comment:1
Better suggestions for a name would be welcome. |
Branch: public/29839 |
Commit: |
New commits:
|
comment:3
zero_pattern_matrix? |
comment:4
Better anyway. With public or semiprivate? (leading underscore). Btw, there is a bug here. I copied this from
|
comment:5
shouldn't |
comment:6
Replying to @kliem:
why can't you use
|
comment:7
Because it is slow. I just copied the construction of the parent from
|
comment:8
And |
This comment has been minimized.
This comment has been minimized.
Changed keywords from incidence matrix, zero entries to incidence matrix, zero pattern |
_zero_matrix
for dense integer and rational matriceszero_pattern_matrix
for dense integer and rational matrices
comment:12
I really want a new integer matrix. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
This comment has been minimized.
This comment has been minimized.
comment:15
Have you tried doing either |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
This comment has been minimized.
This comment has been minimized.
comment:39
Okay, that takes care of the sparse matrices and symbolic matrices. Slightly surprisingly, the gap matrices don't benefit from not going through Sage (well, at least for integer matrices). I am done now. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:41
IMO this is good now. The doctests should also pass. |
Changed reviewer from Travis Scrimshaw to Travis Scrimshaw, Jonathan Kliem |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:43
Thank you. Two more little things: INPUT:
- - `ring` -- (optional); base ring of the output; default is `ZZ`
+ - `ring` -- (optional); base ring of the output; default is ``ZZ`` and we should add a test for the empty row/column and empty matrix for |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:45
Replying to @tscrim:
Well the bot was segfaulting (and me to, when running the test). |
comment:46
Okay, then positive review. Thank you. |
comment:47
I like that you made a polyhedron only ticket, into a more general improvement for other parts as well. |
This comment has been minimized.
This comment has been minimized.
comment:48
(Slightly amending ticket description, please check that works for you.). |
Changed branch from public/29839 to |
We implement a method on matrices that gives a new matrix with specified base ring
and entries 1 where and only where the initial matrix had zero entries, and 0 elsewhere.
Motivation: This method is useful to obtain the incidence matrix of a polyhedron from the slack matrix in #29837.
Along the way this ticket also fixes a bug:
To optimize this method, a matrix class can use the optimized
get_is_zero_unsafe
.In this ticket this is done for most matrix classes. We also use this new optimized zero check in places where it makes sense.
Component: basic arithmetic
Keywords: incidence matrix, zero pattern
Author: Jonathan Kliem, Travis Scrimshaw
Branch/Commit:
82c6b4a
Reviewer: Travis Scrimshaw, Jonathan Kliem
Issue created by migration from https://trac.sagemath.org/ticket/29839
The text was updated successfully, but these errors were encountered: