Post Reply 
Help: Port prg to Home Mode( Minor linear_algebra)
02-03-2014, 07:22 PM (This post was last modified: 02-04-2014 03:27 AM by Han.)
Post: #4
RE: Help HOME PRG (Minor linear_algebra)
Quote:Using the seq cmd, number of instructions is reduced =)

That may be true, but sometimes it is beneficial to separate your commands. For example, using coldim() inside the seq() command means coldim() is computed repeatedly -- which is unnecessary, and slow if you have a much larger matrix. If you precompute the dimensions, then the seq() command would only be reading a value as opposed to calculating it every iteration. Secondly, separating the commands makes debugging much easier.

As for list vs matrix, try:

Code:

EXPORT MINOR(m)
BEGIN
  LOCAL n=dim(m),n1,n2;
  n1:=n(1); n2:=n(2);
  MAKEMAT(det(delcols(delrows(m,I),J)),n1,n2);
END;

Graph 3D | QPI | SolveSys
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) - Han - 02-03-2014 07:22 PM



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