Re: alternative to execute [message #47344 is a reply to message #47258] |
Thu, 02 February 2006 09:28   |
news.qwest.net
Messages: 137 Registered: September 2005
|
Senior Member |
|
|
"greg michael" <greg.michael@gmail.com> wrote in message
news:1138881535.246386.5040@f14g2000cwb.googlegroups.com...
> Hi Bob,
> I'm writing a program to process a spectral image cube on the fly. Once
> defined, the function would be applied to whichever part of the cube is
> being viewed. So yes, it's like a calculator, but I don't want to use a
> workspace because it needs to work without any further interaction. But
> your suggestion to convert operators to functions could simplify the
> parser - I'll think about that.
> many thanks,
> Greg
I see. The user defined function (udf) will be applied only to a subset of
the
overall data, then the user will scroll around necessitating that the
function
be re-applied (is that right). So, it is not possible to perform the
operation
on the entire spectral image cube? (memory requirements?).
On the other hand, it seems like you want to give the user unlimited power
in creating a function, but is that really necessary? That basically
requires that you
write your own language or operating system.(with "execute()" you would be
leveraging
IDLs language, but with out it, you have to create your own).
Perhaps you can get 99% of the functionality if you create a general
function,
and allow the user to input the parameters. For matrices m1,m2,m3,m4
you could have
a_1*(m1)^b_1 + a_2*(m2)^b_2+....
Then just have a series of boxes where the user inputs the parameters
a_1,a_2,etc and b_1,b_2,etc,
as well as the input matrices m1, m2...
It would be a bit more complicated if you want to do operations with the
matrices on other
matrices, but you could make a couple general functions to cover most cases
[a_1*(m1)^b_1]*[a_2*(m2)^b_2]
where of course b_2 = -1 to make it a division.
So there you have 2 general functions, and that should cover a great deal of
the user defined functions. Of course you can expand this according to your
actual needs.
Cheers,
bob
PS another idea, can you create a C language DLL or a DLM that could perform
a similar
function to the "execute" command? I don't know, just an idle thought.
|
|
|