Afficher un message
Vieux 09/06/2008, 11h14   #2
Lionel B
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to define and use large dynamic two dimension arrays

On Mon, 09 Jun 2008 00:23:38 -0700, Atemporal wrote:

> hi, all, i got some problem when define and use large dynamic two
> dimension arrays.
> At first, i use vector<vector<double>> p1,


Sounds reasonable (it has to be `vector<vector<double> >', but I guess
you know that already).

> i have three such arrays and
> each is around 10000*10000, the program compiles ok, however, when it
> gets following error when running
>
> Unhandled exception at 0x7c812aeb in Value.exe: Microsoft C++ exception:
> std::bad_alloc at memory location 0x0013f988..


Blimey, I'm not surprised. 10000 x 10000 doubles is ... how many Gb of
memory? Your memory allocation failed.

> What shall I do?


Request less memory. We can't tell you how to do that, since we don't
know what problem you're trying to solve (and it would probably be OT
here anyway). If you figure out how to reduce the memory requirements of
your program and have any implementation queries by all means ask again
here.

Regards,

--
Lionel B
  Réponse avec citation
 
Page generated in 0,04947 seconds with 9 queries