Given a symmetric positive definite matrix $\bf Q$ and a bounded set $\mathcal X$, what is the following maximum?
$$ \max_{{\bf x} \in \mathcal X} {\bf x}' {\bf Q} \, {\bf x} $$
Using a Matlab program and a $2$-dimensional example, I found the maximizing point ${\bf x} \in \mathcal X$. Unfortunately, other $\bf x$'s also maximize the objective and are not in $\mathcal X$. How can I develop an algorithm that solves the problem that for all ${\bf x} \in \mathcal X$ it holds: ${\bf x}' {\bf Q} \, {\bf x} = c$, where $c$ is at its maximum?