As discussed, adding and dropping columns from the active-set matrix S is especially inefficient. Because S is only used through products with vectors, it seems plausible that we could replace the explicit matrix S with an implicit linear map.
Roughly, if active is the vector of indices pointing to active variables, the linear map would compute the product S*x via the method
# product S*x
function Sprod(A, x, active)
xx = zeros(size(A,2))
xx[active] .= x
return A*xx
end
(and a corresponding method for the product S'*y).
So instead of copying and deleting individual columns of A into S, we would just keep track of the active indices and use the linear map Sprod to compute the products. The tradeoff is additional products with A. (Currently, there is only one product with A at each iteration used to pull a column from A into S, ie, this line.)
To do:
As discussed, adding and dropping columns from the active-set matrix
Sis especially inefficient. BecauseSis only used through products with vectors, it seems plausible that we could replace the explicit matrixSwith an implicit linear map.Roughly, if
activeis the vector of indices pointing to active variables, the linear map would compute the productS*xvia the method(and a corresponding method for the product
S'*y).So instead of copying and deleting individual columns of
AintoS, we would just keep track of the active indices and use the linear mapSprodto compute the products. The tradeoff is additional products withA. (Currently, there is only one product withAat each iteration used to pull a column fromAintoS, ie, this line.)To do:
SprodandSprodT