CVXOPT QP Solver: TypeError: 'A' must be a 'd' matrix with 1000 columns

ぃ、小莉子 提交于 2019-12-01 17:11:20

Your matrix elements have to be of type double as well. So just using A=A.astype('double') to cast it.

i have try A=A.astype(double) to solve it, but it is invalid, since python doesn't know what double is or A has no method astype.

therefore

via using A = matrix(A, (1, m), 'd') could actually solve this problem!

Priya

The error - "TypeError: 'A' must be a 'd' matrix with 1000 columns:" has two condition namely:

  1. if the type code is not equal to 'd'
  2. if the A.size[1] != c.size[0].

Check for these conditions.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!