![]() |
Blitz Support : |
From: Julian Cummings (cummings_at_[hidden])
Date: 2003-10-23 15:03:50
Hello Tiago,
This is in general a tricky and dangerous thing to do. You can compare
the pointer to
the pointer returned by the data() method, but then you need to consider
the strides and
ordering of the data in order to come up with proper element indices.
Basically, you would step through the array ranks in order of
descending stride and compute the element indices from the difference
between your pointer and the data_ pointer. But this only works if the
Array you are working with has contiguous data storage and is not a
strided view or slice of some other Array. That is why I say it is
dangerous to do this.
Regards, Julian C.
Tiago de Paula Peixoto wrote:
>Hello.
>
>I'd like to know if it's possible in Blitz++ to obtain an iterator or
>the coordinates of an element inside an Array only from its pointer.
>
>Thanks.
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Blitz-support mailing list
>Blitz-support_at_[hidden]
>http://www.oonumerics.org/mailman/listinfo.cgi/blitz-support
>
>
-- Dr. Julian C. Cummings E-mail: cummings_at_[hidden] California Institute of Technology Phone: 626-395-2543 1200 E. California Blvd., Mail Code 158-79 Fax: 626-584-5917 Pasadena, CA 91125