Skip to content

Commit

Permalink
Expose Matrix types (#959)
Browse files Browse the repository at this point in the history
* Create branch

* start of tests

* Added extra dimension

* Update tests

* First working test

* First working test

* Expr from matrix variables test

* Working version of ExprCons with le

* Can now add linear matrix constraints

* More robust Matrix classes

* add todo

* Clean up addMatrixCons function

* Add MatrixVar methods

* Update TODOs

* Add getter functions to matrixConstraint class@
git push

* Add checks for missing numpy

* Add matrix API to readthedocs

* Add minor grammar stuff. Add GCG to similar software

* Remove universal build. Add type asserts

* Update pipelines to include numpy

* Add numpy as a dependency

* Remove cimports for now

* Support adding MatrixExprCons in addConss

* Changed tests a bit

* Support querying solution values using MatrixExpr

* Add a test

* Remove SCIP bug from tests. Already reported

* Update CHANGELOG

* Add info for 5.4.0 release

* Make numpy a dependency (not just at build time)

* Most comments addressed

* Add test for documentation

* Fix documentation

* Add solution value accessing to docs

* Format test file

* Update docs/tutorials/matrix.rst

Co-authored-by: Mohammed Ghannam <[email protected]>

* Update docs/tutorials/matrix.rst

Co-authored-by: Mohammed Ghannam <[email protected]>

* Expose Matrix types

---------

Co-authored-by: Mark Turner <[email protected]>
Co-authored-by: Joao-Dionisio <[email protected]>
Co-authored-by: Mark Turner <[email protected]>
Co-authored-by: João Dionísio <[email protected]>
  • Loading branch information
5 people authored Feb 25, 2025
1 parent a0165ec commit 6ac9397
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
### Changed
### Removed

## 5.4.0 - 2024.02.24
## 5.4.1 - 2024.02.24
### Added
- Added option to get Lhs, Rhs of nonlinear constraints
- Added cutoffNode and test
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
print("Assuming that SCIP is installed globally, because SCIPOPTDIR is undefined.\n")

else:

# check whether SCIP is installed in the given directory
if os.path.exists(os.path.join(scipoptdir, "include")):
includedir = os.path.abspath(os.path.join(scipoptdir, "include"))
Expand Down Expand Up @@ -108,7 +109,7 @@

setup(
name="PySCIPOpt",
version="5.4.0",
version="5.4.1",
description="Python interface and modeling environment for SCIP",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
5 changes: 5 additions & 0 deletions src/pyscipopt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
from pyscipopt.Multidict import multidict
from pyscipopt.scip import Model
from pyscipopt.scip import Variable
from pyscipopt.scip import MatrixVariable
from pyscipopt.scip import Constraint
from pyscipopt.scip import MatrixConstraint
from pyscipopt.scip import Benders
from pyscipopt.scip import Benderscut
from pyscipopt.scip import Branchrule
Expand All @@ -26,6 +28,9 @@
from pyscipopt.scip import LP
from pyscipopt.scip import readStatistics
from pyscipopt.scip import Expr
from pyscipopt.scip import MatrixExpr
from pyscipopt.scip import MatrixExprCons
from pyscipopt.scip import ExprCons
from pyscipopt.scip import quicksum
from pyscipopt.scip import quickprod
from pyscipopt.scip import exp
Expand Down
2 changes: 1 addition & 1 deletion src/pyscipopt/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '5.4.0'
__version__ = '5.4.1'
2 changes: 1 addition & 1 deletion tests/test_matrix_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pprint
import pytest
from pyscipopt import Model, Variable, log, exp, cos, sin, sqrt
from pyscipopt.scip import Expr, MatrixExpr, MatrixVariable, MatrixExprCons, MatrixConstraint, ExprCons
from pyscipopt import Expr, MatrixExpr, MatrixVariable, MatrixExprCons, MatrixConstraint, ExprCons
from time import time

import numpy as np
Expand Down

0 comments on commit 6ac9397

Please sign in to comment.