Post Reply 
[42S] Test for COMPLEX matrix
03-23-2015, 02:05 PM
Post: #1
[42S] Test for COMPLEX matrix
This must've come up before, I'm sure.
Take the sequence:

Code:
COMPLEX
+/-
COMPLEX
It will return the complex conjugate of either a matrix or a number.
If - like me - you're writing code that must run for real input as well as for complex,
you test your input. But REAL? sadly only tests for real numbers, not matrices.

So my question, or challenge if you want, is:
Write a routine that will deliver the complex conjugate of a complex matrix, and will leave a real matrix alone. You cannot EDIT or INDEX the matrix, and you can use only two stack levels.

In: Complex matrix
Out: Complex conjugate matrix

In: real matrix
Out: matrix untouched.

Anyone?

Cheers, Werner
I can do it, but it's not pretty. I hope I'm missing something.

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
[42S] Test for COMPLEX matrix - Werner - 03-23-2015 02:05 PM
RE: [42S] Test for COMPLEX matrix - Werner - 03-23-2015, 06:05 PM
RE: [42S] Test for COMPLEX matrix - Werner - 03-24-2015, 07:12 AM
RE: [42S] Test for COMPLEX matrix - Werner - 03-24-2015, 08:11 PM
RE: [42S] Test for COMPLEX matrix - Werner - 03-25-2015, 10:42 AM
RE: [42S] Test for COMPLEX matrix - Werner - 03-25-2015, 03:54 PM
RE: [42S] Test for COMPLEX matrix - Werner - 03-26-2015, 12:27 PM



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