Skip to content

Instantly share code, notes, and snippets.

@wfarr
Created March 31, 2009 03:50
Show Gist options
  • Select an option

  • Save wfarr/88039 to your computer and use it in GitHub Desktop.

Select an option

Save wfarr/88039 to your computer and use it in GitHub Desktop.
test_matr.LUdecomp
Order:
puts "#{cvs[j][j]} #{cvs[k][k]} #{cvs[j][k]}"
Matrix[*l_new].pretty_print
Matrix[*cvs.transpose].pretty_print
u_new.pretty_print
test_matr.LUdecomp
3 1 1
======================================
1 0 0
-1 1 0
0 0 1
======================================
1 1 -2
1 3 -1
1 5 1
======================================
1 1 -2
0 2 1
1 5 1
======================================
1 1 1
======================================
1 0 0
0 1 0
-1 0 1
======================================
1 1 -2
0 2 1
1 5 1
======================================
1 1 -2
0 2 1
0 4 3
======================================
3 2 4
======================================
1 0 0
0 1 0
0 -0.500 1
======================================
1 1 -2
0 2 1
0 4 3
======================================
1 1 -2
0 2 1
0 3 2.500
======================================
Matrix[[1, 1, -2], [0, 2, 1], [0, 3, (5/2)]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment