On Tue, 16 Jun 2009, Matthew Brand wrote: > What is the formula for calculating the number of bytes to > createjmf_jmf_ a file for mapping for a pre-known sized array of a > given type? > > require 'jmf' > NX =. 10 > NY =. 10 > nbytes=: 7!:5 <'tmp' [ tmp=. 1p1 $~ NX,NY NB. my estimate of > number of bytes for 10x10 array of floats > createjmf_jmf_ '/tmp/tmp';nbytes > (JFL;NX) map_jmf_ 'tmp';'/tmp/tmp' > ](NX,NY) NB. the shape I want > 10 10 > ]$ tmp NB. not the shape I wanted > 19 10
jmf gives an over-estimate of the leading shape (19) because storage for array are not closely packed. But I guess that should not be a problem because that map file actually fit the array you wanted to map. -- regards, ==================================================== GPG key 1024D/4434BAB3 2008-08-24 gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
