-
Notifications
You must be signed in to change notification settings - Fork 271
Open
Description
Describe the bug
The result of @
operation is MatrixVariable
. And it can't access the .vtype
method.
To Reproduce
In [1]: from pyscipopt import Model
In [2]: model = Model()
In [3]: x = model.addMatrixVar(3)
In [4]: x
Out[4]: MatrixVariable([x1, x2, x3], dtype=object)
In [5]: res = x @ x
In [6]: res
Out[6]:
MatrixVariable(Expr({Term(x1, x1): 1.0, Term(x2, x2): 1.0, Term(x3, x3): 1.0}),
dtype=object)
In [7]: type(res)
Out[7]: pyscipopt.scip.MatrixVariable
In [8]: res.vtype()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[8], line 1
----> 1 res.vtype()
File src/pyscipopt/scip.pxi:1821, in pyscipopt.scip.MatrixVariable.vtype()
AttributeError: 'pyscipopt.scip.Expr' object has no attribute 'vtype'
Expected behavior
- Return
MatrixExpr
, notMatrixVariable
- Or return
MatrixVariable
and could accessvtype
Screenshots

System
- OS: Windows 11
- Version: 24H2 (26100.4061)
- SCIP version: 9.2.3
- How did you install pyscipopt?: build from 8267aa4, base on 5.5.0
Metadata
Metadata
Assignees
Labels
No labels