next | previous | forward | backward | up | top | index | toc | home

inverse(Matrix) -- compute the inverse

Synopsis

Code

-- ../m2/methods.m2:498-507
cacheValue = key -> f -> new CacheFunction from (x -> (
          c := try x.cache else x.cache = new CacheTable;
          if c#?key then (
               val := c#key;
               if class val === CacheFunction then (
                    remove(c,key);
                    c#key = val x)
               else val
               )
          else c#key = f x))
| symbol   class              value                                        location of symbol
| ------   -----              -----                                        ------------------            
| f      : FunctionClosure -- {*Function[../m2/matrix1.m2:642:50-642:70]*} ../m2/methods.m2:498:20-498:20
| key    : Symbol          -- inverse                                      ../m2/methods.m2:498:13-498:13
| -- function f:
| -- ../m2/matrix1.m2:642
| inverse Matrix := (cacheValue symbol inverse) ( m -> id_(target m) // m )