I want to solve a nonlinear optimization problem
$$\underset{\mathbf{x}\in \mathbb{R}^n}{\operatorname{argmin}} f(\mathbf{x})$$
subject to a support constraint $$\mathbf{x}=[x\_1,\cdots,x\_n]^T, \quad x\_1=x\_2=\cdots=x\_i=0,\quad x\_j=x\_{j+1}=\cdots=x\_n=0 \quad (1<i<j<n)$$

Is there any algorithm or library able to solve this kind of problem?