Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Docs: add readme details about restricting variables to have integer values #78

Merged
merged 2 commits into from
Jan 2, 2025

Conversation

nik-sm
Copy link
Contributor

@nik-sm nik-sm commented Jan 2, 2025

More details in README:

  • add more detail on constraining variables to integer solutions
  • show the (integer) qualifier syntax inside the variables! macro
  • update documentation links to use latest

Add test in variables.rs showing (integer) qualifier

- add more detail on constraining variables to integer solutions
- show the `(integer)` qualifier syntax inside the `variables!` macro
- update documentation links to use `latest`

Add test in `variables.rs` showing `(integer)` qualifier
@nik-sm
Copy link
Contributor Author

nik-sm commented Jan 2, 2025

Adding docs based on my previous confusion in #76

Copy link
Collaborator

@lovasoa lovasoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks

@lovasoa
Copy link
Collaborator

lovasoa commented Jan 2, 2025

The new test needs to run only on solvers with integer variables support, you can have a look at how other tests do this

@nik-sm
Copy link
Contributor Author

nik-sm commented Jan 2, 2025

Whoops - I added a #[cfg(not(feature = "clarabel"))] to the test and tried using cargo test --no-default-features --features clarabel to see that it indeed skips the test for that solver.

(I think that's how the build script runs, based on https://github.com/rust-or/good_lp/actions/runs/12586912454/job/35081976400#step:16:1)

@lovasoa lovasoa merged commit a8112da into rust-or:main Jan 2, 2025
1 check passed
@lovasoa
Copy link
Collaborator

lovasoa commented Jan 2, 2025

thanks!

KnorpelSenf pushed a commit to KnorpelSenf/good_lp that referenced this pull request Jan 22, 2025
…values (rust-or#78)

* More details in README:
- add more detail on constraining variables to integer solutions
- show the `(integer)` qualifier syntax inside the `variables!` macro
- update documentation links to use `latest`

Add test in `variables.rs` showing `(integer)` qualifier

* - conditional config for test - integer variables not suppored by "clarabel" solver

---------

Co-authored-by: Niklas Smedemark-Margulies <niklas.smedemark-margulies@analog.com>
lovasoa added a commit that referenced this pull request Feb 18, 2025
* feat: allow defining initial values for individual variables

* feat: support initial variable values for cbc

* feat: support initial variable values for SCIP

* docs: fix typo in `variable.initial()` docs

* fix: compile

* fix: parse

* perf: track and leverage initial solution size

Previously, when building up an initial solution from the problem
variables would cause repeated reallocation. We support partial initial
solutions so we may have 0-n values in the initial solution (with n
being the number of total variables). We do not want to allocate memory
for all variables because there might be 0 initial values, and we also
do not want to do allocate 0 memory because then we have to repeatedly
reallocate memory as the initial solution grows.

These changes introduce a counter that is incrememted whenever a
variable with an initial value is added to the problem. That way, we can
allocate the perfect number of bytes upfront in all cases.

* docs: add doctest for initial_solution_len

* build: switch over to highs bindings from git

* feat: support initial solutions for HiGHS

* test: add first tests for HiGHS solver

* explain more in readme

* Docs: add readme details about restricting variables to have integer values (#78)

* More details in README:
- add more detail on constraining variables to integer solutions
- show the `(integer)` qualifier syntax inside the `variables!` macro
- update documentation links to use `latest`

Add test in `variables.rs` showing `(integer)` qualifier

* - conditional config for test - integer variables not suppored by "clarabel" solver

---------

Co-authored-by: Niklas Smedemark-Margulies <niklas.smedemark-margulies@analog.com>

* chore: do not bundle scip on docs.rs (#81)

* chore: do not bundle scip on docs.rs

* docs: add comment on docs.rs features

* build: switch over to highs bindings from git

* feat: support initial solutions for HiGHS

* test: add first tests for HiGHS solver

* build: update highs to 1.7.0

* Revert "build: update highs to 1.7.0"

This reverts commit 8e0cb62.

* build: update highs and russcip

* refactor: drop unused imports

* style: fix lint for empty check

* Revert "refactor: drop unused imports"

This reverts commit f1dcedb.

* test: drop test for byte size

* refactor: prefer is_empty over >0

* feat: add support for initial solutions with HiGHS

* style: fix formatting

* test: cover initial variable values for HiGHS

* test: add time_limit=0 to tests for hot starts

---------

Co-authored-by: lovasoa <contact@ophir.dev>
Co-authored-by: Niklas <niklas.sm+github@gmail.com>
Co-authored-by: Niklas Smedemark-Margulies <niklas.smedemark-margulies@analog.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants