polyh_reduce_gen
and polyh_reduce_ineq
take as inputs a n
by m
matrix A
and return reduced forms described by orthogonal bases for lineality space
and linear span, as well as matrices generating the reduced cones.
polyh_reduce_gen(A, solver = "nnls", tol = 1e-07) polyh_reduce_ineq(A, solver = "nnls", tol = 1e-07)
A | matrix (specifying either generators or inequalities of the cone) |
---|---|
solver | either "nnls" or "mosek" |
tol | tolerance (single precision machine epsilon by default) |
The outputs of polyh_reduce_gen(A)
and polyh_reduce_ineq(A)
are lists containing the following elements:
dimC
: the dimension of the linear span of C
,
linC
: the lineality of the cone C
,
QL
: an orthogonal basis of the lineality space of C
,
set to NA
if lineality space is zero-dimensional,
QC
: an orthogonal basis of the projection of C
onto
the orthogonal complement of the lineality space of C
,
set to NA
if C
is a linear space,
A_reduced
: a matrix defining the reduced cone.
polyh_reduce_gen
: Interprets A
as generator matrix of the cone,
that is, the cone is given by {Ax|x>=0}
; the
matrix A_reduced
defines the reduced cone
in the same way.
polyh_reduce_ineq
: Interprets A
as inequality matrix of the cone,
that is, the cone is given by {y|A^Ty<=0}
; the
matrix A_reduced
defines the reduced cone
in the same way.
See this vignette for further info.
Package: conivol
A <- cbind(diag(1,3),diag(1,3)+matrix(1,ncol=3,nrow=3),c(-1,0,0)) A <- A[,sample(ncol(A))] print(A)#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] #> [1,] -1 0 1 1 1 0 2 #> [2,] 0 0 0 1 2 1 1 #> [3,] 0 1 0 2 1 0 1# using the 'generators' interpretation A_red_gen <- polyh_reduce_gen(A)$A_reduced print(A_red_gen)#> [,1] [,2] #> [1,] -0.7071068 -0.7071068 #> [2,] -0.7071068 0.7071068A_red_gen <- polyh_reduce_gen(A, solver="mosek")$A_reduced print(A_red_gen)#> [,1] [,2] #> [1,] -0.7071068 -0.7071068 #> [2,] -0.7071068 0.7071068# using the 'inequalities' interpretation A_red_ineq <- polyh_reduce_ineq(A)$A_reduced print(A_red_ineq)#> [,1] [,2] #> [1,] -0.7071068 -0.7071068 #> [2,] -0.7071068 0.7071068A_red_ineq <- polyh_reduce_ineq(A, solver="mosek")$A_reduced print(A_red_ineq)#> [,1] [,2] #> [1,] -0.7071068 -0.7071068 #> [2,] -0.7071068 0.7071068