next | previous | forward | backward | up | top | index | toc | Macaulay2 web site

inverse(Matrix) -- compute the inverse

Synopsis

Code

../../m2/methods.m2:506:52-515:26: --source code:
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:629:7-632:10]*} ../../m2/methods.m2:506:21-506:21
| key    : Symbol          -- inverse                                        ../../m2/methods.m2:506:14-506:16
| -- function f:
| ../../m2/matrix1.m2:629:8-632:11: --source code:
|      m -> (
|           (quo,rem) := quotientRemainder(id_(target m), m);
|           if rem != 0 then error "matrix not invertible";
|           quo))