[Matrix-SIG] I have working code that implements active-castingconcept.

Travis Oliphant Oliphant.Travis@mayo.edu
Thu, 20 Jan 2000 01:17:27 -0600 (CST)


> 
> This is a great idea, and it will certainly simplify my code. However,
> I'd like to raise one point of concern:
> 
> I am using some functions that use 2 arrays: a small one, used repeatedly
> and a big one that changes on every invocation. If the small array is
> passive-d and the big one is active-f, this will cast the small one
> to 'f' on every invocation. Without the active/passive patch, I'd find
> out about this inefficiency because the result would be of type 'd'. Would
> there be any way of warning the programmer for this kind of inefficient
> casting with the new code?

Let me see if I understand:  You want to be able to catch that you are
casting the passive array on every function call (presumably so you can
change it and cast once)? 

Right now you have to check the output type, correct?

With the current changes in CVS, the result would be of type 'active-f'
which is not the type of the small input array, so you could just check to
make sure the types are the same.  What am I missing?

Another person wanted two "active" arrays of different types to raise an
exception, so with that change you would make both arrays active and if
they were not the same type an error would occur.  What do you think?

Travis