-
Notifications
You must be signed in to change notification settings - Fork 9
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
How to represent the frobenius norm in QCML? #55
Comments
I believe I ported the model to QCML correctly, however, I am getting an error in the generated code. The QCML model I'm using is:
but when I try to compile the generated C code, I get this error:
It looks like the issue is that the |
You can try sum(sum(square(A-B))).
IIRC, this might not work, since I wasn't planning on supporting matrix
variables.
In this case, you can (possibly) work around it by vectorizing the matrix
externally. Let me know...
…On Tue, May 30, 2017 at 5:17 PM David Greenberg ***@***.***> wrote:
I believe I ported the model to QCML correctly, however, I am getting an
error in the generated code. The QCML model I'm using is:
dimensions n
variable B(n,n)
parameter A(n,n)
minimize norm2(A - B)
subject to
B + B' >= 0
but when I try to compile the generated C code, I get this error:
psd.c:81:81: error: assigning to 'double' from incompatible type 'qc_matrix' (aka 'struct coo')
for(i = 0; i < dims->n * dims->n; ++i) data->h[i + (1 + dims->n * dims->n)] = params->A[i];
^ ~~~~~~~~~~~~
psd.c:119:13: warning: incompatible pointer types assigning to 'qc_matrix *' (aka 'struct coo *') from 'const double *' [-Wincompatible-pointer-types]
vars->B = x + 0; /* length dims->n * dims->n */
^ ~~~~~
1 warning and 1 error generated.
make: *** [psd.o] Error 1
It looks like the issue is that the A and B matrices are of type qc_matrix
* in the generated code, but the way I've declared them is making the
system think that they're scalar, possibly? Could you let me know if I'm
expressing something in an obviously incorrect way?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#55 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AADN0dWv4VA9Jn4GXQbjw41MhvdwrbTpks5r_LGagaJpZM4NiyZX>
.
|
I'd like to represent this CVX model in QCML:
But I'm not sure what the best way to express the
norm(A-B,'Fro')
component is.The text was updated successfully, but these errors were encountered: