You can just allocate enough memory for the union of all of the nonzeros in your problem.
I would suggest initialising the solver with an A matrix that is 1 in those places where a zero might appear, and zero elsewhere. You can then call the update function to populate it with the correct values at each time step.
Note that there is no problem with updating an entry of A to zero (and then back again) - the only prohibition is trying to put a nonzero value in a place where OSQP is not expecting one from the outset.
> --
> You received this message because you are subscribed to the Google Groups "OSQP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
osqp+uns...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/osqp/91a56bc5-4ac7-431b-bd9c-723eb30364c3%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.