normalize: Bring a system of (in)equalities in a standard form

View source: R/normalize.R

normalizeR Documentation

Bring a system of (in)equalities in a standard form

Description

Bring a system of (in)equalities in a standard form

Usage

normalize(A, b, operators, unit = 0)

Arguments

A

[numeric] Matrix

b

[numeric] vector

operators

[character] operators in {<,<=,==,>=,>}.

unit

[numeric] (nonnegative) Your unit of measurement. This is used to replace strict inequations of the form a.x < b with a.x <= b-unit. Typically, unit is related to the units in which your data is measured. If unit is 0, inequations are not replaced.

Value

A list with the folowing components

  • A: the A corresponding to the normalized sytem.

  • b: the constant vector corresponding to the normalized system

  • neq: the number of equations

  • nleq: the number of non-strict inequations (<=)

  • order: the index vector used to permute the original rows of A.

Details

For this package, a set of equations is in normal form when

  • The first neq rows represent linear equalities.

  • The next nleq rows represent inequalities of the form a.x <= b

  • All other rows are strict inequalities of the form a.x < b

If unit>0, the strict inequalities a.x < b are replaced with inequations of the form a.x <= b-unit, where unit represents the precision of measurement.

Examples


A <- matrix(1:12,nrow=4)
b <- 1:4
ops <- c("<=","==","==","<")
normalize(A,b,ops)
normalize(A,b,ops,unit=0.1)


lintools documentation built on Jan. 17, 2023, 1:06 a.m.