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 nmlinprogpivot

Quantlet: nmlinprogexchange
Description: auxiliary quantlet for nmlinprog; exchange of a left-hand and a right-hand variable

Usage: coef = nmlinprogexchange(coefin,nrow,ncol,prow,pcol)
Input:
coefin nr x nc matrix, tableau of a linear programming problem
nrow integer, number of rows of coefin to consider in exchange
ncol integer, number of columns of coefin to consider in exchange
prow integer, index of a left-hand variable to exchange (corresponds to coef[prow+1,])
pcol integer, index of a right-hand variable to exchange (corresponds to coef[,pcol+1])
Output:
coef nr x nc matrix, new tableau

Example:
library("nummath")
coef=#(0,2,8) ~ #(2,-6,3) ~ #(-4,1,-4)
coef
; example as in Numerical Recipes, p. 436
; lines: z, x1, x4; columns: constant, x2, x3
; exchange x1 and x2
nmlinprogexchange(coef,2,2,1,1)
; lines: z, x2, x4; columns: constant, x1, x3

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

Contents of coef
[1,]  0.66667 -0.33333  -3.6667
[2,]  0.33333 -0.16667  0.16667
[3,]        9     -0.5     -3.5



Author: L. Cizkova, 20021119 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006