Post Reply 
Help: Port prg to Home Mode( Minor linear_algebra)
02-09-2014, 03:15 PM (This post was last modified: 02-09-2014 03:29 PM by compsystems.)
Post: #5
RE: Help HOME PRG (Minor linear_algebra)
Code:

export MINOR_HOME1(m)
begin
   local n;
   n:=dim(m);
   return(makemat(det(delcols(delrows(m,I),J)),n(1),n(2)));
end;

MINOR_HOME1([[1,2,3],[4,5,6],[7,8,9]]); [enter] returns
[[-3,-6, -3]
[-6,-12,-6]
[-3,-6, -3]] OK

Code:

MINOR_CAS1(m):=
begin
   local n;
   n:=dim(m);
   return(makemat(det(delcols(delrows(m,I),J)),n(1),n(2)));
end

MINOR_CAS1([[1,2,3],[4,5,6],[7,8,9]]); [enter] returns ???
{{"Error: Bad Argument Type","Error: Bad Argument Type","Error: Bad Argument Type"},
{"Error: Bad Argument Type","Error: Bad Argument Type","Error: Bad Argument Type"},
{"Error: Bad Argument Type","Error: Bad Argument Type","Error: Bad Argument Type"}}


Code:

MINOR_CAS0(m1):=
begin 
 return(seq(seq(det(delRow(delCol(m1,j),I)),j,1,colDim(m1)),I,1,rowDim(m1)))​;  
end;

MINOR_CAS0([[1,2,3],[4,5,6],[7,8,9]]); [enter] returns
[[-3,-6, -3]
[-6,-12,-6]
[-3,-6, -3]] OK
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Help HOME PRG (Minor linear_algebra) - compsystems - 02-09-2014 03:15 PM



User(s) browsing this thread: 1 Guest(s)