You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The result of one_dim_matrix.sum() is Expr (scaler). It was changed to a scaler if the size of the result is 1.
But the result of matrix@matrix is MatrixVariable (matrix). The size of the result matrix@matrix is 1.
Same shape but different result. Should we keep the same?
Use numpy style, don't change the result at all. Keep the result as the matrix.
If the size is one, change it to scaler.
In [1]: frompyscipoptimportModelIn [2]: model=Model()
In [3]: x=model.addMatrixVar(3)
In [4]: y=model.addMatrixVar(3)
In [5]: type(x.sum()) # the size is 1, and result is a scalerOut[5]: pyscipopt.scip.ExprIn [6]: type(x @ y) # the size is 1, but result is a matrixOut[6]: pyscipopt.scip.MatrixVariableIn [7]: (x @ y).shapeOut[7]: ()
In [8]: type((x @ y).item())
Out[8]: pyscipopt.scip.Expr