Knowing that CG is an efficient method of solving sparse systems of linear equations, I have used it to solve a linear system of equations generated by a finite element algorithm.
In order to impose an additional boundary condition, I have to ensure that the components of the solution are greater than or equal to zero, resulting in a slightly modified version of the minimisation problem
$ x_{*} = \arg \min_{x \in \mathbb{R}^n} \varphi(x), \quad \varphi(x) = \frac{1}{2}x^TAx - b^T x, $
specifically
$ x_{*} = \arg \min_{x \in \mathbb{R}_{+}^n} \varphi(x), \quad \varphi(x) = \frac{1}{2}x^TAx - b^T x. $
How would I go about modifying the conjugate gradient algorithm to include this restriction?
See this paper for a generalization of CG type methods to non-negative constrained setting: https://www.hindawi.com/journals/jam/2013/986317/