Complex Variables and Memory mapping

Hi,
does anyone know if it is possible to use memory mapping with complex variables? I wanted to use the memmapfile constructor for it, but it seems to support only doubles and integers.
thank you in advance
Hi,
weiß jemand ob es möglich ist komplexe Variabeln mit Memorymapping zu nutzen? Ich wollte dafür den memmapfile constructor nutzen, aber der scheint Komplexe Zahlen nicht zu unterstützen.
Im Vorraus schon mal vielen Dank
Salut
est-ce que quelqu’un sache si il est possible de utiliser Memory Mapping por des variables complexe?
Merci

回答 (1 件)

José-Luis
José-Luis 2012 年 11 月 7 日
編集済み: José-Luis 2012 年 11 月 7 日

1 投票

Yes, but you would need to use the C/C++ or FORTRAN api. It provides you with a variety of routines to handle .mat files. If you want to do bit operations on those files (or why do you want to do memory mapping?) then you might need to dig a little bit further, and look at how mat files are configured. In my opinion, you need to have a very good reason to do those kind of manipulations, as it very easy to corrupt your files. It is often enough to use the api.

5 件のコメント

NN
NN 2012 年 11 月 7 日
編集済み: NN 2012 年 11 月 7 日
Thank you José-Luis I'm currently working on some optical problems and the used variables are complex valued. Since the matrices used are quite large (about 20 000 x 20 000) I run fast out of memory. I thought that I might have chance to use memory mapping to eliminate this problem. I wanted to use the memmapfile constructor for it, but it seems to support only doubles and integers.
José-Luis
José-Luis 2012 年 11 月 8 日
Then, you might want to use the HDF5 data format. It was specifically designed to handle large datasets. It can even handle complex numbers. To look at the Matlab interface:
doc hdf5
NN
NN 2012 年 11 月 8 日
Thank you José-Luis, but I am not sure how to use your tip. In the h5create help it is written that hdf5 doesn't support complex doubles. Do you have an example how I can never the less get that support? And I also think that the HDF5 data is read into the RAM as soon as I read it. Hence, I think it wont help me to prevent the out of memory problem. But I might be mistaken.
José-Luis
José-Luis 2012 年 11 月 8 日
編集済み: José-Luis 2012 年 11 月 8 日
Well, the HDF5 has a C/C++ and Fortran interface, which means that you could use the C/C++ api to manage your files. I have never actually used complex values. You could of course save your complex and real values in different files, but that's just asking for future headaches.
I also have no idea what your access patterns are going to be, but if you really have such large data, it might be worth using databases (MySQL pops to mind).
Sorry I can't be of more help.
NN
NN 2012 年 11 月 8 日
Thank you for all the time you used to help me. I feared something like that would be the case. By the way,the access patterns are essentially given by the fft2 so I always get problems as soon as I load the arrays into my RAM. (It doubles my used memory)

サインインしてコメントする。

製品

質問済み:

NN
2012 年 11 月 7 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by