addressing array under different names? [message #9551] |
Fri, 18 July 1997 00:00  |
vetoulis
Messages: 6 Registered: April 1997
|
Junior Member |
|
|
Hi, I failed to find an answer to this question via dejanews or the
manual, so here it goes.
Suppose I read an array say a(10,2000). This is 10 variables at 2000
points each. In some manipulations it is convenient to have it in
this form, but I would also like to say
plot,efield
for example after having declared that efield is somehow the same as
a(4,*). I do not want to copy it, because that
would take precious memory... Just different names for the same thing.
Is there a way to use a C-style pointer or an equivalence statement as in
F77?
Thanks a lot for any help
--
Georgios Vetoulis, Institute for Plasma Research
University of Maryland at College Park
|
|
|
Re: addressing array under different names? [message #9618 is a reply to message #9551] |
Wed, 23 July 1997 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
������� �������� wrote:
>
> Hi, I failed to find an answer to this question via dejanews or the
> manual, so here it goes.
>
> Suppose I read an array say a(10,2000). This is 10 variables at 2000
> points each. In some manipulations it is convenient to have it in
> this form, but I would also like to say
> plot,efield
> for example after having declared that efield is somehow the same as
> a(4,*). I do not want to copy it, because that
> would take precious memory... Just different names for the same thing.
>
> Is there a way to use a C-style pointer or an equivalence statement as
> in F77?
You could always say
PLOT, a(4,*)
but that of course involves copying of data. As far as I know there
is no way to accomplish the equivalent of Fortran EQUIVALENCE or
C UNION statements; this is something that I have always wanted
in IDL. There may be some issues related to memory allocation and
object-oriented design that those more learned in such things may
be able to shed some light on.
Dave
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2200
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
"I have this theory that if we're told we're bad,
then that's the only idea we'll ever have.
But maybe if we are surrounded in beauty,
someday we will become what we see." - Jewel Kilcher
|
|
|