Macaulay2 » Documentation
Packages » NumericalLinearAlgebra :: colReduce
next | previous | forward | backward | up | index | toc

colReduce -- column reduce a matrix

Synopsis

Description

Performs Gaussian column reduction on a matrix M, retaining only the linearly independent columns.

i1 : M = matrix {{1., 2, 3}, {2, 4, 0}, {-1, -2, 3}}

o1 = | 1  2  3 |
     | 2  4  0 |
     | -1 -2 3 |

                3         3
o1 : Matrix RR    <-- RR
              53        53
i2 : colReduce(M, Tolerance=>0.01)

o2 = | 1 1 |
     | 0 1 |
     | 1 0 |

                3         2
o2 : Matrix RR    <-- RR
              53        53

Entries with absolute value below the tolerance are treated as zero and not used as pivots.

i3 : N = matrix {{0.001, 0, 0}, {1, 1, 3}, {2, 2, 5.999}}

o3 = | .001 0 0     |
     | 1    1 3     |
     | 2    2 5.999 |

                3         3
o3 : Matrix RR    <-- RR
              53        53
i4 : colReduce(N, Tolerance=>0.01)

o4 = | 0       |
     | .500083 |
     | 1       |

                3         1
o4 : Matrix RR    <-- RR
              53        53

The lower rows are treated as the lead terms unless the optional argument Reverse is set to true.

i5 : colReduce(M, Reverse=>true)

o5 = | 1 0  |
     | 0 1  |
     | 1 -1 |

                3         2
o5 : Matrix RR    <-- RR
              53        53

If the optional argument Normalize is set to true (default) each vector is normalized so that the lead entry is 1. Otherwise this step is skipped.

i6 : colReduce(M, Normalize=>false)

o6 = | 3 4 |
     | 0 4 |
     | 3 0 |

                3         2
o6 : Matrix RR    <-- RR
              53        53

Ways to use colReduce :

For the programmer

The object colReduce is a method function with options.