Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: nummath
See also: nmlinprog nmlinprogmaxel nmlinprogexchange

Quantlet: nmlinprogpivot
Description: auxiliary quantlet for nmlinprog; finds a pivot element in a given column

Usage: p = nmlinprogpivot(coef,rowlist,pcol {,tol})
Input:
coef nr x nc matrix, nr,nc >= 2, tableau of a linear programming problem
rowlist r x 1 vector, list of rows for searching; index ir corresponds to coef[ir+1,]
pcol scalar, 0 <= pcol <= nc-1, index of the column in which a pivot element should be found; index pcol corresponds to coef[,pcol+1]
tol (optional) scalar, tolerance. Elements of coef having absolute value smaller than tol will be considered as zeros. Default tol = 1e-7.
Output:
p.pivot integer, p.pivot+1 is the index of the row of coef that contains the pivot
p.q scalar, quotient -coef[pivot+1,1] ./ coef[pivot+1,pcol+1]

Example:
library("nummath")
coef=#(0,2,8) ~ #(2,-6,3) ~ #(-4,1,-4)
coef
; find pivot in the 2nd column
;(corresponding to the 1st left-hand variable)
pivot = nmlinprogpivot(coef,1:2,1)
pivot

Result:
Contents of coef
[1,]        0        2       -4
[2,]        2       -6        1
[3,]        8        3       -4

Contents of pivot.pivot
[1,]        1

Contents of pivot.q
[1,]  0.33333



Author: L. Cizkova, 20021119 license MD*Tech ; ------------------------------------------------------------------------- test: LC 20021119 check parameter existence and their values defaults: no possible pivots some pivot candidates found more "best" pivot candidates
(C) MD*TECH Method and Data Technologies, 05.02.2006