Post Reply 
Help: Port prg to Home Mode( Minor linear_algebra)
02-10-2014, 03:53 AM (This post was last modified: 02-10-2014 03:54 AM by Han.)
Post: #10
RE: Help HOME PRG (Minor linear_algebra)
(02-09-2014 08:26 PM)compsystems Wrote:  abstract

for HOME MODE

MAKEMAT(expresion/expresion(I,J), m, n) or makemat(expresion/expresion(I,J), m, n) or makeMAT(expresion/expresion(I,J), m, n) with INITIAL INDEX (I=1,J=1)

There is only one command in Home mode no matter how you type it, it will get parsed as MAKEMAT(). If you want to use the CAS command in Home, the only way to do so is use CAS.makemat().

Quote:for CAS MODE

with uppercase and expresion(I,J)

MAKEMAT(I^2+J, 3, 5); // INITIAL INDEX (I=0,J=0)

This is incorrect. MAKEMAT() is the non-CAS command and its index starts at 1 for I and J.

Quote:lowercase

makemat( function(I,J), m, n) with INITIAL INDEX (I=1,J=1)


Incorrect. The index for the CAS command makemat() starts at 0.

Quote:
Code:
Han: interpreted "makeMat" as "makemat"
not operate as you say

This is a mistake on my part (a typo). "makeMat" is parsed as "MAKEMAT." However, due to the fact that we are typing this from the CAS view, the command line tries to parse it in a way that Home would expect (because MAKEMAT is not a CAS command). Thus, all variables within the argument are resolved first. If they cannot be resolved, this generates an error. (This is either a bug, or a poor design choice.) Anyway, the code

Code:
makeMat((I,J)->I²+J,3,5);  => "Error: Unmatch control word" ??

cannot work for two reasons:

1. makeMat is parsed as MAKEMAT (so that the functional expression is invalid)
2. in an attempt to resolve the variables in the expression (I,J)->I^2+J would result in an invalid argument


Quote:Han: There is nothing required for porting.
Code:

// port for HOME MODE
EXPORT collectPolTerms_HOME0( Poly, Var )
 BEGIN
     RETURN( sum( coeff( Poly, Var ) .* seq( Var^k, k, degree( Poly, Var ), 0, 1 ) ));
 END;

help "Error Syntax on k" =(

I will have to look into this more carefully as I overlooked the variable k the first time.

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-10-2014 03:53 AM



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