matrix_trace function

Matrix Trace

Matrix Trace

The sum of the diagonal entries in a matrix. methods

matrix_trace(expr)

Arguments

  • expr: An Expression or matrix.

Returns

An Expression representing the trace of the input.

Examples

C <- Variable(3,3) val <- cbind(3:5, 6:8, 9:11) prob <- Problem(Maximize(matrix_trace(C)), list(C == val)) result <- solve(prob) result$value
  • Maintainer: Anqi Fu
  • License: Apache License 2.0 | file LICENSE
  • Last published: 2024-11-07