CVXOPT.blas functions return None

25 views
Skip to first unread message

Ingeborg Roete

unread,
Feb 10, 2016, 8:36:05 AM2/10/16
to CVXOPT
Hello all,

I was trying to use the level 2 BLAS function cvxopt.blas.dger(), and perhaps I am making a very silly mistake, but even the most basic operations keep returning None. Iḿ hoping there is someone who knows what I'm doing wrong.

for example:

import cvxopt
x = cvxopt.matrix([1.3,1.4,1.5])
alpha = 0.5
y = cvxopt.blas.scal(alpha,x)
print(y)
>>> None

How I would like to use it in the end is (the actual variables values are made up here):

variance = np.array([[1.0,2.0],[3.5,4.5]])
diff = np.array([0.5,2.3])
dof = 1.2
n = 2

variance = cvxopt.matrix(variance)
diff = cvxopt.matrix(diff)

variance = cvxopt.blas.ger(diff, diff, variance, ((n*dof)/(n+dof)))

However, this also returns None


Thanks a lot,
Ingeborg

Martin

unread,
Feb 10, 2016, 8:41:44 AM2/10/16
to CVXOPT
The simple reason is that the blas functions perform in-place operations, and hence the routines do not return anything. For example, call cvxopt.blas.scal(alpha,x) would be equivalent to x *= alpha.

Ingeborg Roete

unread,
Feb 11, 2016, 5:16:20 AM2/11/16
to CVXOPT
Thank you very much for your reply! I hadn't realized that.

Yours sincerely,
Ingeborg

Op woensdag 10 februari 2016 14:41:44 UTC+1 schreef Martin:
Reply all
Reply to author
Forward
0 new messages