[PYTHON MATRIX-SIG] Type Coercion

Paul. Dubois dubois1@llnl.gov
Wed, 07 Feb 1996 15:10:40 -0800


Konrad remarks that you have to "keep" yourself at the lower precision
so you can interact to C/Fortran. This is not strictly correct. You just
have to get yourself *back* first. But:

We have been doing just that lately and in fact you have to do a
conversion of some sort nearly every time if you want to be safe,
anyway. This has to do with the contiguous issue. For example, you have
a C plotting array that wants an array of C floats. You might even have
an array of C floats but in general you don't know it is contiguous. It
might be a slice of something else, or the result of any number of
calculations that destroy contiguity (if that is a word!). 

So even if you have made yourself double, you aren't any worse off as
you repack yourself contiguous/float to get to the C routine.
-- 
Paul F. Dubois, L-472				(510)-422-5426
Lawrence Livermore National Laboratory		FAX (510)-423-9969
Livermore, CA 94550				dubois1@llnl.gov
Consulting: PaulDubois@aol.com

=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================