Sparse coding with constraints in the optimization I want to solve a sparse coding problem with the conventional form:
$\arg \min (||y-dX||_2)^2+ \lambda ||X||_1$
$s.t.:$
$0 \leq X \leq b$
For the moment I am work on the sparsity problem assuming that $d$ ($1\times n$) is fixed and I want to find the best $X$ which is $n \times m$ to the above problem. The problem is that in the literature I couldn't find a good algorithm which solve the sparse problem with constraints like above!
 A: Unfortunately, this isn't one of the simpler types of problems commonly encountered in compressive sensing for which specialized methods have been developed.   
However, it's quite straight forward to formulate this as a convex quadratic programming problem with linear inequality constraints:
$\min (y-Dx)^{T}(y-Dx)+\lambda e^{T}t$
subject to 
$x \leq t$
$-x \leq t$
$Ax \leq b$
Here $e$ is the vector of all ones.  $e^{T}t=\sum_{i=1}^{n} t_{i}$.    
The vector of auxiliary variables $t$ is added as a way of moving the L1 norm out of the objective function and into the constraints.  The constraints ensure that $t_{i} \geq | x_{i} |$ for $i=1, 2, \ldots, n$.  Since the $t$ variables don't appear elsewhere in the problem, and we're minimizing the sum of the $t_{i}$, this ends up minimizing $\| x \|_{1}$.  This "epigraph trick" is a standard method for dealing with minimization of 1-norm terms in convex optimization.  
Depending on the relative sizes and density of $A$, $D$, $x$ and $y$ this could be solvable by standard QP software.  Just how big and dense are your instances?  
A: Your optimization problem is equivalent to adding linear inequality constraints to the Lasso regression problem. Luckily, someone wrote a paper about that:
James, Paulson, and Rusmevichienton.
The Constrained Lasso. Tech report, USC, 2013.
They give a modification of the standard coordinate descent algorithm for Lasso to account for the inequalities.
You could also formulate it for general-purpose solvers, which will probably be less work for you and may or may not be fast enough. Brian's answer gives one approach; here's an example of someone doing it in TFOCS.
