Post Reply 
Complex matrices in programs
12-14-2014, 12:46 PM (This post was last modified: 12-14-2014 01:54 PM by Snorre.)
Post: #1
Complex matrices in programs
Hello,

I want to define a constant complex matrix within a program. The program check is successful, but when running I get an "Insufficient memory" error.
Example:
Code:
BEGIN
  LOCAL x,y,z;  // Three identical matrices:
  x:=MAKEMAT((I,J),2,2);  // works, but not what I want
  y:=([[1,1],[2,2]],[[1,2],[1,2]]);  // works, but harder to read
  z:=[[(1,1),(1,2)],[(2,1),(2,2)]];  // wanted, but throws an error
  ...

I've searched the forum for a related answer and consulted the handbook, without success.
BTW: It doesn't make a difference if complex numbers are represented as a+i*b or (a,b).

Is that a bug or did I miss something?
If this is intentional behaviour, what would be the right way to do it?

Greetings

[EDIT] P.S. I've done it now by defining the matrix as a list and convert it, e.g. list2mat({{(1,1),(1,2)},{(2,1),(2,2)}}).
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Complex matrices in programs - Snorre - 12-14-2014 12:46 PM
RE: Complex matrices in programs - Han - 12-14-2014, 10:36 PM
RE: Complex matrices in programs - Han - 12-14-2014, 11:56 PM
RE: Complex matrices in programs - Han - 12-15-2014, 12:59 AM
RE: Complex matrices in programs - Han - 12-15-2014, 02:02 AM
RE: Complex matrices in programs - Han - 12-15-2014, 03:55 AM
RE: Complex matrices in programs - Han - 12-15-2014, 04:20 AM



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