Skip to content

blegat/RowEchelon.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reduced Row Echelon form computation

Build Status
Build Status Build Status
Coveralls branch Codecov branch

This small package contains the functions rref and rref!. The code was initially part of Julia and was developed by Jeff Bezanson (see here).

Example of computing rref_with_pivots :

rref_with_pivots(A)

Compute the reduced row echelon form of the matrix A together with the position of the pivots. Since this algorithm is sensitive to numerical imprecision,

  • Complex numbers are converted to ComplexF64
  • Integer, Float16 and Float32 numbers are converted to Float64
  • Rational are kept unchanged
julia> rref_with_pivots([ 1  2 -1  -4;
              2  3 -1 -11;
             -2  0 -3  22])
3×4 Array{Float64,2}:
 1.0  0.0  0.0  -8.0
 0.0  1.0  0.0   1.0
 0.0  0.0  1.0  -2.0
 Int64[3]:
 1
 2
 3

julia> rref_with_pivots([16  2  3  13;
              5 11 10   8;
              9  7  6  12;
              4 14 15   1])
4×4 Array{Float64,2}:
 1.0  0.0  0.0   1.0
 0.0  1.0  0.0   3.0
 0.0  0.0  1.0  -3.0
 0.0  0.0  0.0   0.0
 Int64[3]:
 1
 2
 3

julia> rref_with_pivots([ 1  2  0   3;
              2  4  0   7])
2×4 Array{Float64,2}:
 1.0  2.0  0.0  0.0
 0.0  0.0  0.0  1.0
 Int64[3]:
 1
 4

Example of computing rref :

rref(A)

Compute the reduced row echelon form of the matrix A. Since this algorithm is sensitive to numerical imprecision,

  • Complex numbers are converted to ComplexF64
  • Integer, Float16 and Float32 numbers are converted to Float64
  • Rational are kept unchanged
julia> rref([ 1  2 -1  -4;
              2  3 -1 -11;
             -2  0 -3  22])
3×4 Array{Float64,2}:
 1.0  0.0  0.0  -8.0
 0.0  1.0  0.0   1.0
 0.0  0.0  1.0  -2.0

julia> rref([16  2  3  13;
              5 11 10   8;
              9  7  6  12;
              4 14 15   1])
4×4 Array{Float64,2}:
 1.0  0.0  0.0   1.0
 0.0  1.0  0.0   3.0
 0.0  0.0  1.0  -3.0
 0.0  0.0  0.0   0.0

julia> rref([ 1  2  0   3;
              2  4  0   7])
2×4 Array{Float64,2}:
 1.0  2.0  0.0  0.0
 0.0  0.0  0.0  1.0

About

Small package containing the rref fonction for computing the reduced row echelon form of the matrix A

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages