One - One Code All

Blog Content

cvxopt矩阵转换np.double, converting numpy vector to cvxopt

Python 统计学-科学计算   2015-11-22 11:06:14

cvxopt矩阵转换converting numpy vector to cvxopt

q = q.astype(np.double)
cvx_q = matrix(q)

CVX only accepts doubles, not ints.


官网参考:http://cvxopt.org/userguide/matrices.html?highlight=matrix#cvxopt.matrix 


上一篇:APScheduler中两种调度器的区别及使用过程中要注意的问题
下一篇:轻量级 Python 装饰器的缓存库wrapcache

The minute you think of giving up, think of the reason why you held on so long.