# Determinant processing

A determinant is needed in a constraint, but CVX does not support det()

In general, `det` is neither concave nor convex.

However, CVX supports `det_rootn` and `log_det` http://cvxr.com/cvx/doc/funcref.html#new-functions

help det_rootn

det_rootn nth-root of the determinant of an SPD matrix.
For a square matrix X, det_rootn(X) returns
POW(DET(X),1/(size(X,1))
if X is symmetric (real) or Hermitian (complex) and positive semidefinite,
and -Inf otherwise.

``````This function can be used in many convex optimization problems that call for
LOG(DET(X)) instead. For example, if the objective function contains nothing
but LOG(DET(X)), it can be replaced with det_rootn(X), and the same optimal
point will be produced.

Disciplined convex programming information:
det_rootn is concave and nonmonotonic; therefore, when used in
CVX specifications, its argument must be affine.
``````

help log_det

log_det Logarithm of the determinant of an SDP matrix.
For a square matrix X, log_det(X) returns
LOG(DET(X))
if X is symmetric (real) or Hermitian (complex) and positive semidefinite,
and -Inf otherwise.

``````When used in a CVX model, log_det(X) causes CVX's successive
approximation method to be invoked, producing results exact to within
the tolerance of the solver. Therefore, whenever possible, the use of
DET_ROOTN(X) is to be preferred, because the latter choice can be
represented exactly in an SDP. For example, the objective
MAXIMIZE(log_det(X))
can be (and should be) replaced with
MAXIMIZE(DET_ROOTN(X))
in fact, log_det(X) is implemented simply as N*LOG(DET_ROOTN(X)).

Disciplined convex programming information:
log_det is concave and nonmonotonic; therefore, when used in
CVX specifications, its argument must be affine.``````