Numerical Recipes Forum  

Go Back   Numerical Recipes Forum > Obsolete Editions Forum > C++ Programming with NR

Reply
 
Thread Tools Display Modes
  #1  
Old 07-19-2012, 04:42 PM
wyoui wyoui is offline
Registered User
 
Join Date: Jul 2012
Posts: 1
Creating a vector with length > 2GB ?

Hi everyone,

That's my first post here. I am French, so please, excuse my bad accent.
First, thanks to the NR authors and to all of you who are answering questions so precisely. It has been like 5 years that I am reading the forum from time to time and it is actually the first time I did not find a precise answer to my question.

Here is my issue: I have to create a very large vector (size >2GB), and do its FFT. I use the NR program "realft" and allocate the memory of the vector with "vector" from "nrutil". The program is in C.

I am using DEV-C++ as a compiler, or visual studio 2012. I am running on windows 7 64 bits and have 16 GB of RAM.

With both compilers, I can create a vector of 2^28 floats, i.e. about 1 GB. However, I cannot create a vector of more than 2 GB in size (2^29 floats). I get the following error message: "Numerical Recipes run time error... Allocation failure in vector()"

I assumed that it's because my compilers are both 32 bits.

Am I correct? If yes, will the issue be solved with a 64 bits compiler? Or can I modify the "nrutil" function to overcome this limit (using __int64 instead of long for the dimensions)?

Well, to summarize: does anyone have a solution/explanation for me?

Thanks a lot in advance for your help.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:44 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.