Using function handles instead of explicit matrices

Assume I have a simple convex problem min ||Ax - b||_2 s.t. ||x||_1=1.

Can I specify A as a function handle, afun, such that afun(x,‘notransp’) returns A*x and afun(x,‘transp’) returns A’*x (similar to lsqr in Matlab)?

No, afraid not. The underlying solvers can’t handle them either.

Thanks for your reply.