-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[mlir][presburger] Preserve relative ordering of symbols and non-symbol vars when setting up SymbolicLexSimplex #119036
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,13 +64,14 @@ SimplexBase::SimplexBase(unsigned nVar, bool mustUseBigM, | |
| const llvm::SmallBitVector &isSymbol) | ||
| : SimplexBase(nVar, mustUseBigM) { | ||
| assert(isSymbol.size() == nVar && "invalid bitmask!"); | ||
| // Invariant: nSymbol is the number of symbols that have been marked | ||
| // already and these occupy the columns | ||
| // [getNumFixedCols(), getNumFixedCols() + nSymbol). | ||
| for (unsigned symbolIdx : isSymbol.set_bits()) { | ||
| var[symbolIdx].isSymbol = true; | ||
| swapColumns(var[symbolIdx].pos, getNumFixedCols() + nSymbol); | ||
| ++nSymbol; | ||
| // Iterate through all the variables. Move symbols to the left and non-symbols | ||
| // to the right while preserving relative ordering. | ||
| for (unsigned i = 0; i < nVar; ++i) { | ||
| if (isSymbol[i]) { | ||
| var[i].isSymbol = true; | ||
| swapColumns(var[i].pos, getNumFixedCols() + nSymbol); | ||
| nSymbol++; | ||
christopherbate marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new code looks equivalent to the old -- am I missing someting?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose set bits doesn't guarantee the order of indices returned?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right, it was equivalent. I updated the code to use a stable partitioning.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (The old code in |
||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.