我可以在纸浆目标中求解两个矩阵倍数
我是编程中编写代码的新手。 我在 Python 纸浆库中编写客观代码时遇到问题,并且无法解决其错误。 我向 python 代码写入一个对数表达式,它是两个矩阵的倍数。 我的问题的形式和我的代码如下。 请帮我。
from pulp import *
m = LpVariable('m', lowBound=0, cat='Integer')
n = LpVariable('n', lowBound=0, cat='Integer')
# --------------------------------------- decision variable
x = LpVariable.matrix("x",(range(m),range(n)),0,1,cat = 'Binary')
P = LpVariable.matrix("P",(range(m),range(n)),cat = 'Integer')
G = LpVariable.matrix("G",(range(m),range(n)),cat = 'Integer')
model = pulp.lpDot(P, G)
print(model, type(model))
I am a novice in writing code in programing.
I'm having trouble writing a objective code in the Python pulp library and I can't solve its error.
I write to python code a logarithm expression that is a multiple of two matrices.
The form of my problem and my code are as follows.
please help me.
from pulp import *
m = LpVariable('m', lowBound=0, cat='Integer')
n = LpVariable('n', lowBound=0, cat='Integer')
# --------------------------------------- decision variable
x = LpVariable.matrix("x",(range(m),range(n)),0,1,cat = 'Binary')
P = LpVariable.matrix("P",(range(m),range(n)),cat = 'Integer')
G = LpVariable.matrix("G",(range(m),range(n)),cat = 'Integer')
model = pulp.lpDot(P, G)
print(model, type(model))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论