~ubuntu-branches/ubuntu/raring/genius/raring

« back to all changes in this revision

Viewing changes to lib/linear_algebra/linear_algebra.gel

  • Committer: Logan Rosen
  • Date: 2012-12-23 04:12:09 UTC
  • mfrom: (1.2.8)
  • Revision ID: logatronico@gmail.com-20121223041209-kduaktqblmrcakhk
New upstream release (LP: #1092569).

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
# Note that given an integer matrix, returns true iff it is invertible OVER THE INTEGERS,
147
147
# so for instance [2,0;0,1] is not invertible
148
148
# FIXME: We need good coercion rules!
149
 
SetHelp ("IsInvertible", "linear_algebra", "Is a matrix (or number) invertible (Integer matrix is invertible iff it's invertible over the integers)")
 
149
SetHelp ("IsInvertible", "linear_algebra", "Is a matrix (or number) invertible (Integer matrix is invertible if and only if it is invertible over the integers)")
150
150
function IsInvertible(n) =
151
151
(
152
152
  if IsNull (n) then return false
199
199
    [0,I(n-1);0,0]
200
200
)
201
201
 
202
 
SetHelp("JordanBlock", "linear_algebra", "Get the jordan block corresponding to lambda and n")
 
202
SetHelp("JordanBlock", "linear_algebra", "Get the Jordan block corresponding to lambda and n")
203
203
function JordanBlock(n,lambda) =
204
204
(
205
205
  if not IsInteger (n) or n < 1 then