Post Reply 
Constant Vector as Argument in PPL
06-22-2024, 08:34 PM
Post: #10
RE: Constant Vector as Argument in PPL
(06-22-2024 07:10 PM)NumericDavid Wrote:  I have a feeling that issue might be related to a CAS/ not CAS irritation. My application is purely numeric but normalize() seems to try to return an expression instead of numeric vector.

I think you are on the right track. It appears that normalize() is a command dedicated to CAS, and passing a parameter inside a PPL program might not be handled correctly. Therefore, when you enter the program not as pure PPL, but as a CAS region, everything works correctly:
Code:
#cas
bla:=
normalize([0,0,-1]);
#end

However, a simpler solution is to substitute individual elements of the vector one by one, e.g., normalize[0,0,-1] instead of normalize([0,0,-1]).
Then your program will look like this:
Code:
export bla()
begin
  return normalize(0,0,-1);
end;

This should solve your problem.

Piotr Kowalewski
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Constant Vector as Argument in PPL - komame - 06-22-2024 08:34 PM



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