# Issues with CVX package for optimization

I am trying to use the cvx package for optimization. However, I am having some issues with it. I have a variable X which is a matrix but I cannot add $X^{-1}$ in the objective function. What should I do? Is it even possible to use it or it violates the definition of semi definite programming and hence cannot be included

• You need to provide more context in terms of what you're trying to do. What is the objective function you would like to use? Typically, you can only use $X^{-1}$ if $X$ is positive definite, and you must indicate that in the input program. Aug 28 '13 at 18:15
• @VictorLiu. Yeah I have this constraint that $X^{-1}$ is positive definite Aug 28 '13 at 18:23
• @VictorLiu. My objective function is $f(X) = y'Xy + logdet(X) + r'X^{-1}r$ Aug 28 '13 at 20:35
• You objective is neither convex nor concave in general (consider the scalar case with, e.g., y=0 and r = 0.3.) Hence, cvx and convex semidefinite programming is not applicable. Aug 28 '13 at 21:16
• If a matrix $X^{-1}$ is positive definite, then this is equivalent to $X$ being positive definite. Simply replace your constraint by $X$ being positive definite. Aug 30 '13 at 2:17