equa2vecmat function

Parse linear equations/inequalities

Parse linear equations/inequalities

parse a text vector of linear equations and produce a corresponding matrix and right hand side vector

equa2vecmat(nm_par, linear, sep = "=")

Arguments

  • nm_par: a string vector of variable names. It will be used in the symbolic derivation.
  • linear: string vector of linear equations like "a+2*c+3*b = 0"
  • sep: separator of two parts of equations. Use for example ">=" for linear inequalities

Returns

an augmented matrix. Its first column is the rhs vector. Other columns are named by nm_par. If the vector linear is NULL or its content is empty a NULL is returned

Examples

equa2vecmat(c("a", "b", "c"), "a+2*c+3*b = 0", "=")
  • Maintainer: Serguei Sokol
  • License: GPL-2
  • Last published: 2023-06-26