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

Matmul and dot operation #251

Merged
merged 4 commits into from
Mar 10, 2024
Merged

Matmul and dot operation #251

merged 4 commits into from
Mar 10, 2024

Conversation

FabianHofmann
Copy link
Collaborator

New Features

  • Variables and LinearExpressions now have a new method dot, which allows computing the dot product of two objects. This multiplies objects and sums over common dimensions.

  • The matmul operator @, which runs the dot operation, is now supported for Variables and LinearExpression.

Bugfixes

  • The multiplication of two linear expression with non-zero constants led to wrong results of the cross terms. Given the multiplication (v1 + c1) * (v2 + c2) with v being a variable and c a constant, the operation did not calculate the cross terms v1 * c2 + v2 * c1. This is fixed now.

@FabianHofmann FabianHofmann enabled auto-merge March 10, 2024 13:12
@FabianHofmann FabianHofmann merged commit 8405d01 into master Mar 10, 2024
11 checks passed
@hcoste
Copy link

hcoste commented May 22, 2024

Hello FabianHofmann, thanks for the feature. Could your provide an example of dot product between a linopy variable (vector) and a constant matrix ? It seems this is not yet possible but I wanted to have your opinion if possible.

KR

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.

2 participants