uplo2uco function

Transform box-type inequalities into matrix and vector form

Transform box-type inequalities into matrix and vector form

Transform a set of inequalities param["name"] >= lower["name"] and param["name"] <= upper["name"] into a list with matrix u and vector co such that u%*%param>=co. In addition to box inequalities above, user can provide linear inequalities in a form like "a+2*c+3*b >= 0" where 'a', 'b' and 'c' must be names of param components. Numeric and symbolic coefficients and right hand sides are allowed in these expressions. However, symbols must be defined at the moment of calling uplo2uco() so that expressions containing such symbols could be eval()-ed to numerical values. All inequalities must be written with '>=' sign (not with '<=', '>', ...).

uplo2uco(param, upper = NULL, lower = NULL, linear = NULL)

Arguments

  • param: a named vector whose names will be used for parsing inequalities
  • upper: a named numeric vector of upper limits
  • lower: a named numeric vector of lower limits
  • linear: a string vector of linear inequalities

Returns

a list with numeric matrix 'u' and vector 'co' such that u%*%param-co>=0

See Also

equa2vecmat for parsing linear expressions

  • Maintainer: Serguei Sokol
  • License: GPL-2
  • Last published: 2023-06-26