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

lpDot does not use the coefficients in LpAffineExpression #483

Closed
6 of 14 tasks
ytakashina opened this issue Sep 19, 2021 · 3 comments
Closed
6 of 14 tasks

lpDot does not use the coefficients in LpAffineExpression #483

ytakashina opened this issue Sep 19, 2021 · 3 comments

Comments

@ytakashina
Copy link

ytakashina commented Sep 19, 2021

Details for the issue

What did you do?

x = pd.Series(pl.LpVariable.dicts("x", range(5)), index=range(5))  # Series of LpVariable
y = 2 * x  # Series of LpAffineExpression
a = np.arange(5)

What did you expect to see?

>>> pl.lpDot(y, a) 
LpAffineExpression([(x_1, 2), (x_2, 4), (x_3, 6), (x_4, 8)])

What did you see instead?

>>> pl.lpDot(y, a)
LpAffineExpression([(x_1, 1), (x_2, 2), (x_3, 3), (x_4, 4)])

Useful extra information

The info below often helps, please fill it out if you're able to. :)

What operating system are you using?

  • Windows: ( version: 10 )
  • Linux: ( distro: ___ )
  • Mac OS: ( version: ___ )
  • Other: ___

I'm using python version:

  • 2.7
  • 3.4
  • 3.5
  • 3.6
  • Other: 3.7

I installed PuLP via:

Did you also

@sdementen
Copy link

fyi, as a workaround you can use y @ a instead of lpDot

nariaki3551 added a commit to nariaki3551/pulp that referenced this issue Aug 22, 2022
@frrad
Copy link
Contributor

frrad commented Aug 31, 2024

Should be fixed by #769

@ytakashina
Copy link
Author

fixed, thx!

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

No branches or pull requests

3 participants