[GAP Forum] InstallMethod

Hubert Kiechle ms8a017 at math.uni-hamburg.de
Tue Dec 9 21:44:34 GMT 2003


Hi GAP-forum,

I want to invert 2x2 matrices over a (finite) algebra with zero
divisors. As there does not seem to be a method available, I tried to
provide one, but the following file
after *Read*ing into gap leads to the ERROR message below which seems
cryptic to me. In fact, after *return*ing from the break loop
*Inverse* works perfectly well.

How can I get rid of the ERROR message?
Why is there no method for *Inverse* in matrix rings over rings with
zero divisors?


-----  file ----
Inv22:=function(m)
  local  u;
  if DimensionsMat(m)=[2,2] then
    u:=Determinant(m);
    if IsUnit(u) then
      return Inverse(u)*[[m[2][2],-m[1][2]],[-m[2][1],m[1][1]]];
    else 
      return fail;
    fi;
  else
    return fail;
  fi;
end;

InstallMethod( Inverse,
        "Inverse of 2x2 Matrix over any Ring",
        [IsMatrix and IsRingElementCollColl],Inv22);

---------
Error, required filters [ "IS_LIST", "IS_DENSE_LIST", "IS_HOMOG_LIST", 
  "IS_TABLE_LIST", "IsListOrCollection", "IsCollection", "IsExtAElement", 
  "CategoryCollections(IsExtAElement)", 
  "IsNearAdditiveElement", "CategoryCollections(IsNearAdditiveElement)", 
  "CategoryCollections(CategoryCollections(IsNearAdditiveElement))", 
  "IsNearAdditiveElementWithZero", 
  "CategoryCollections(IsNearAdditiveElementWithZero)", 

"CategoryCollections(CategoryCollections(IsNearAdditiveElementWithZero))", 
  "IsNearAdditiveElementWithInverse", 
  "CategoryCollections(IsNearAdditiveElementWithInverse)", 

"CategoryCollections(CategoryCollections(IsNearAdditiveElementWithInverse))"
    , "IsAdditiveElement", "CategoryCollections(IsAdditiveElement)", 
  "CategoryCollections(CategoryCollections(IsAdditiveElement))", 
  "IsExtLElement", "CategoryCollections(IsExtLElement)", 
  "CategoryCollections(CategoryCollections(IsExtLElement))",
"IsExtRElement", 
  "CategoryCollections(IsExtRElement)", 
  "CategoryCollections(CategoryCollections(IsExtRElement))", 
  "IsMultiplicativeElement", 
  "CategoryCollections(CategoryCollections(IsMultiplicativeElement))", 
  "IsGeneralizedRowVector" ]
for 1st argument do not match a declaration of InverseImmutable called
from
<compiled or corrupted call value>  called from
<function>( <arguments> ) called from read-eval-loop


Thanks for any help,

Hubert

* Priv. Doz. Dr. Hubert Kiechle *
*                               *
* Mathematisches Seminar        *
* Universität Hamburg           *   Outside of a dog,
* Bundesstr. 55                 *     a book is man's best friend.
* D-20146 Hamburg               *   Inside of a dog,
* Germany                       *     it is too dark to read.
*                               *
* Tel.: +49 40 42838 5186       *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
http://www.math.uni-hamburg.de/home/kiechle/





More information about the Forum mailing list