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

highspy: updated highs_linear_expression to be immutable for issue #1888 #1891

Closed

Conversation

mathgeekcoder
Copy link
Contributor

@mathgeekcoder mathgeekcoder commented Aug 23, 2024

Changes should fix #1888

  • changed highs_linear_expression to be immutable by default
  • added __repr__ for easier debugging and pretty print linear expressions
  • added __iadd__ for mutable operations
  • added qsum for faster aggregation
  • added expr == [lb,ub] -> lb <= expr <= ub syntax
  • updated chained comparison support to work in immutable setting

Note there are some low-risk caveats for the chained comparison support. I have documented them in the code. Though I believe the benefits outweigh the potential concerns.

michaelbynum and others added 6 commits April 24, 2024 08:57
* added __repr__ for easier debugging and pretty print linear expressions
* added __iadd__ for mutable operations
* added qsum for faster aggregation
* updated chained comparison support to work in immutable setting
@odow
Copy link
Collaborator

odow commented Aug 23, 2024

I can't comment on the implementation (I don't know Python well), other than to say that, at minimum, this needs a bunch of tests.

@mathgeekcoder
Copy link
Contributor Author

I can't comment on the implementation (I don't know Python well), other than to say that, at minimum, this needs a bunch of tests.

Agreed. Working on this now, will update PR. BTW: the code changes for immutability are very simple. The chained comparison support definitely needs more testing, and I believe I've already found a couple of edge cases that need attention.

@mathgeekcoder mathgeekcoder marked this pull request as draft August 23, 2024 20:50
jajhall and others added 21 commits August 25, 2024 18:05
`col_ecol_offset` now set - as const - for greater clarity
plot_highs_log.py now avoids printing spurious incumbent lines when best solution is NaN
…tatic extern int Highs_passHessian, private static extern int Highs_passModel and private static extern int Highs_getHessianNumNz to highs_csharp_api.cs
mathgeekcoder and others added 25 commits August 30, 2024 10:55
… data to be contiguous with additional flags to array_t.
Replace hot FDIVs with FMULs through saving off the inverse values
outside the loops, so we don't incur the cost on each loop iteration.
Precompute expensive computations
Revert "Precompute expensive computations"
* additional tests (with >99% coverage)
* performance improvements
* added support for calculating a value from expression
* added support for getting expression for a given constraint
* various bug fixes
* made behaviour more consistent/intuitive
* improved numpy interability
* improved error reporting/handling
Release GIL and Run in Background Thread
* added __repr__ for easier debugging and pretty print linear expressions
* added __iadd__ for mutable operations
* added qsum for faster aggregation
* updated chained comparison support to work in immutable setting
… data to be contiguous with additional flags to array_t.
* additional tests (with >99% coverage)
* performance improvements
* added support for calculating a value from expression
* added support for getting expression for a given constraint
* various bug fixes
* made behaviour more consistent/intuitive
* improved numpy interability
* improved error reporting/handling
* Added GIL acquire for python callbacks
* Added support for user_callback_data
* added callback support
* added user/keyboard interrupt support
* fixed issues with deadlock on windows
* fixed MIP solution callback issue
* added resetGlobalScheduler
* released GIL for Presolve
* improved setCallback
* updated unit tests for 99% coverage
@mathgeekcoder
Copy link
Contributor Author

Abandoning this PR, as it has been replaced by #1942.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants