Function Repository Resource:

PivotColumns

Source Notebook

Get the positions of the columns that are pivot columns of a matrix

Contributed by: Dennis M Schneider

ResourceFunction["PivotColumns"][mat]

returns the positions of the columns that are pivot columns of a matrix.

Examples

Basic Examples (2) 

Find the pivot columns of a 3 x 4 matrix:

In[1]:=
ResourceFunction[
 "PivotColumns"][{{1, 3, -2, 1}, {2, 6, -2, 8}, {-1, -3, 8, 17}}]
Out[1]=

Check the result:

In[2]:=
MatrixForm[RowReduce[{{1, 3, -2, 1}, {2, 6, -2, 8}, {-1, -3, 8, 17}}]]
Out[2]=

Define a matrix with complex entries:

In[3]:=
(mat = {{-5 + 4 I, -1 + 9 I, -5 + 13 I, -5 + 4 I}, {0, 0, 1, 0}, {2 + 3 I, 5 + I, 7 + 2 I, 2 + 3 I}, {I, 1 + I, 1 + I, I}}) // MatrixForm
Out[4]=

Find its pivot columns:

In[5]:=
ResourceFunction["PivotColumns"][mat]
Out[5]=

Check them:

In[6]:=
RowReduce[mat] // MatrixForm
Out[8]=

Publisher

Dennis M Schneider

Version History

  • 1.0.0 – 31 July 2019

License Information