[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
objarr
- Subject: objarr
- From: bjackel(at)phys.ucalgary.ca
- Date: Thu, 02 Sep 1999 13:53:02 -0600
- Newsgroups: comp.lang.idl-pvwave
- Organization: The University of Calgary
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:16426
Say I have a single object called Vector3, that allows nice things like
mag= Vector3->magnitude()
dot= Vector3->dotproduct(secondvector)
and so on. Then assume I've got a whole pile of vectors
pile= OBJARR(100)
FOR indx=0,99 DO pile[i]= Vector3
and want to manipulate them all at once
magpile= pile->magnitude()
% Object reference must be scalar in this context: PILE
% Execution halted at: $MAIN$
One foremost advantages of IDL is that logical groups of
vector and matrix operations can be carried out with a
single command. Am I correct in fearing that the only
way to get what I want is with something like this?
magpile= DBLARR(N_ELEMENTS(pile))
FOR indx=0,N_ELEMENTS(pile)-1 DO magpile[indx]=
pile[indx]->magnitude()
Any comments or suggestions would be most welcome.
Brian Jackel