Prev Next Top

Preform a Pivot Operation
Syntax B = Pivot(Arc)

Description
Performs a pivot operation on the Tableau A about row r and column c. Let  m (  n ) be the number of rows (columns) in the matrix A. The output matrix B and the same number of rows and columns and for  i = 1 , \ldots , m ,  i \neq r ,  j = 1 , \ldots , n  \[
\begin{array}{rcl}
B_{r,j} & = & A_{r,j} \frac{1}{ A_{r,c} } 
\\
B_{i, j}  & = & A_{i,j} - A_{r,j} \frac{ A_{i,c} }{ A_{r, c} }
\end{array}
\] 
It follows that  \[
B_{i,c} =  \left\{ \begin{array}{ll}
     1 & {\rm if} \; i = r \\
     0 & {\rm otherwise}
\end{array} \right.
\] 


Example
The section Pivot2_1 contains an example use of the Pivot function.

Matlab Source Code
function B = Pivot(A, r, c)

[m, n]     = size(A);
B          = zeros(m, n);
B(r, :)    = A(r, :) / A(r, c);
for i = 1 : m
     if i ~= r
          B(i, :) = A(i, :) - A(i, c) * B(r, :);
     end
end 

Input File: Pivot.m