Input:
 ▸ Transform matrix , Measurement matrix
 ▸ CS matrix A:
 ▸ Measurement vector y
 ▸ K being the signal sparsity
 ▸ Halting criterion
Output:
 ▸  -sparse approximation of the target signal
() , ,
() while  halting condition false do
()
()                    (signal proxy)
()           (support of best 2K-sparse approximation)
()             (merge supports)
()         (solve least squares)
()              (Prune: best -sparse approximation)
()                 (update current sample)
() end while
()
() return
Algorithm 3: CoSaMP.