write_sdpa_format_file | R Documentation |
Outputs a spectrahedron (the matrices defining a linear matrix inequality) and a vector (the objective function) to a SDPA format file.
write_sdpa_format_file(spectrahedron, objective_function, output_file)
spectrahedron |
A spectrahedron in n dimensions; must be an object of class Spectrahedron |
objective_function |
A numerical vector of length n |
output_file |
Name of the output file |
A0 = matrix(c(-1,0,0,0,-2,1,0,1,-2), nrow=3, ncol=3, byrow = TRUE)
A1 = matrix(c(-1,0,0,0,0,1,0,1,0), nrow=3, ncol=3, byrow = TRUE)
A2 = matrix(c(0,0,-1,0,0,0,-1,0,0), nrow=3, ncol=3, byrow = TRUE)
lmi = list(A0, A1, A2)
S = Spectrahedron(matrices = lmi)
objFunction = c(1,1)
write_sdpa_format_file(S, objFunction, "output.txt")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.